[openssh-commits] [openssh] 02/02: Import readpassphrase.c rev 1.26.
git+noreply at mindrot.org
git+noreply at mindrot.org
Wed Oct 19 03:29:34 AEDT 2016
This is an automated email from the git hooks/post-receive script.
dtucker pushed a commit to branch master
in repository openssh.
commit 8f866d8a57b9a2dc5dd04504e27f593b551618e3
Author: Darren Tucker <dtucker at zip.com.au>
Date: Wed Oct 19 03:26:09 2016 +1100
Import readpassphrase.c rev 1.26.
Author: miller at openbsd.org:
Avoid generate SIGTTOU when restoring the terminal mode. If we get
SIGTTOU it means the process is not in the foreground process group
which, in most cases, means that the shell has taken control of the tty.
Requiring the user the fg the process in this case doesn't make sense
and can result in both SIGTSTP and SIGTTOU being sent which can lead to
the process being suspended again immediately after being brought into
the foreground.
---
openbsd-compat/readpassphrase.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c
index 783cc9e..24aed6e 100644
--- a/openbsd-compat/readpassphrase.c
+++ b/openbsd-compat/readpassphrase.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readpassphrase.c,v 1.25 2015/09/14 10:45:27 guenther Exp $ */
+/* $OpenBSD: readpassphrase.c,v 1.26 2016/10/18 12:47:18 millert Exp $ */
/*
* Copyright (c) 2000-2002, 2007, 2010
@@ -157,9 +157,13 @@ restart:
/* Restore old terminal settings and signals. */
if (memcmp(&term, &oterm, sizeof(term)) != 0) {
+ const int sigttou = signo[SIGTTOU];
+
+ /* Ignore SIGTTOU generated when we are not the fg pgrp. */
while (tcsetattr(input, TCSAFLUSH|TCSASOFT, &oterm) == -1 &&
errno == EINTR && !signo[SIGTTOU])
continue;
+ signo[SIGTTOU] = sigttou;
}
(void)sigaction(SIGALRM, &savealrm, NULL);
(void)sigaction(SIGHUP, &savehup, NULL);
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list