]> andersk Git - openssh.git/blobdiff - session.c
- dtucker@cvs.openbsd.org 2010/01/12 01:31:05
[openssh.git] / session.c
index 733b5a9095c225885a30dc50bd6cb767050fbb90..6cd07d4fe8e295088bb60881a2ac7b68f19bf1b2 100644 (file)
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.249 2009/11/20 00:15:41 dtucker Exp $ */
+/* $OpenBSD: session.c,v 1.250 2010/01/12 01:31:05 dtucker Exp $ */
 /*
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
  *                    All rights reserved
@@ -1387,10 +1387,12 @@ do_nologin(struct passwd *pw)
        if (pw->pw_uid)
                f = fopen(_PATH_NOLOGIN, "r");
 #endif
-       if (f) {
+       if (f != NULL || errno == EPERM) {
                /* /etc/nologin exists.  Print its contents and exit. */
                logit("User %.100s not allowed because %s exists",
                    pw->pw_name, _PATH_NOLOGIN);
+               if (f == NULL)
+                       exit(254);
                while (fgets(buf, sizeof(buf), f))
                        fputs(buf, stderr);
                fclose(f);
This page took 0.076995 seconds and 4 git commands to generate.