From: Alejandro Colomar Date: Mon, 13 Nov 2023 12:33:37 +0000 (+0100) Subject: lib/chkname.c: Update regex for valid names X-Git-Tag: 4.15.0-rc1~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5cddf243acab50c4c62e21e0b9f37ca70acea74;p=thirdparty%2Fshadow.git lib/chkname.c: Update regex for valid names The maximum length of 32 wasn't being enforced in the code, and POSIX doesn't specify that maximum length either, so it seems it was an arbitrary limit of the past that doesn't exist any more. Use a regex that has no length limit. Closes: Link: Cc: Iker Pedrosa Cc: Mike Frysinger Signed-off-by: Alejandro Colomar --- diff --git a/lib/chkname.c b/lib/chkname.c index 2b83361b8..0a18af2bf 100644 --- a/lib/chkname.c +++ b/lib/chkname.c @@ -32,8 +32,8 @@ static bool is_valid_name (const char *name) } /* - * User/group names must match gnu e-regex: - * [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]? + * User/group names must match BRE regex: + * [a-zA-Z0-9_.][a-zA-Z0-9_.-]*$\? * * as a non-POSIX, extension, allow "$" as the last char for * sake of Samba 3.x "add machine script"