From 1e50f2031a464c359f026df79e0eeceb7af3ce9e Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 7 Nov 2002 21:49:32 +0000 Subject: Allow '$' in a username as long as it is the last character since samba wants to create usernames that end in '$'. From Paul Chakravarti --- usr.sbin/user/user.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr.sbin') 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; } } -- cgit v1.2.3