* krshd.c: Get path for NOLOGIN file from paths.h if present,
authorTom Yu <tlyu@mit.edu>
Fri, 26 Jan 2001 22:54:40 +0000 (22:54 +0000)
committerTom Yu <tlyu@mit.edu>
Fri, 26 Jan 2001 22:54:40 +0000 (22:54 +0000)
mirroring logic in login.c.  [patch from David MacKenzie
krb5-appl/913]

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12952 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/bsd/ChangeLog
src/appl/bsd/krshd.c

index 182bf0d2d5362bae0c0a1a13a3b778567dea909c..95032af37befe7a9c242545a325f2088028569b8 100644 (file)
@@ -1,3 +1,9 @@
+2001-01-26  Tom Yu  <tlyu@mit.edu>
+
+       * krshd.c: Get path for NOLOGIN file from paths.h if present,
+       mirroring logic in login.c.  [patch from David MacKenzie
+       krb5-appl/913]
+
 2001-01-23  Tom Yu  <tlyu@mit.edu>
 
        * forward.c (rd_and_store_for_creds): Overwrite any existing value
index b2b4909029ac162f6a4c8841cc980dbbe8690213..2742066a7ee355a791fcf5fe424469fcb39992af 100644 (file)
@@ -160,6 +160,16 @@ char copyright[] =
 Key_schedule v4_schedule;
 #endif
 
+#ifdef HAVE_PATHS_H
+#include <paths.h>
+#endif
+
+#if defined(_PATH_NOLOGIN)
+#define NOLOGIN                _PATH_NOLOGIN
+#else
+#define NOLOGIN                "/etc/nologin"
+#endif
+
 #include "defines.h"
 
 #if HAVE_ARPA_NAMESER_H
@@ -1119,7 +1129,7 @@ void doit(f, fromp)
        goto signout_please;
     }
     
-    if (pwd->pw_uid && !access("/etc/nologin", F_OK)) {
+    if (pwd->pw_uid && !access(NOLOGIN, F_OK)) {
        error("Logins currently disabled.\n");
        goto signout_please;
     }