On Tue, Jan 21, 2003 at 11:47:35AM -0500, Pierre A. Humblet wrote: >Christopher Faylor wrote: >>You'd need a per-thread buffer to accomplish that. I assume that is >>what you had in mind. > >If you look at them, most internal_get{pw,gr} calls from outside of >passwd.cc and grp.cc only want the {u,g}id, the sid or the name, but >never the other fields. I wanted to avoid copying the entire line, at >least in the first two cases.
Btw, Pierre, can you explain the rationale behind the "check" parameter that some of the internal_* functions take? Why would you not want to check for an up-to-date /etc/passwd or /etc/group? If not for this, it seems like we could get rid of the initialization check entirely and just let fn_changed return true when fn[etc_ix] is uninitialized, forcing an initial read/parse of the appropriate file. cgf