From: Karel Zak Date: Thu, 7 Sep 2017 08:45:24 +0000 (+0200) Subject: su: (pty) fix slave terminal attributes initialization X-Git-Tag: v2.31-rc1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61b3106ba3501ddcbcc39c69df57a49aa926adae;p=thirdparty%2Futil-linux.git su: (pty) fix slave terminal attributes initialization Reported-by: Vaclav Dolezal Signed-off-by: Karel Zak --- diff --git a/login-utils/su-common.c b/login-utils/su-common.c index bfccb4643e..f873c23bcb 100644 --- a/login-utils/su-common.c +++ b/login-utils/su-common.c @@ -273,7 +273,7 @@ static void pty_create(struct su_context *su) rc = openpty(&su->pty_master, &su->pty_slave, NULL, NULL, NULL); /* set slave attributes */ - if (rc < 0) { + if (!rc) { tcgetattr(su->pty_slave, &slave_attrs); cfmakeraw(&slave_attrs); tcsetattr(su->pty_slave, TCSANOW, &slave_attrs);