Ian Lepore
34e9190d82
Make pw_scan(3) more compatible with getpwent(3) et. al. when processing
...
data from /etc/passwd rather than /etc/master.passwd.
The libc getpwent(3) and related functions automatically read master.passwd
when run by root, or passwd when run by a non-root user. When run by non-
root, getpwent() copes with the missing data by setting the corresponding
fields in the passwd struct to known values (zeroes for numbers, or a
pointer to an empty string for literals). When libutil's pw_scan(3) was
used to parse a line without the root-accessible data, it was leaving
garbage in the corresponding fields.
These changes rename the static pw_init() function used by getpwent() and
friends to __pw_initpwd(), and move it into pw_scan.c so that common init
code can be shared between libc and libutil. pw_scan(3) now calls
__pw_initpwd() before __pw_scan(), just like the getpwent() family does, so
that reading an arbitrary passwd file in either format and parsing it with
pw_scan(3) returns the same results as getpwent(3) would.
This also adds a new pw_initpwd(3) function to libutil, so that code which
creates passwd structs from scratch in some manner that doesn't involve
pw_scan() can initialize the struct to the values expected by lots of
existing code, which doesn't expect to encounter NULL pointers or garbage
values in some fields.
2018-07-26 18:34:38 +00:00
..
2017-11-25 17:12:48 +00:00
2015-01-03 18:38:46 +00:00
2018-07-03 17:31:45 +00:00
2017-11-25 17:12:48 +00:00
2017-11-25 17:12:48 +00:00
2017-11-20 19:49:47 +00:00
2017-11-25 17:12:48 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-03-21 23:52:37 +00:00
2018-07-03 17:31:45 +00:00
2017-11-25 17:12:48 +00:00
2017-12-08 22:06:18 +00:00
2017-05-23 06:53:31 +00:00
2016-11-03 20:21:34 +00:00
2014-12-21 12:36:36 +00:00
2014-06-23 08:25:03 +00:00
2017-11-25 17:12:48 +00:00
2014-06-23 08:25:03 +00:00
2016-08-04 11:38:53 +00:00
2017-11-25 17:12:48 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2017-11-25 17:12:48 +00:00
2017-12-23 18:07:43 +00:00
2018-07-03 17:31:45 +00:00
2017-05-23 09:29:05 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-05-23 17:34:10 +00:00
2017-11-25 17:12:48 +00:00
2016-08-12 07:03:58 +00:00
2017-05-23 06:56:57 +00:00
2016-09-18 20:47:55 +00:00
2018-07-03 17:31:45 +00:00
2014-10-09 22:58:33 +00:00
2017-11-25 17:12:48 +00:00
2014-06-23 08:25:03 +00:00
2017-07-10 14:59:21 +00:00
2017-11-25 17:12:48 +00:00
2017-11-25 17:12:48 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2017-11-25 17:12:48 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-04-12 18:23:14 +00:00
2017-11-25 17:12:48 +00:00
2017-11-20 19:49:47 +00:00
2017-11-25 17:12:48 +00:00
2017-11-25 17:12:48 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-11-25 17:12:48 +00:00
2017-02-28 23:42:47 +00:00
2017-11-25 17:12:48 +00:00
2018-07-03 17:31:45 +00:00
2014-12-21 12:36:36 +00:00
2017-11-25 17:12:48 +00:00
2018-07-03 17:31:45 +00:00
2017-05-23 09:29:05 +00:00
2018-07-03 17:31:45 +00:00
2017-11-20 19:49:47 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2014-12-21 12:36:36 +00:00
2017-05-23 09:29:05 +00:00
2017-11-20 19:49:47 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-06-12 00:43:14 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-03-21 01:15:45 +00:00
2018-03-21 23:52:37 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2018-01-23 22:18:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-06-13 18:34:49 +00:00
2018-07-03 17:31:45 +00:00
2017-04-26 14:28:27 +00:00
2018-07-03 17:31:45 +00:00
2014-06-23 08:25:03 +00:00
2017-11-25 17:12:48 +00:00
2017-02-28 23:42:47 +00:00
2017-02-04 00:37:25 +00:00
2018-02-23 00:28:00 +00:00
2017-02-28 23:42:47 +00:00
2018-07-26 18:34:38 +00:00
2018-02-27 10:55:33 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2015-04-26 10:29:43 +00:00
2017-11-25 17:12:48 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2017-05-23 09:29:05 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2017-12-31 00:46:41 +00:00
2017-11-25 17:12:48 +00:00
2017-11-25 17:12:48 +00:00
2016-12-06 19:08:29 +00:00
2017-02-28 23:42:47 +00:00
2018-05-10 06:41:08 +00:00
2017-11-25 17:12:48 +00:00
2018-01-31 17:56:36 +00:00
2018-04-12 18:23:14 +00:00
2017-02-28 23:42:47 +00:00
2016-12-06 19:08:29 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2015-04-26 10:52:37 +00:00
2015-04-26 10:52:37 +00:00
2018-02-27 04:41:14 +00:00
2017-11-25 17:12:48 +00:00
2015-04-26 10:52:37 +00:00
2015-04-26 10:52:37 +00:00
2015-04-26 10:52:37 +00:00
2015-04-26 10:52:37 +00:00
2015-04-26 10:52:37 +00:00
2015-04-26 10:52:37 +00:00
2015-04-26 10:52:37 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-11-25 17:12:48 +00:00
2018-07-26 18:34:38 +00:00
2018-07-26 18:34:38 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2016-01-24 22:20:13 +00:00
2016-10-11 11:46:02 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2014-10-24 19:55:49 +00:00
2014-10-24 19:55:49 +00:00
2014-10-24 19:55:49 +00:00
2017-11-25 17:12:48 +00:00
2014-10-24 19:55:49 +00:00
2015-01-28 22:42:56 +00:00
2017-05-24 17:50:34 +00:00
2014-10-24 19:55:49 +00:00
2017-11-25 17:12:48 +00:00
2018-03-02 22:32:53 +00:00
2016-01-29 14:12:12 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-04 13:31:16 +00:00
2018-07-04 13:31:16 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2017-12-01 22:48:20 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2014-06-23 08:25:03 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-26 18:34:38 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-10-22 10:35:29 +00:00
2018-07-03 17:31:45 +00:00
2017-11-25 17:12:48 +00:00
2018-04-12 17:47:36 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2017-05-23 06:58:08 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-12-06 22:06:48 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-12-12 11:25:30 +00:00
2015-01-12 18:13:38 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-11-25 17:12:48 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-11-25 17:12:48 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2017-11-25 17:12:48 +00:00
2017-11-25 17:12:48 +00:00
2017-02-28 23:42:47 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2018-07-03 17:31:45 +00:00
2017-11-25 17:12:48 +00:00
2018-07-03 17:31:45 +00:00
2015-09-30 21:32:29 +00:00
2017-11-25 17:12:48 +00:00