This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] nsswitch: Add group merging support


On 28 Mar 2016 09:50, Stephen Gallagher wrote:
> On 03/21/2016 08:40 PM, Mike Frysinger wrote:
> > On 04 Jan 2016 09:12, Stephen Gallagher wrote:
> >> +a match, the behavior is undefined.
> > 
> > could you clarify "undefined" ?  people could interpret this as memory
> > corruption / crashes, while others are are inconsistent results.  i think
> > we just want the latter.
> 
> OK, the language "undefined" was suggested to me by Carlos. In reality, the
> results are actually *consistent*, but they're consistently different depending
> on which attribute was initially searched.
> 
> (Meaning getgrnam() will always return the same results and getgrgid() will
> always return the same results, but they will not be the same as each other.)
> 
> As for "undefined", I think I'd actually prefer to keep it that way, because
> it's a strong assertion that you should be careful not to do this. The external
> effect to an inconsistent set of responses from NSS is likely to have
> wide-ranging negative effects on the system. I'm perfectly content to have
> "scary" language in the documentation to guard against that.

in general i'm fine with "undefined", i would just prefer scoping it a
bit.  it's "undefined" in terms of the result set, but it's not in terms
of your program eating itself.

> >> +      else
> >> +	{
> >> +	  no_more = __nss_next2 (nip, func_name, NULL, &fct.ptr, status, 0);
> >> +	}
> > 
> > could elide the braces
> 
> I am aware, but my personal preference is to always have braces even for
> single-line IF/ELSE blocks (helps avoid merge issues like the famous Apple GOTO
> bug).

w/gcc-6 coming down the pike, i'd rather just go with relying on the new
warning flag about misleading indentation.
-mike

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]