Gert Doering has submitted this change. ( 
https://gerrit.openvpn.net/c/openvpn/+/2205?usp=email )

Change subject: console_systemd: treat read() error as failure
......................................................................

console_systemd: treat read() error as failure

read() returning -1 was taken as success, so a failed read from
systemd-ask-password yielded an empty response instead of an error.

Change-Id: Ic49db236b36014ea6ee621a09252a534e3d05ef7
Signed-off-by: Razvan Cojocaru <[email protected]>
Acked-by: Frank Lichtenheld <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2205
Message-Id: <[email protected]>
URL: 
https://www.mail-archive.com/[email protected]/msg41575.html
Signed-off-by: Gert Doering <[email protected]>
---
M src/openvpn/console_systemd.c
1 file changed, 1 insertion(+), 1 deletion(-)




diff --git a/src/openvpn/console_systemd.c b/src/openvpn/console_systemd.c
index f0ca7fa..059686f 100644
--- a/src/openvpn/console_systemd.c
+++ b/src/openvpn/console_systemd.c
@@ -76,7 +76,7 @@
         return false;
     }
     memset(input, 0, capacity);
-    if (read(std_out, input, capacity - 1) != 0)
+    if (read(std_out, input, capacity - 1) > 0)
     {
         chomp(input);
         ret = true;

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2205?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic49db236b36014ea6ee621a09252a534e3d05ef7
Gerrit-Change-Number: 2205
Gerrit-PatchSet: 3
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Frank Lichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to