Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Jul 2000 12:20:20 -0400 (EDT)
From:      James Howard <howardjp@byzantine.student.umd.edu>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/19755: nologin not configurable
Message-ID:  <200007071620.MAA77327@byzantine.student.umd.edu>

next in thread | raw e-mail | index | archive | help

>Number:         19755
>Category:       bin
>Synopsis:       nologin not configurable
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 07 09:30:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     James Howard
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Arbornet.org
>Environment:

FreeBSD 5

>Description:

I wanted to displaya specific text message when a specific user logs in
using nologin.8.  But nologin only has a certain static message.  So I
modified it to fix the problem :)

>How-To-Repeat:

N/A

>Fix:

diff -u nologin.orig/nologin.8 nologin/nologin.8
--- nologin.orig/nologin.8	Thu Jul  6 22:58:19 2000
+++ nologin/nologin.8	Thu Jul  6 22:58:00 2000
@@ -46,6 +46,23 @@
 exits non-zero.
 It is intended as a replacement shell field for accounts that
 have been disabled.
+.Pp
+.Nm Nologin
+first looks in the user's home directory for 
+.Pa ~/.nologin
+and displays its contents before exiting.  If that file does
+not exist or is not readable, 
+.Nm 
+will look in
+.Pa /etc/nologin
+for the message.  Finally, if no suitable message is found, the
+text "This account is currently not available." is displayed.
+.Sh FILES
+.Bl -tag -width /etc/nologin -compact
+.It Pa ~/.nologin
+User specific warning message
+.It Pa /etc/nologin
+System wide warning message
 .Sh SEE ALSO
 .Xr login 1 ,
 .Xr nologin 5 .
diff -u nologin.orig/nologin.sh nologin/nologin.sh
--- nologin.orig/nologin.sh	Thu Jul  6 22:58:19 2000
+++ nologin/nologin.sh	Thu Jul  6 22:53:20 2000
@@ -35,5 +35,12 @@
 # $FreeBSD: src/sbin/nologin/nologin.sh,v 1.4 1999/08/28 00:13:57 peter Exp $
 #
 
-echo 'This account is currently not available.'
+if [ -r ~/.nologin ]; then
+    cat ~/.nologin
+elif [ -r /etc/nologin ]; then
+    cat /etc/nlogin
+else
+    echo 'This account is currently not available.'
+fi
+
 exit 1

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200007071620.MAA77327>