aboutsummaryrefslogtreecommitdiffstats
path: root/community/ecryptfs-utils/fix-stdout-flush.patch
blob: 7f097be242bc3df7a443b03e081e4d8f8c014cff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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(&current_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)