[BusyBox-cvs] busybox/loginutils login.c,1.11,1.12
Erik Andersen
andersen at busybox.net
Wed Jul 30 06:56:10 UTC 2003
Update of /var/cvs/busybox/loginutils
In directory winder:/tmp/cvs-serv20272/loginutils
Modified Files:
login.c
Log Message:
Ronny L Nilsson writes:
The login process should always timeout if user don't login sucessfully within
reasonable time. Otherwise we're sensetive to a DOS attack by simply doing a
bunch of simultaneous telnet connections (deploys all availible TTY's).
This patch make login.c terminate the connection after "TIMEOUT" seconds.
Index: login.c
===================================================================
RCS file: /var/cvs/busybox/loginutils/login.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- login.c 3 Jul 2003 10:07:02 -0000 1.11
+++ login.c 30 Jul 2003 06:56:07 -0000 1.12
@@ -86,12 +86,9 @@
username[0]=0;
amroot = ( getuid ( ) == 0 );
signal ( SIGALRM, alarm_handler );
+ alarm ( TIMEOUT );
+ alarmstarted = 1;
- if (( argc > 1 ) && ( TIMEOUT > 0 )) {
- alarm ( TIMEOUT );
- alarmstarted = 1;
- }
-
while (( flag = getopt(argc, argv, "f:h:p")) != EOF ) {
switch ( flag ) {
case 'p':
More information about the busybox-cvs
mailing list