|
Message-ID: <20190121005053.GQ23599@brightrain.aerifal.cx> Date: Sun, 20 Jan 2019 19:50:53 -0500 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: Re: <shadow.h> function: fgetspent_r On Sun, Jan 20, 2019 at 03:12:59PM -0600, A. Wilcox wrote: > On 01/20/19 09:41, Markus Wichmann wrote: > > Hi all, > > > > so, I wrote a version of fgetspent_r() now. I based it on fgetspent(). > > For style, I adopted the Linux style -- might need to refactor that. > > Returning EILSEQ on format error is a hack, but I found no better code. > > As I said, glibc loops on error, but we do that for no other src/passwd > > function, so we should either not start now or add that feature to every > > other function. > > > > One thing I noticed: If AccountService requires this interfaces, is it > > possible that it doesn't support TCB shadow files? > > > > Ciao, > > Markus > > > It doesn't support TCB shadow files. How so? The whole point of this interface is that it reads from a FILE* provided by the caller, not the system shadow store. The usage case is writing utilities that access and modify the underlying files (or possibly tempfile copies thereof). > > +int fgetspent_r(FILE *f, struct spwd* sp, char *line, size_t size, > struct spwd **spret) > > Tiny style nit: I think the * is meant to be kept with 'sp', not 'spwd', > in the second argument. Yes. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.