]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
login: use LOGIN_TIMEOUT from login.defs
authorKarel Zak <kzak@redhat.com>
Wed, 5 Oct 2011 11:38:15 +0000 (13:38 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 26 Oct 2011 21:17:17 +0000 (23:17 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/login.1
login-utils/login.c

index 8aba16f59d4eb671ea8062b76d99cd5f9875f514..ef71539c4a2eb32399446d9239aa53874ab6cdc4 100644 (file)
@@ -133,6 +133,11 @@ Note that the same functionality is also provided by
 .BR pam_motd (8)
 PAM module.
 .RE
+.PP
+\fBLOGIN_TIMEOUT\fR (number)
+.RS 4
+Max time in seconds for login. The default value is 60.
+.RE
 
 .SH FILES
 .nf
index 6e7e4e27c3ee194227272cf85881d35b95e6d9cb..eece2e4f982a2879dfbce3803421557160861b60 100644 (file)
@@ -1105,6 +1105,8 @@ int main(int argc, char **argv)
                .conv = { misc_conv, NULL }     /* PAM conversation function */
        };
 
+       timeout = getlogindefs_num("LOGIN_TIMEOUT", LOGIN_TIMEOUT);
+
        signal(SIGALRM, timedout);
        siginterrupt(SIGALRM, 1);       /* we have to interrupt syscalls like ioclt() */
        alarm((unsigned int)timeout);