summaryrefslogtreecommitdiff
path: root/bin/rm
diff options
context:
space:
mode:
authorMaxim Konovalov <maxim@FreeBSD.org>2006-10-18 13:16:06 +0000
committerMaxim Konovalov <maxim@FreeBSD.org>2006-10-18 13:16:06 +0000
commitda29c6560be0b8d2dda0c6bd53b8d6966e448069 (patch)
tree10e735b97714bed5517edef99325832bcf49c1d4 /bin/rm
parent000723a6f84542428683d8dc37333085e8a76bca (diff)
downloadsrc-test2-da29c6560be0b8d2dda0c6bd53b8d6966e448069.tar.gz
src-test2-da29c6560be0b8d2dda0c6bd53b8d6966e448069.zip
Notes
Diffstat (limited to 'bin/rm')
-rw-r--r--bin/rm/rm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index 7d02fa051c41..614479d89320 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -317,7 +317,6 @@ rm_file(char **argv)
int rval;
char *f;
- bzero(&sb, sizeof(sb));
/*
* Remove a file. POSIX 1003.2 states that, by default, attempting
* to remove a directory is an error, so must always stat the file.
@@ -348,7 +347,7 @@ rm_file(char **argv)
if (!fflag && !S_ISWHT(sb.st_mode) && !check(f, f, &sb))
continue;
rval = 0;
- if (!uid &&
+ if (!uid && !S_ISWHT(sb.st_mode) &&
(sb.st_flags & (UF_APPEND|UF_IMMUTABLE)) &&
!(sb.st_flags & (SF_APPEND|SF_IMMUTABLE)))
rval = chflags(f, sb.st_flags & ~(UF_APPEND|UF_IMMUTABLE));