Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Oct 2002 16:17:20 +0400 (MSD)
From:      Maxim Konovalov <maxim@macomnet.ru>
To:        freebsd-current@freebsd.org
Subject:   pw_scan() allows empty login names
Message-ID:  <20021011160827.Y29119-100000@news1.macomnet.ru>

next in thread | raw e-mail | index | archive | help

Hello,

Is it intentional? Here is a patch:

Index: lib/libc/gen/pw_scan.c
===================================================================
RCS file: /home/ncvs/src/lib/libc/gen/pw_scan.c,v
retrieving revision 1.23
diff -u -r1.23 pw_scan.c
--- lib/libc/gen/pw_scan.c	2 Oct 2002 07:02:46 -0000	1.23
+++ lib/libc/gen/pw_scan.c	11 Oct 2002 11:36:19 -0000
@@ -78,6 +78,8 @@
 	pw->pw_fields = 0;
 	if (!(pw->pw_name = strsep(&bp, ":")))		/* login */
 		goto fmt;
+	if (pw->pw_name[0] == '\0')
+		goto fmt;
 	root = !strcmp(pw->pw_name, "root");
 	if (pw->pw_name[0] && (pw->pw_name[0] != '+' || pw->pw_name[1] == '\0'))
 		pw->pw_fields |= _PWF_NAME;

%%%

-- 
Maxim Konovalov, MAcomnet, Internet Dept., system engineer
phone: +7 (095) 796-9079, mailto:maxim@macomnet.ru



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021011160827.Y29119-100000>