[Bug 194132] New: rm(1) is ignoring more errors than it should in rm_tree(..)

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Oct 4 05:44:00 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194132

            Bug ID: 194132
           Summary: rm(1) is ignoring more errors than it should in
                    rm_tree(..)
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: Needs Triage
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: ngie at FreeBSD.org

This code in bin/rm/rm.c catches more errors than it should:

338         if (!fflag && errno)
339                 err(1, "fts_read");
340         fts_close(fts);
341 }

In particular, the code will mask errors if fts_read fails with anything other
than EACCES, ENOENT, or EPERM according to the intent of -f in rm(1):

     -f      Attempt to remove the files without prompting for confirmation,
             regardless of the file's permissions.  If the file does not
             exist, do not display a diagnostic message or modify the exit
             status to reflect an error.  The -f option overrides any previous
             -i options.

Please see the related bug for more details.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list