Skip to content

gnucompability(xargs): when a filename contain an ascii space, it leads to an error #771

Description

@HackingRepo

Hi, findutils mainteners

that looks to me a capability issue, i see

relunsec@relunsec:~/software/findutils/target/debug$ echo -n " " > a.txt
relunsec@relunsec:~/software/findutils/target/debug$ sudo ./xargs -a a.txt ls
ls: cannot access '': No such file or directory
relunsec@relunsec:~/software/findutils/target/debug$ sudo /bin/xargs -a a.txt ls
a.txt  build  deps  examples  find  find.d  incremental	 libfindutils.d	 libfindutils.rlib  locate  locate.d  testing-commandline  testing-commandline.d  updatedb  updatedb.d	xargs  xargs.d
relunsec@relunsec:~/software/findutils/target/debug$ sudo ./xargs -a a.txt echo

relunsec@relunsec:~/software/findutils/target/debug$ sudo /bin/xargs -a a.txt echo

relunsec@relunsec:~/software/findutils/target/debug$ sudo ./xargs -a a.txt echo | xxd
00000000: 0a                                       .
relunsec@relunsec:~/software/findutils/target/debug$ sudo /bin/xargs -a a.txt echo | xxd
00000000: 0a                                       .
relunsec@relunsec:~/software/findutils/target/debug$ 

when doing an echo normal, but when ls no, while the gnu one xargs correctly interept that

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions