From e42e0f1012229e4473919c738ab7e4bcaff8033a Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 16 Apr 2017 12:14:02 -0400 Subject: Implement -X --- eval.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 929eeba..8c33d21 100644 --- a/eval.c +++ b/eval.c @@ -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; } -- cgit v1.2.3