Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-12 Thread Antoine Jacoutot
On Tue, Sep 10, 2019 at 05:58:53PM +0100, Raf Czlonka wrote: > On Tue, Sep 10, 2019 at 05:53:34PM BST, Todd C. Miller wrote: > > On Tue, 10 Sep 2019 16:56:42 +0100, Raf Czlonka wrote: > > > > > How about ditching dirname(1)? > > > > dirname(1) handles files in the root directory as well as files

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Andreas Kusalananda Kähäri
On Tue, Sep 10, 2019 at 05:58:53PM +0100, Raf Czlonka wrote: > On Tue, Sep 10, 2019 at 05:53:34PM BST, Todd C. Miller wrote: > > On Tue, 10 Sep 2019 16:56:42 +0100, Raf Czlonka wrote: > > > > > How about ditching dirname(1)? > > > > dirname(1) handles files in the root directory as well as files

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Sebastien Marie
On Tue, Sep 10, 2019 at 09:10:57AM -0600, Todd C. Miller wrote: > > Let's just skip that check when fcodes is "-". > I'am fine with it too. ok semarie@ > > Index: usr.bin/locate/locate/updatedb.sh > === > RCS file: /cvs/src/usr.b

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Klemens Nanni
On Tue, Sep 10, 2019 at 09:10:57AM -0600, Todd C. Miller wrote: > Let's just skip that check when fcodes is "-". OK kn

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Klemens Nanni
On Tue, Sep 10, 2019 at 05:58:53PM +0100, Raf Czlonka wrote: > FYI, what prompted me to use shell instead of dirname(1) is the > recent removal of basename(1)[0] but it seems like the latter doesn't > suffer from similar edge cases :^) Correct, because we can expect dirname(1) to be sure when weekl

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Sebastien Marie
On Tue, Sep 10, 2019 at 11:51:09AM -0400, Kurt Mosiejczuk wrote: > On Tue, Sep 10, 2019 at 09:10:57AM -0600, Todd C. Miller wrote: > > However, it looks like all that logic in weekly is unnecessary. > It is largely a duplicate of what is alkready in updatedb.sh. > updatedb.sh already traps more s

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Raf Czlonka
On Tue, Sep 10, 2019 at 05:53:34PM BST, Todd C. Miller wrote: > On Tue, 10 Sep 2019 16:56:42 +0100, Raf Czlonka wrote: > > > How about ditching dirname(1)? > > dirname(1) handles files in the root directory as well as files > with no directory correctly, your diff does not. > > E.g. > > FCODES=

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Todd C . Miller
On Tue, 10 Sep 2019 16:56:42 +0100, Raf Czlonka wrote: > How about ditching dirname(1)? dirname(1) handles files in the root directory as well as files with no directory correctly, your diff does not. E.g. FCODES=/foo ${FCODES%/*} -> "" dirname $FCODES -> "/" FCODES=bar ${FCODES%/*} -> "" dirn

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Kurt Mosiejczuk
On Tue, Sep 10, 2019 at 05:22:33PM +0100, Raf Czlonka wrote: > > > As per below, only dirname(1), not the logic! :^) > > > ${FCODES%/*} instead of $( dirname "${FCODES}" ) > > Is that portable outside of ksh? We had taken the non-ksh specific > > route before to keep it portable. I see our sh(1)

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Andreas Kusalananda Kähäri
On Tue, Sep 10, 2019 at 12:13:31PM -0400, Kurt Mosiejczuk wrote: > On Tue, Sep 10, 2019 at 05:03:54PM +0100, Raf Czlonka wrote: > > On Tue, Sep 10, 2019 at 04:58:19PM BST, Kurt Mosiejczuk wrote: > > > On Tue, Sep 10, 2019 at 04:56:42PM +0100, Raf Czlonka wrote: > > > > > How about ditching dirname

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Raf Czlonka
On Tue, Sep 10, 2019 at 05:13:31PM BST, Kurt Mosiejczuk wrote: > On Tue, Sep 10, 2019 at 05:03:54PM +0100, Raf Czlonka wrote: > > On Tue, Sep 10, 2019 at 04:58:19PM BST, Kurt Mosiejczuk wrote: > > > On Tue, Sep 10, 2019 at 04:56:42PM +0100, Raf Czlonka wrote: > > > > > How about ditching dirname(1

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Kurt Mosiejczuk
On Tue, Sep 10, 2019 at 05:03:54PM +0100, Raf Czlonka wrote: > On Tue, Sep 10, 2019 at 04:58:19PM BST, Kurt Mosiejczuk wrote: > > On Tue, Sep 10, 2019 at 04:56:42PM +0100, Raf Czlonka wrote: > > > How about ditching dirname(1)? > > File may not exist yet, in which case -w will be false, even if w

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Raf Czlonka
On Tue, Sep 10, 2019 at 04:58:19PM BST, Kurt Mosiejczuk wrote: > On Tue, Sep 10, 2019 at 04:56:42PM +0100, Raf Czlonka wrote: > > > How about ditching dirname(1)? > > File may not exist yet, in which case -w will be false, even if we > have permissions to create it. As per below, only dirname(1)

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Kurt Mosiejczuk
On Tue, Sep 10, 2019 at 04:56:42PM +0100, Raf Czlonka wrote: > How about ditching dirname(1)? File may not exist yet, in which case -w will be false, even if we have permissions to create it. --Kurt > Index: usr.bin/locate/locate/updatedb.sh > ===

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Raf Czlonka
On Tue, Sep 10, 2019 at 04:10:57PM BST, Todd C. Miller wrote: > On Tue, 10 Sep 2019 09:42:16 +0200, Sebastien Marie wrote: > > > the use of '-' is documented has a valid option, and weekly(8) uses it > > in order to run locate.updatedb(8) has 'nobody' and have the output in > > tempfile under /var

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Kurt Mosiejczuk
On Tue, Sep 10, 2019 at 09:10:57AM -0600, Todd C. Miller wrote: > On Tue, 10 Sep 2019 09:42:16 +0200, Sebastien Marie wrote: > > the use of '-' is documented has a valid option, and weekly(8) uses it > > in order to run locate.updatedb(8) has 'nobody' and have the output in > > tempfile under /var

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Todd C . Miller
On Tue, 10 Sep 2019 09:42:16 +0200, Sebastien Marie wrote: > the use of '-' is documented has a valid option, and weekly(8) uses it > in order to run locate.updatedb(8) has 'nobody' and have the output in > tempfile under /var/db (place writable only by root). > > with the change, as weekly(8) run

weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Sebastien Marie
Hi, Last change on locate.updatedb(8) ensures that the file passed via --fcodes option is in a writeable directory, and error out if it isn't. but it doesn't allow anymore '-' (output on stdout). the use of '-' is documented has a valid option, and weekly(8) uses it in order to run locate.updated