diff options
-rw-r--r-- | usr.sbin/user/user.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c index 45cc0d95484..6d441041abc 100644 --- a/usr.sbin/user/user.c +++ b/usr.sbin/user/user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: user.c,v 1.41 2003/04/03 16:03:06 millert Exp $ */ +/* $OpenBSD: user.c,v 1.42 2003/05/13 01:12:31 millert Exp $ */ /* $NetBSD: user.c,v 1.45 2001/08/17 08:29:00 joda Exp $ */ /* @@ -551,6 +551,10 @@ valid_login(char *login) { char *cp; + /* The first character cannot be a hyphen */ + if (*login == '-') + return 0; + for (cp = login ; *cp ; cp++) { /* We allow '$' as the last character for samba */ if (!isalnum(*cp) && *cp != '.' && *cp != '_' && *cp != '-' && |