diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-11-07 21:49:32 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-11-07 21:49:32 +0000 |
commit | 1e50f2031a464c359f026df79e0eeceb7af3ce9e (patch) | |
tree | ca66116b71e34a5cd18ecce1d761e0ce32341c04 /usr.sbin/user | |
parent | 5a6fab9cfaede727691b5b3ba517c71d3c3adf04 (diff) |
Allow '$' in a username as long as it is the last character since
samba wants to create usernames that end in '$'. From Paul Chakravarti
Diffstat (limited to 'usr.sbin/user')
-rw-r--r-- | usr.sbin/user/user.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c index 61e9add86d7..f5e3c0b42f2 100644 --- a/usr.sbin/user/user.c +++ b/usr.sbin/user/user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: user.c,v 1.36 2002/07/25 15:41:39 millert Exp $ */ +/* $OpenBSD: user.c,v 1.37 2002/11/07 21:49:31 millert Exp $ */ /* $NetBSD: user.c,v 1.45 2001/08/17 08:29:00 joda Exp $ */ /* @@ -551,7 +551,9 @@ valid_login(char *login) char *cp; for (cp = login ; *cp ; cp++) { - if (!isalnum(*cp) && *cp != '.' && *cp != '_' && *cp != '-') { + /* We allow '$' as the last character for samba */ + if (!isalnum(*cp) && *cp != '.' && *cp != '_' && *cp != '-' && + !(*cp == '$' && *(cp + 1) == '\0')) { return 0; } } |