Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!mcvax!ukc!cheviot!andy From: andy@cheviot.UUCP Newsgroups: comp.os.minix Subject: lib/getpwent.c (bug + fix) Message-ID: <2063@cheviot.uk.ac.newcastle.cheviot> Date: Thu, 9-Apr-87 07:58:09 EST Article-I.D.: cheviot.2063 Posted: Thu Apr 9 07:58:09 1987 Date-Received: Sat, 11-Apr-87 13:22:07 EST Reply-To: andy@cheviot.newcastle.ac.uk (Andy Linton) Distribution: world Organization: Computing Laboratory, U of Newcastle upon Tyne, Tyne and Wear, UK NE17RU Lines: 83 *** getpwent.c Mon Feb 23 11:49:27 1987 --- /tmp/getpwent.c Thu Apr 9 13:54:00 1987 *************** *** 75,93 **** if (getline () == 0) return (0); ! pwd.name = _buf; skip_period (); ! pwd.passwd = _buf; skip_period (); ! pwd.uid = atoi (_buf); skip_period (); ! pwd.gid = atoi (_buf); skip_period (); ! pwd.gecos = _buf; skip_period (); ! pwd.dir = _buf; skip_period (); ! pwd.shell = _buf; return (&pwd); } --- 75,93 ---- if (getline () == 0) return (0); ! pwd.pw_name = _buf; skip_period (); ! pwd.pw_passwd = _buf; skip_period (); ! pwd.pw_uid = atoi (_buf); skip_period (); ! pwd.pw_gid = atoi (_buf); skip_period (); ! pwd.pw_gecos = _buf; skip_period (); ! pwd.pw_dir = _buf; skip_period (); ! pwd.pw_shell = _buf; return (&pwd); } *************** *** 99,105 **** setpwent (); while ((pwd = getpwent ()) != 0) ! if (!strcmp (pwd -> name, name)) break; endpwent (); if (pwd != 0) --- 99,105 ---- setpwent (); while ((pwd = getpwent ()) != 0) ! if (!strcmp (pwd -> pw_name, name)) break; endpwent (); if (pwd != 0) *************** *** 115,121 **** setpwent (); while ((pwd = getpwent ()) != 0) ! if (pwd -> uid == uid) break; endpwent (); if (pwd != 0) --- 115,121 ---- setpwent (); while ((pwd = getpwent ()) != 0) ! if (pwd -> pw_uid == uid) break; endpwent (); if (pwd != 0) -- SENDER : Andy Linton PHONE : +44 91 232 9233 ARPA : andy%cheviot.newcastle.ac.uk@cs.ucl.ac.uk JANET : andy@uk.ac.newcastle.cheviot UUCP : andy@cheviot.UUCP