From 9e525699071499305398712042b790258045155c Mon Sep 17 00:00:00 2001 From: jilles Date: Sat, 30 May 2009 10:42:19 +0000 Subject: rm, find -delete: fix removing symlinks with uchg/uappnd set. Formerly, this tried to clear the flags on the symlink's target instead of the symlink itself. As before, this only happens for root or for the unlink(1) variant of rm. PR: bin/111226 (part of) Submitted by: Martin Kammerhofer Approved by: ed (mentor) MFC after: 3 weeks --- usr.bin/find/function.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.bin') diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index 2641264..bfa0a36 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -443,7 +443,7 @@ f_delete(PLAN *plan __unused, FTSENT *entry) if ((entry->fts_statp->st_flags & (UF_APPEND|UF_IMMUTABLE)) && !(entry->fts_statp->st_flags & (SF_APPEND|SF_IMMUTABLE)) && geteuid() == 0) - chflags(entry->fts_accpath, + lchflags(entry->fts_accpath, entry->fts_statp->st_flags &= ~(UF_APPEND|UF_IMMUTABLE)); /* rmdir directories, unlink everything else */ -- cgit v1.1