bin/56558: [PATCH] locate(1) cannot be safely used with xargs(1)

Eugene Grosbein eugen at kuzbass.ru
Fri Sep 12 19:47:31 PDT 2003


FUJISHIMA Satsuki wrote:

> >  > command | tr '\n' '\0' | xargs -0 foo
> >  > would work for any commands, not limited to locate(1).
> >
> >  It will break when filename contains '\n' that is allowed.
> 
> Don't worry.
> 
> If our locate(1) is implemented enough to satisfy its manpage, it
> does not store newline and NUL into DB. Actually, any input will be
> chopped by '\n'. So you would never get unexpected newline.
> 
> quoted from locate(1):
>      Historically, locate only stored characters between 32 and 127.  The cur-
>      rent implementation store any character except newline (`\n') and NUL
>      (`\0'). (...)

It is misfeature then. Why?

Eugene Grosbein


More information about the freebsd-bugs mailing list