"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: gotsysd: use PATH_MAX for realpath
To:
Martijn van Duren <openbsd+got@list.imperialat.at>
Cc:
"gameoftrees@openbsd.org" <gameoftrees@openbsd.org>
Date:
Sun, 11 Oct 2026 08:47:38 +0200

Download raw body.

Thread
On Sat, Oct 10, 2026 at 04:00:07PM +0200, Martijn van Duren wrote:
> >> commit - 10f51ecc4cbfab15f63d68920c9674a2995fd394
> >> blob - b057df8abd2756d0e491d4a746945a917b55ce82
> >> file + gotsysd/libexec/gotsys-useradd/gotsys-useradd.c
> >> --- gotsysd/libexec/gotsys-useradd/gotsys-useradd.c
> >> +++ gotsysd/libexec/gotsys-useradd/gotsys-useradd.c
> >> @@ -548,7 +548,7 @@ add_users(void)
> >>  		 * put the new users before it, and preserve entries
> >>  		 * after the yp entry.
> >>  		 */
> >> -		 if (linelen > 1 && line[0] == '+' & line[1] == ':') {
> >> +		 if (linelen > 1 && (line[0] == '+') & (line[1] == ':')) {
> > 
> > Shouldn't that say && instead of & ?
> 
> I didn't look too closely at the logic and simply silenced the
> compiler. Initially I read line[0] == '+' && line[0] == ':' which would
> point towards using ||, but in this context && makes sense. But not
> knowing the protocol: I trust your word.

This code comes from usr.sbin/user/user.c, where && is used.
It is trying to find a line in the password ile which begins with "+:".