#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
/*
+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.
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
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;