Re: Cleanup of err(1, "unveil") pattern: bin, games, sbin

2021-05-03 Thread Ashton Fagg
"Theo de Raadt" writes: > No, it is either: > > err(1, "unveil %s", path) > > or > > err(1, "unveil: %s", path) > > I remain undecided between those two, i don't particularily like two :: in > a error message. Ok splendid. I've regenerated these, this time including dhcpleased and slaacd since

Re: Cleanup of err(1, "unveil") pattern: bin, games, sbin

2021-05-03 Thread Florian Obser
Florian Obser writes: > There are 4 or five cases how unveil is called, depending on how > you count. The permission seems to be always a string literal or NULL. > The path can be: > > 1) a string literal > 2) a #define > 3) a variable > 4) the empty string literal "" For the archives, I

Re: Cleanup of err(1, "unveil") pattern: bin, games, sbin

2021-05-03 Thread Theo de Raadt
Ashton Fagg wrote: > On Mon, 3 May 2021 at 10:17, Theo de Raadt wrote: > > So if the messages were just 'unveil %s: error' or 'unveil: %s: error' > > I would be thrilled, as this allows users to realize why the program is > > not working right. > > Florian/Theo, > > Thanks for the reviews. >

Re: Cleanup of err(1, "unveil") pattern: bin, games, sbin

2021-05-03 Thread Ashton Fagg
On Mon, 3 May 2021 at 10:17, Theo de Raadt wrote: > So if the messages were just 'unveil %s: error' or 'unveil: %s: error' > I would be thrilled, as this allows users to realize why the program is > not working right. Florian/Theo, Thanks for the reviews. So it sounds like err(1, "unveil: %s

Re: Cleanup of err(1, "unveil") pattern: bin, games, sbin

2021-05-03 Thread Florian Obser
"Theo de Raadt" writes: > Florian Obser wrote: > >> In this hunk alone you have three out of five and you log them all >> differently. I think this should be unified as >> fatal("unveil(\"%s\", \"%s\")", _PATH_RESCONF, "wc"); >> fatal("unveil(\"%s\", \"%s\")", /etc/resolv.conf.tail,

Re: Cleanup of err(1, "unveil") pattern: bin, games, sbin

2021-05-03 Thread Theo de Raadt
Theo de Raadt wrote: > Florian Obser wrote: > > > In this hunk alone you have three out of five and you log them all > > differently. I think this should be unified as > > fatal("unveil(\"%s\", \"%s\")", _PATH_RESCONF, "wc"); > > fatal("unveil(\"%s\", \"%s\")", /etc/resolv.conf.tail,

Re: Cleanup of err(1, "unveil") pattern: bin, games, sbin

2021-05-03 Thread Theo de Raadt
Florian Obser wrote: > In this hunk alone you have three out of five and you log them all > differently. I think this should be unified as > fatal("unveil(\"%s\", \"%s\")", _PATH_RESCONF, "wc"); > fatal("unveil(\"%s\", \"%s\")", /etc/resolv.conf.tail, "r"); >

Re: Cleanup of err(1, "unveil") pattern: bin, games, sbin

2021-05-03 Thread Florian Obser
On Sun, May 02, 2021 at 09:00:21PM -0400, Ashton Fagg wrote: > "Theo de Raadt" writes: > > > Showing the symbolic name is not doing anywhere else in the tree. > > > > Most likely they should be > > > >err(1, "unveil: %s", path); > > Per Theo's advice, updated diffs are attached.

Re: Cleanup of err(1, "unveil") pattern: bin, games, sbin

2021-05-02 Thread Ashton Fagg
"Theo de Raadt" writes: > Showing the symbolic name is not doing anywhere else in the tree. > > Most likely they should be > > err(1, "unveil: %s", path); Per Theo's advice, updated diffs are attached. diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index

Re: Cleanup of err(1, "unveil") pattern: bin, games, sbin

2021-05-02 Thread Ashton Fagg
Thanks for the review - wasn't sure if that was useful. Will regenerate without the symbolic names. On Sun, 2 May 2021 at 20:37, Theo de Raadt wrote: > > Showing the symbolic name is not doing anywhere else in the tree. > > Most likely they should be > >err(1, "unveil: %s", path); >

Re: Cleanup of err(1, "unveil") pattern: bin, games, sbin

2021-05-02 Thread Theo de Raadt
Showing the symbolic name is not doing anywhere else in the tree. Most likely they should be err(1, "unveil: %s", path); Ashton Fagg wrote: > Ashton Fagg writes: > > > Hi all, > > > > I saw a discussion on here a while ago about the use of patterns like: > > > > if