summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c6
1 files changed, 4 insertions, 2 deletions
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);