Subject: [alpine-devel] [PATCH] main/openssh: flush stdout for interactive sftp

From: Peter Bui <[email-masked]>
Date: Fri, 24 Oct 2014 11:01:57 -0500

Previously, the "sftp> " prompt would only appear after a command was
entered.  This simply calls fflush on stdout to force the prompt to
appear during interactive mode.
---
 main/openssh/APKBUILD                      | 12 ++++++++----
 main/openssh/openssh-sftp-interactive.diff | 14 ++++++++++++++
 2 files changed, 22 insertions(+), 4 deletions(-)
 create mode 100644 main/openssh/openssh-sftp-interactive.diff

diff --git a/main/openssh/APKBUILD b/main/openssh/APKBUILD
index 7104233..a7c87f2 100644
--- a/main/openssh/APKBUILD
+++ b/main/openssh/APKBUILD
@@ -2,7 +2,7 @@
 pkgname=openssh
 pkgver=6.6_p1
 _myver=${pkgver%_*}${pkgver#*_}
-pkgrel=5
+pkgrel=6
 pkgdesc="Port of OpenBSD's free SSH release"
 url="http://www.openssh.org/portable.html"
 arch="all"
@@ -20,6 +20,7 @@ source="ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$pkgname-$_myver.tar.
 	sshd.confd
 	CVE-2014-2653.patch
 	openssh-curve25519pad.patch
+	openssh-sftp-interactive.diff
 	"
 # HPN patches are from: http://www.psc.edu/index.php/hpn-ssh
 
@@ -117,7 +118,8 @@ f7d9d6f96940ef66bd3c3a0aa27e57a7  openssh-fix-utmp.diff
 bcf990d4ef7ff446160cde7dbd32bf1f  sshd.initd
 b35e9f3829f4cfca07168fcba98749c7  sshd.confd
 02a7de5652d9769576e3b252d768cd0f  CVE-2014-2653.patch
-da797337121f07bc3fac8a21afac20f8  openssh-curve25519pad.patch"
+da797337121f07bc3fac8a21afac20f8  openssh-curve25519pad.patch
+2dd7e366607e95f9762273067309fd6e  openssh-sftp-interactive.diff"
 sha256sums="48c1f0664b4534875038004cc4f3555b8329c2a81c1df48db5c517800de203bb  openssh-6.6p1.tar.gz
 83f2b2c07988c6321875240c02a161a83ec84661d592cbd2188ea8c962f9b1ad  openssh6.6-dynwindows.diff
 bf49212e47a86d10650f739532cea514a310925e6445b4f8011031b6b55f3249  openssh6.5-peaktput.diff
@@ -126,7 +128,8 @@ f2748da45d0bc31055727f8c80d93e1872cc043ced3202e2f6d150aca3c08dde  openssh-fix-ut
 2a9889ab224be7202ece80a7085aa3e85bbba9432467031b436dcd77cb92a2ac  sshd.initd
 29c6d57ac3ec6018cadc6ba6cd9b90c9ed46e20049b970fdcc68ee2481a2ee41  sshd.confd
 03826427d72f86c68f079acab6c9c86e8f27f7514b66428f404c2f235fd0c0bd  CVE-2014-2653.patch
-8b0caf249298eec28aad3cb77256d31a90652c77bdc1a54a00f04e8c1446d5c4  openssh-curve25519pad.patch"
+8b0caf249298eec28aad3cb77256d31a90652c77bdc1a54a00f04e8c1446d5c4  openssh-curve25519pad.patch
+4ce1ad5f767c0f4e854a0cfeef0e2e400f333c649e552df1ecc317e6a6557376  openssh-sftp-interactive.diff"
 sha512sums="3d3566ed87649882702cad52db1adefebfb3ef788c9f77a493f99db7e9ca2e8edcde793dd426df7df0aed72a42a31c20a63ef51506111369d3a7c49e0bf6c82b  openssh-6.6p1.tar.gz
 3aab8b8e1f86ce04ebc69bbdbf3c70cefd510d7b4080b99067ec49957b5e421b49e3b8a0a62103d17cf644cd7c0b30e9283a62a24988b1bbb0fbdabbdc1202fd  openssh6.6-dynwindows.diff
 e041398e177674f698480e23be037160bd07b751c754956a3ddf1b964da24c85e826fb75e7c23c9826d36761da73d08db9583c047d58a08dc7b2149a949075b1  openssh6.5-peaktput.diff
@@ -135,4 +138,5 @@ cc909f68d9da1b264926973b96d36162b5c588299c98d62f526faf2ef1273d98bb8d8dea4d482770
 eeafefcb8a3357b498591480b39dc0116ab3440c88faeaeaddeac0b860f9e268abe6f603bc27893b79945acde06a45a7616d1bdc6ca27201cd8dc522f49b207e  sshd.initd
 b9ae816af54a55e134a9307e376f05367b815f1b3fd545c2a2c312d18aedcf907f413e8bad8db980cdd9aad4011a72a79e1e94594f69500939a9cb46287f2f81  sshd.confd
 be48059ae1715669f970a19acde14f262588172c5a8d8d1c84159bc69a60c5750b21c98f39f65df72ae071f7f918046000a2499b9ef16ba2cb4bcd8399bc8e40  CVE-2014-2653.patch
-5c946726e9fb472412972ca73c6e4565598b7729558843be2391e04d8935f0e35a992b4fa9f89c8a98917665c12219ea5ad58359269cbe2cf90907f7d1e2cec8  openssh-curve25519pad.patch"
+5c946726e9fb472412972ca73c6e4565598b7729558843be2391e04d8935f0e35a992b4fa9f89c8a98917665c12219ea5ad58359269cbe2cf90907f7d1e2cec8  openssh-curve25519pad.patch
+c1d09c65dbc347f0904edc30f91aa9a24b0baee50309536182455b544f1e3f85a8cecfa959e32be8b101d8282ef06dde3febbbc3f315489339dcf04155c859a9  openssh-sftp-interactive.diff"
diff --git a/main/openssh/openssh-sftp-interactive.diff b/main/openssh/openssh-sftp-interactive.diff
new file mode 100644
index 0000000..ab14f3a
--- /dev/null
+++ b/main/openssh/openssh-sftp-interactive.diff
@@ -0,0 +1,14 @@
+--- a/sftp.c	2014-10-24 10:32:15.793544472 +0500
++++ b/sftp.c	2014-10-24 10:35:22.329199875 +0500
+@@ -2076,8 +2076,10 @@
+ 		signal(SIGINT, SIG_IGN);
+ 
+ 		if (el == NULL) {
+-			if (interactive)
++			if (interactive) {
+ 				printf("sftp> ");
++				fflush(stdout);
++			}
+ 			if (fgets(cmd, sizeof(cmd), infile) == NULL) {
+ 				if (interactive)
+ 					printf("\n");
-- 
2.1.2

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---