home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume43
/
agetty
/
patch01
next >
Wrap
Internet Message Format
|
1994-06-08
|
3KB
From: wietse@wzv.win.tue.nl (Wietse Venema)
Newsgroups: comp.sources.misc
Subject: v43i008: agetty - simple flexible login front end, Patch01
Date: 8 Jun 1994 12:10:39 -0500
Organization: Eindhoven University of Technology, The Netherlands
Sender: kent@sparky.sterling.com
Approved: kent@sparky.sterling.com
Message-ID: <2t4u2f$o1h@sparky.sterling.com>
X-Md4-Signature: b0ff7e48488c72883eda9cd67629d756
Submitted-by: wietse@wzv.win.tue.nl (Wietse Venema)
Posting-number: Volume 43, Issue 8
Archive-name: agetty/patch01
Environment: System V.[24], SunOS 4, termio.
Patch-To: agetty: Volume 39, Issue 46
Agetty is a login front end for non-network logins that I wrote about
six years ago, and that has served me well through several generations
of hardware and software, from the days of System V.2, SunOS 4 up to
Solaris 2.x.
Well, today Janusz Harkot reported a loophole that probably affects all
systems where the login program accepts command-line options, i.e. any
UNIX (or clone) later than System V.2 or BSD 4.1.
Below is a source-code patch. A fully-patched version of the source and
docs can be found on ftp.win.tue.nl in /pub/unix/agetty.shar.Z.
Wietse
*** README- Fri Aug 20 22:20:28 1993
--- README Thu May 12 09:30:04 1994
***************
*** 1,4 ****
! @(#) README 1.9 8/20/93 22:20:26
Traditionally, getty is the program that listens on terminal and modem
ports and that prompts for a login name. Agetty is an alternative for
--- 1,6 ----
! @(#) README 1.10 5/12/94 09:30:00
!
! [This version closes a loophole with usernames that begin with '-'].
Traditionally, getty is the program that listens on terminal and modem
ports and that prompts for a login name. Agetty is an alternative for
*** agetty.c- Sun Aug 22 13:57:19 1993
--- agetty.c Thu May 12 09:27:06 1994
***************
*** 176,188 ****
/* CREATION DATE
/* Sat Nov 25 22:51:05 MET 1989
/* LAST MODIFICATION
! /* 93/08/22 13:57:02
/* VERSION/RELEASE
! /* 1.30
/*--*/
#ifndef lint
! char sccsid[] = "@(#) agetty.c 1.30 22 Aug 1993 13:57:02";
#endif
#include <termio.h>
--- 176,188 ----
/* CREATION DATE
/* Sat Nov 25 22:51:05 MET 1989
/* LAST MODIFICATION
! /* 94/05/12 09:27:01
/* VERSION/RELEASE
! /* 1.31
/*--*/
#ifndef lint
! char sccsid[] = "@(#) agetty.c 1.31 5/12/94 09:27:01";
#endif
#include <termio.h>
***************
*** 841,846 ****
--- 841,851 ----
}
break;
}
+ }
+ if (*logname == '-') {
+ static char text[] = "\r\nlogin names may not begin with '-'.\r\n";
+ write(2, text, sizeof(text) - 1);
+ *logname = 0;
}
}
/* Handle names with upper case and no lower case. */
exit 0 # Just in case...