It is not necessary to check if a '-' is in lusername., Checking if

lusername starts with a '-' is enough. Otherwise, no users with a '-'
in there name can use rlogin.
This commit is contained in:
Guido van Rooij 1995-12-01 20:38:40 +00:00
parent 2db54afc5e
commit d7b3176278

View file

@ -302,7 +302,7 @@ doit(f, fromp)
if (f > 2) /* f should always be 0, but... */
(void) close(f);
setup_term(0);
if (strchr(lusername, '-')) {
if (*lusername=='-')) {
syslog(LOG_ERR, "tried to pass user \"%s\" to login",
lusername);
fatal(STDERR_FILENO, "invalid user", 0);