diff --git a/packages/openssh/build.sh b/packages/openssh/build.sh index 7df869f65..2fb940fab 100755 --- a/packages/openssh/build.sh +++ b/packages/openssh/build.sh @@ -1,7 +1,7 @@ TERMUX_PKG_HOMEPAGE=https://www.openssh.com/ TERMUX_PKG_DESCRIPTION="Secure shell for logging into a remote machine" TERMUX_PKG_VERSION=7.8p1 -TERMUX_PKG_REVISION=2 +TERMUX_PKG_REVISION=3 TERMUX_PKG_SHA256=1a484bb15152c183bb2514e112aa30dd34138c3cfb032eee5490a66c507144ca TERMUX_PKG_SRCURL=https://fastly.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="libandroid-support, ldns, openssl, libedit, libutil" diff --git a/packages/openssh/hostfile.c.patch b/packages/openssh/hostfile.c.patch new file mode 100644 index 000000000..d757b59f4 --- /dev/null +++ b/packages/openssh/hostfile.c.patch @@ -0,0 +1,15 @@ +diff -u -r ../openssh-7.8p1/hostfile.c ./hostfile.c +--- ../openssh-7.8p1/hostfile.c 2018-08-23 05:41:42.000000000 +0000 ++++ ./hostfile.c 2018-09-29 08:21:44.261152558 +0000 +@@ -603,7 +603,11 @@ + r = SSH_ERR_SYSTEM_ERROR; + goto fail; + } ++#ifdef __ANDROID__ ++ if (rename(filename, back) == -1) { ++#else + if (link(filename, back) == -1) { ++#endif + oerrno = errno; + error("%s: link %.100s to %.100s: %s", __func__, + filename, back, strerror(errno)); diff --git a/packages/openssh/ssh-keygen.c.patch b/packages/openssh/ssh-keygen.c.patch new file mode 100644 index 000000000..e6aea3ceb --- /dev/null +++ b/packages/openssh/ssh-keygen.c.patch @@ -0,0 +1,15 @@ +diff -u -r ../openssh-7.8p1/ssh-keygen.c ./ssh-keygen.c +--- ../openssh-7.8p1/ssh-keygen.c 2018-08-23 05:41:42.000000000 +0000 ++++ ./ssh-keygen.c 2018-09-29 08:34:27.584063901 +0000 +@@ -1289,7 +1347,11 @@ + /* Backup existing file */ + if (unlink(old) == -1 && errno != ENOENT) + fatal("unlink %.100s: %s", old, strerror(errno)); ++#ifdef __ANDROID__ ++ if (rename(identity_file, old) == -1) ++#else + if (link(identity_file, old) == -1) ++#endif + fatal("link %.100s to %.100s: %s", identity_file, old, + strerror(errno)); + /* Move new one into place */