From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13627 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: function: fgetspent_r Date: Sun, 20 Jan 2019 19:50:53 -0500 Message-ID: <20190121005053.GQ23599@brightrain.aerifal.cx> References: <4ac5ac1b-217f-442f-fc35-bfbf015287bb@adelielinux.org> <20190116205046.GK23599@brightrain.aerifal.cx> <20190116234410.GL23599@brightrain.aerifal.cx> <20190117053147.GH29911@voyager> <20190117153830.GN23599@brightrain.aerifal.cx> <20190118203725.GI29911@voyager> <20190120154154.GA23924@voyager> <0ab4cefc-b617-2a1d-aa6f-5aed2257a0f7@adelielinux.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: ciao.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ciao.gmane.org 1548031860 17422 195.159.176.228 (21 Jan 2019 00:51:00 GMT) X-Complaints-To: usenet@ciao.gmane.org NNTP-Posting-Date: Mon, 21 Jan 2019 00:51:00 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-13643-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jan 21 01:50:58 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by ciao.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1glNnm-0004Uo-9A for gllmg-musl@m.gmane.org; Mon, 21 Jan 2019 01:50:58 +0100 Original-Received: (qmail 13835 invoked by uid 550); 21 Jan 2019 00:51:06 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 13812 invoked from network); 21 Jan 2019 00:51:05 -0000 Content-Disposition: inline In-Reply-To: <0ab4cefc-b617-2a1d-aa6f-5aed2257a0f7@adelielinux.org> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13627 Archived-At: 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