Download raw body.
tweak gotd getpwnam err message
On 22-12-29 11:37AM, Omar Polo wrote:
> 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.
Good point! I'm partial to the quotes too or even the:
"user not found: %s", gotd.user_name
form we use in some places but it's highly subjective and not really
important
--
Mark Jamsek <fnc.bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80 E6E2 2930 DC66 86EE CF68
tweak gotd getpwnam err message