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

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: tweak gotd getpwnam err message
To:
Mark Jamsek <mark@jamsek.com>
Cc:
gameoftrees@openbsd.org
Date:
Thu, 29 Dec 2022 11:37:40 +0100

Download raw body.

Thread
On 2022/12/29 20:47:56 +1100, Mark Jamsek <mark@jamsek.com> wrote:
> >  	pw = getpwnam(gotd.user_name);
> >  	if (pw == NULL)
> > -		fatal("getpwuid: user %s not found", gotd.user_name);
> > +		fatalx("user %s not found", gotd.user_name);
> 
> should we quote <user> like we do elsewhere?
> 
> 		fatalx("user '%s' not found", gotd.user_name);

I like a bit more if quoted too, but quickly skimming through the
error messages we don't quote user naems, see for example gotwebd.c

> >  
> >  	if (pw->pw_uid == 0) {
> >  		fatalx("cannot run %s as %s: the user running %s "

or even here, so I kept my initial diff for consistency.