Dippy icon indicating copy to clipboard operation
Dippy copied to clipboard

find -fprint/-fls/-fprintf write files but aren't guarded

Open ldayton opened this issue 5 months ago • 0 comments

Summary

The find handler guards -delete, -exec/-execdir, and -ok/-okdir, but misses find's file-writing actions. -fprint, -fls, and -fprintf each create/truncate the named file, yet currently classify as allow.

Repro (default config)

find . -fprint  /tmp/out        -> allow
find . -fls     /tmp/out        -> allow
find . -fprintf /tmp/out '%p'   -> allow

Each of these clobbers /tmp/out (and could target any writable path, e.g. a config or data file).

Suggested fix

Add -fprint, -fprintf, -fls to the "always ask" branch in src/dippy/cli/find.py, alongside -delete. (-fprint0 too.)

Notes

  • These are GNU findutils actions; BSD/macOS find doesn't have them, so this is a Linux-side gap.
  • Surfaced while investigating #130 (which was about -delete, already guarded).

ldayton avatar Jun 08 '26 12:06 ldayton