1 Dec 2002 06:03
Re: Internal get{pw,gr}XX calls
Pierre A. Humblet <Pierre.Humblet <at> ieee.org>
2002-12-01 05:03:21 GMT
2002-12-01 05:03:21 GMT
Corinna,
The attached patch includes the changes to grab_int and parse_grp.
I like your initial idea (a little simplified) better because it
leaves uid = -1 as a usable value. That may prove useful one day
(I have some ideas). It also makes parse_pwd somewhat simpler.
strtoul replaces strtol. I have verified that both strtoul("-2",..)
and strtoul("4294967294",..) return 0xFFFFFFFE.
I have kept updating the state to loaded in read_etc_{passwd,group}.
This patch replaces what I sent on Friday. It is incremental over
the earlier big patch involving 9 files.
Pierre
2002-11-30 Pierre Humblet <pierre.humblet <at> ieee.org>
* pwdgrp.h (pwdgrp_check::pwdgrp_state): Replace by
pwdgrp_check::isinitializing ().
(pwdgrp_check::isinitializing): Create.
* passwd.cc (grab_int): Change type to unsigned, use strtoul and
set the pointer content to 0 if the field is invalid.
(parse_pwd): Move validity test after getting pw_gid.
(read_etc_passwd): Replace "passwd_state <= " by
passwd_state::isinitializing ().
(internal_getpwuid): Ditto.
(internal_getpwnam): Ditto.
(getpwent): Ditto.
(Continue reading)
RSS Feed