summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--session.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0317221ee..ddfa8af44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,10 @@
27 [roaming_common.c] 27 [roaming_common.c]
28 delete with extreme prejudice a debug() that fired with every keypress; 28 delete with extreme prejudice a debug() that fired with every keypress;
29 ok dtucker deraadt 29 ok dtucker deraadt
30 - dtucker@cvs.openbsd.org 2010/01/12 01:31:05
31 [session.c]
32 Do not allow logins if /etc/nologin exists but is not readable by the user
33 logging in. Noted by Jan.Pechanec at Sun, ok djm@ deraadt@
30 34
3120100110 3520100110
32 - (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c] 36 - (dtucker) [configure.ac misc.c readconf.c servconf.c ssh-keyscan.c]
diff --git a/session.c b/session.c
index 733b5a909..6cd07d4fe 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.c,v 1.249 2009/11/20 00:15:41 dtucker Exp $ */ 1/* $OpenBSD: session.c,v 1.250 2010/01/12 01:31:05 dtucker Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -1387,10 +1387,12 @@ do_nologin(struct passwd *pw)
1387 if (pw->pw_uid) 1387 if (pw->pw_uid)
1388 f = fopen(_PATH_NOLOGIN, "r"); 1388 f = fopen(_PATH_NOLOGIN, "r");
1389#endif 1389#endif
1390 if (f) { 1390 if (f != NULL || errno == EPERM) {
1391 /* /etc/nologin exists. Print its contents and exit. */ 1391 /* /etc/nologin exists. Print its contents and exit. */
1392 logit("User %.100s not allowed because %s exists", 1392 logit("User %.100s not allowed because %s exists",
1393 pw->pw_name, _PATH_NOLOGIN); 1393 pw->pw_name, _PATH_NOLOGIN);
1394 if (f == NULL)
1395 exit(254);
1394 while (fgets(buf, sizeof(buf), f)) 1396 while (fgets(buf, sizeof(buf), f))
1395 fputs(buf, stderr); 1397 fputs(buf, stderr);
1396 fclose(f); 1398 fclose(f);