summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c7
1 files changed, 7 insertions, 0 deletions
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;
}