From 398f1ca842aba9acaf278b61a6f88f272626e4ee Mon Sep 17 00:00:00 2001 From: Sahan Fernando Date: Sun, 12 Dec 2021 20:47:39 +1100 Subject: [PATCH] Ports: Don't return errno value as pointer in openssh port --- Ports/openssh/patches/reimplement_read_passphrase.patch | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Ports/openssh/patches/reimplement_read_passphrase.patch b/Ports/openssh/patches/reimplement_read_passphrase.patch index d3eaf65213..c0e0ba755d 100644 --- a/Ports/openssh/patches/reimplement_read_passphrase.patch +++ b/Ports/openssh/patches/reimplement_read_passphrase.patch @@ -14,7 +14,7 @@ index 974d67f0..3496eebe 100644 static char * ssh_askpass(char *askpass, const char *msg, const char *env_hint) { -@@ -122,62 +126,33 @@ ssh_askpass(char *askpass, const char *msg, const char *env_hint) +@@ -122,62 +126,35 @@ ssh_askpass(char *askpass, const char *msg, const char *env_hint) char * read_passphrase(const char *prompt, int flags) { @@ -56,7 +56,8 @@ index 974d67f0..3496eebe 100644 + struct termios no_echo = original; + no_echo.c_lflag &= ~ECHO; + if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &no_echo) < 0) { -+ return errno; ++ perror("Failed to turn off echo for passphrase"); ++ exit(errno); } - if ((flags & RP_USE_ASKPASS) && getenv("DISPLAY") == NULL) @@ -79,7 +80,8 @@ index 974d67f0..3496eebe 100644 + tcsetattr(STDIN_FILENO, TCSAFLUSH, &original); + putchar('\n'); + if (ret < 0) { -+ return errno; ++ perror("Failed to read passphrase"); ++ exit(errno); } - if (readpassphrase(prompt, buf, sizeof buf, rppflags) == NULL) {