The original comment indicates that using `bzero()` directly may result in dead store elimination, so they explicitly avoided calling `bzero()` as you do now. `explicit_bzero` is used in cryptographic software to clear keys from process memory after use, even if that memory is not read any more afterwards.
Maybe it would be safer like this? (I copied the approach from https://android.googlesource.com/platform/external/openssh/+/refs/tags/android-6.0.1_r70/openbsd-compat/explicit_bzero.c, so that should work on Android.)
Caveat, I was hand-editing the diff and did not find time to set up the toolchain to build this; but the general approach should work?
Variables
TERMUX_PKG_PLATFORM_INDEPENDENT
TERMUX_DEBUG
TERMUX_PKG_HAS_DEBUG
TERMUX_PKG_ESSENTIAL
TERMUX_SUBPKG_ESSENTIAL
TERMUX_PKG_NO_STATICSPLIT
TERMUX_PKG_BUILD_IN_SRC
TERMUX_PKG_FORCE_CMAKE
TERMUX_PKG_HOSTBUILD
should not accept arbitrary values for marking them "enabled". Instead
they should accept boolean values which makes them easier to handle and
also makes their meaning clear.
build-package.sh should make decision based on variable's value but not on
whether it is set or empty.
%ci:no-build
OpenSSH uses a link to take a backup while replacing the known_hosts
file:
(1) link known_hosts to known_hosts.old
(2) move new file to known_hosts (overwriting the link there)
Since links are not allowed we replace link with rename:
(1) rename known_hosts to known_hosts.old
(2) move new file to known_hosts
This means that there is a window between (1) and (2) where the
known_hosts file is not available, but that is a really short window
and is hopefully acceptable here.
Fixes#2909.
many distributions use "AcceptEnv LANG LC_*" by default for sshd. this
fixes UTF-8 output from such servers that do not happen to set LANG or
LC_CTYPE to UTF-8 by default server-side (termux env already sets
LANG=en_US.UTF-8)