]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
merge with 1.9
authorJim Meyering <jim@meyering.net>
Tue, 9 Nov 1993 13:21:32 +0000 (13:21 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 9 Nov 1993 13:21:32 +0000 (13:21 +0000)
lib/getdate.y
old/sh-utils/ChangeLog
old/sh-utils/NEWS
src/su.c

index df1a08a98dbdfd9c3c92f033e2dc81ef2a3914e4..1d5690423893749dc1092e8bda6f6526d0ba7afe 100644 (file)
@@ -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 <sys/timeb.h>
 #else
 /*
index c64dc54066265d3b7288039e51acd65cabdb81c8..6433924ba6fde400e0d6b39d0b543d04e52e951a 100644 (file)
@@ -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.
index c59b61887a7cf880500b47cbd6395f38ddb63aef..47db619e590527d55ab606deb74ae3efbe77779d 100644 (file)
@@ -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
index 7669aef1aebc2197d900587207843877c39b65ff..6ea70e51c89f7601f23b073575942e2fe81bac2b 100644 (file)
--- 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;