diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2017-04-16 12:14:02 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2017-04-16 12:14:02 -0400 |
commit | e42e0f1012229e4473919c738ab7e4bcaff8033a (patch) | |
tree | d4e7d16a4e2ece4b4de1aac1d8075369d8d645a0 /eval.c | |
parent | 455b724279c1cb4aefc0d2f81b65641990dd7689 (diff) | |
download | bfs-e42e0f1012229e4473919c738ab7e4bcaff8033a.tar.xz |
Implement -X
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -964,6 +964,13 @@ static enum bftw_action cmdline_callback(struct BFTW *ftwbuf, void *ptr) { goto done; } + if (cmdline->xargs_safe && strpbrk(ftwbuf->path, " \t\n\'\"\\")) { + args->ret = -1; + cfprintf(cmdline->cerr, "%{er}'%s': Path is not safe for xargs.%{rs}\n", ftwbuf->path); + state.action = BFTW_SKIP_SUBTREE; + goto done; + } + if (ftwbuf->depth >= cmdline->maxdepth) { state.action = BFTW_SKIP_SUBTREE; } |