From: Jim Meyering Date: Tue, 9 Nov 1993 13:21:32 +0000 (+0000) Subject: merge with 1.9 X-Git-Tag: textutils-1_12_1~809 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a1b9bc9a4273dde28bbef4e24a9e0e8aea7d3a81;p=thirdparty%2Fcoreutils.git merge with 1.9 --- diff --git a/lib/getdate.y b/lib/getdate.y index df1a08a98d..1d56904238 100644 --- a/lib/getdate.y +++ b/lib/getdate.y @@ -97,7 +97,7 @@ void *alloca (); #undef timezone /* needed for sgi */ #endif -#if defined(HAVE_SYS_TIMEB_H) || (!defined(USG) && defined(HAVE_FTIME)) +#if defined(HAVE_SYS_TIMEB_H) #include #else /* diff --git a/old/sh-utils/ChangeLog b/old/sh-utils/ChangeLog index c64dc54066..6433924ba6 100644 --- a/old/sh-utils/ChangeLog +++ b/old/sh-utils/ChangeLog @@ -1,3 +1,10 @@ +Mon Nov 08 23:16:36 1993 Jim Meyering (meyering@comco.com) + + * Version 1.9. + + * su.c (correct_password): Report an error and fail if getpass + returns NULL. + Tue Nov 02 01:14:21 1993 Jim Meyering (meyering@comco.com) * acconfig.h: Add comments. diff --git a/old/sh-utils/NEWS b/old/sh-utils/NEWS index c59b61887a..47db619e59 100644 --- a/old/sh-utils/NEWS +++ b/old/sh-utils/NEWS @@ -1,4 +1,5 @@ Major changes in release 1.9: +* su fails gracefully when getpass is unable to open /dev/tty. * printenv and tty detect and report write errors * fix bug in stty * stty supports accepts the new options status and flush on systems that diff --git a/src/su.c b/src/su.c index 7669aef1ae..6ea70e51c8 100644 --- a/src/su.c +++ b/src/su.c @@ -331,6 +331,11 @@ correct_password (pw) return 1; unencrypted = getpass ("Password:"); + if (unencrypted == NULL) + { + error (0, 0, "getpass: cannot open /dev/tty"); + return 0; + } encrypted = crypt (unencrypted, correct); bzero (unencrypted, strlen (unencrypted)); return strcmp (encrypted, correct) == 0;