2.1.85+Alan-2: strangeness with rm and sudo

Trevor Johnson (trevor@jpj.net)
Fri, 6 Feb 1998 01:28:02 -0800 (PST)


As root, I had done "cat /dev/vcs3>/tmp/vcs3" to save the text from a
virtual console into a file. Later, when I tried to clean up /tmp as
myself using sudo, I was unable to remove the file, even though it
appeared to have the same permissions as others which I could remove. I
logged in as root and could then delete it.

~> cd /tmp
/tmp> ls -ls|sort
4 -rw-r--r-- 1 root root 3200 Feb 5 14:57 vcs3
4 -rw-r--r-- 1 root root 4072 Jan 22 20:56 awe_config.853
4 -rw-r--r-- 1 root root 4072 Jan 22 20:56 awe_config.878
4 -rw-r--r-- 1 root root 4072 Jan 25 20:26 awe_config.524
4 -rw-r--r-- 1 root root 4072 Jan 25 20:26 awe_config.546
4 -rw-r--r-- 1 root root 4072 Jan 25 20:27 awe_config.562
65 -rw------- 1 root root 65536 Jan 31 19:07 elvis1.ses
97 -rw------- 1 root root 98304 Jan 31 20:01 elvis3.ses
145 -rw------- 1 root root 147456 Jan 31 19:48 elvis2.ses
/tmp> sudo rm elvis*ses
Password:
/tmp> sudo rm awe_config.*
/tmp> rm vcs3
rm: remove `vcs3', overriding mode 0644? y
rm: vcs3: Operation not permitted
/tmp> ls -l vcs3
-rw-r--r-- 1 root root 3200 Feb 5 14:57 vcs3

~# cd /tmp
/tmp# rm vcs3
/tmp#

/tmp% what `which sudo`
/usr/bin/sudo
The Linux C library 5.3.5
encrypt.c 3.4 19:44:23 12/10/90
getpass.c 3.7 08:27:22 10/31/91
rad64.c 3.3 20:38:01 3/7/92
shadow.c 3.10 20:38:10 3/7/92
patchlevel.h 1.6 01/31/92
/tmp% ldd /usr/bin/sudo
statically linked (ELF)

My rm is from the GNU fileutils, version 3.16, and is dynamically linked
to libc 2.0.5.
___
Trevor Johnson

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu