* passwd.cc (pwdgrp::parse_passwd): Be more unforgiving about non-numeric
fields.
This commit is contained in:
@@ -40,11 +40,10 @@ pwdgrp::parse_passwd ()
|
||||
# define res (*passwd_buf)[curr_lines]
|
||||
res.pw_name = next_str (':');
|
||||
res.pw_passwd = next_str (':');
|
||||
char *p = raw_ptr ();
|
||||
(void) next_num (res.pw_uid);
|
||||
if (p == raw_ptr ())
|
||||
return false; /* parsing did not advance. line is garbage */
|
||||
(void) next_num (res.pw_gid);
|
||||
if (!next_num (res.pw_uid))
|
||||
return false;
|
||||
if (!next_num (res.pw_gid))
|
||||
return false;
|
||||
res.pw_comment = NULL;
|
||||
res.pw_gecos = next_str (':');
|
||||
res.pw_dir = next_str (':');
|
||||
|
Reference in New Issue
Block a user