OSDN Git Service

* passwd.cc (pwdgrp::parse_passwd): Be more unforgiving about non-numeric
authorcgf <cgf>
Mon, 27 Jan 2003 17:00:17 +0000 (17:00 +0000)
committercgf <cgf>
Mon, 27 Jan 2003 17:00:17 +0000 (17:00 +0000)
fields.

winsup/cygwin/ChangeLog
winsup/cygwin/passwd.cc

index 9657420..a7464a1 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-27  Christopher Faylor  <cgf@redhat.com>
+
+       * passwd.cc (pwdgrp::parse_passwd): Be more unforgiving about
+       non-numeric fields.
+
 2003-01-26  Christopher Faylor  <cgf@redhat.com>
 
        * uinfo.cc (pwdgrp::next_num): Remove check for NULL since it is no
index c257bd6..ee12392 100644 (file)
@@ -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 (':');