git: /bin/rm: fix removing symlinks with uchg/uappnd set

John Marino marino at
Thu Nov 15 15:45:47 PST 2012

commit cbe044e0f12b5ae86a47b7ec1bc61bbe0ad785ad
Author: John Marino <draco at>
Date:   Fri Nov 16 00:31:35 2012 +0100

    /bin/rm: fix removing symlinks with uchg/uappnd set
    One error case described in FreeBSD PR bin/111226:
      /bin/rm when running as super user and failing to unlink a
      UF_APPEND|UF_IMMUTABLE protected symbolic link will reset the
      UF_APPEND and UF_IMMUTABLE flags on the symbolic link's target (if
      that target exists) - an object that /bin/rm should not touch! (Quote
      from SUSv3: "The rm utility removes symbolic links themselves, not
      the files they refer to, as a consequence of the dependence on the
      unlink() functionality").
    There was a failure case for /usr/bin/find as well, but swildner
    recently synchronized find with FreeBSD and fixed that one.
    Taken-from: FreeBSD SVN 193087 (30 MAY 2009)

Summary of changes:
 bin/rm/rm.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list