From ad3f68e3e5e9153aed56f3e551600ab5ceee6dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Tue, 31 Jan 2017 11:14:23 +0200 Subject: testing/ecryptfs-utils: flush stdout before prompting things musl has line buffered stdout, so flush it before waiting for input. --- testing/ecryptfs-utils/fix-stdout-flush.patch | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 testing/ecryptfs-utils/fix-stdout-flush.patch (limited to 'testing/ecryptfs-utils/fix-stdout-flush.patch') diff --git a/testing/ecryptfs-utils/fix-stdout-flush.patch b/testing/ecryptfs-utils/fix-stdout-flush.patch new file mode 100644 index 0000000000..7f097be242 --- /dev/null +++ b/testing/ecryptfs-utils/fix-stdout-flush.patch @@ -0,0 +1,30 @@ +diff -ru ecryptfs-utils-111.orig/src/libecryptfs/key_management.c ecryptfs-utils-111/src/libecryptfs/key_management.c +--- ecryptfs-utils-111.orig/src/libecryptfs/key_management.c 2015-12-21 22:38:59.000000000 +0200 ++++ ecryptfs-utils-111/src/libecryptfs/key_management.c 2017-01-31 11:11:55.190995428 +0200 +@@ -1245,6 +1245,7 @@ + if (prompt != NULL) { + printf("%s: ", prompt); + } ++ fflush(stdout); + ecryptfs_disable_echo(¤t_settings); + if (fgets(passphrase, + ECRYPTFS_MAX_PASSWORD_LENGTH+2, stdin) == NULL) { +diff -ru ecryptfs-utils-111.orig/src/utils/io.c ecryptfs-utils-111/src/utils/io.c +--- ecryptfs-utils-111.orig/src/utils/io.c 2015-12-21 22:38:59.000000000 +0200 ++++ ecryptfs-utils-111/src/utils/io.c 2017-01-31 11:11:34.127379788 +0200 +@@ -70,6 +70,7 @@ + int c; + + printf("%s: ", prompt); ++ fflush(stdout); + temp = malloc(length); + if (!temp) { + rc = -ENOMEM; +@@ -122,6 +123,7 @@ + int rc = 0; + int c; + ++ fflush(stdout); + if (echo == ECRYPTFS_ECHO_OFF) { + rc = disable_echo(&saved_settings); + if (rc) -- cgit v1.2.3