diff options
author | 2002-11-07 21:49:31 +0000 | |
---|---|---|
committer | 2002-11-07 21:49:31 +0000 | |
commit | acdeee01a55ef7b05d84f77fca9c443389524a95 (patch) | |
tree | 6c597a2f2b5dfe76db3c58a173ca56f6c240d344 | |
parent | httpd(8), not (1)... (diff) | |
download | wireguard-openbsd-acdeee01a55ef7b05d84f77fca9c443389524a95.tar.xz wireguard-openbsd-acdeee01a55ef7b05d84f77fca9c443389524a95.zip |
Allow '$' in a username as long as it is the last character since
samba wants to create usernames that end in '$'. From Paul Chakravarti
-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; } } |