4.2bsd Oddity (BUG?)

Barry Shein bzs%bostonu.csnet at csnet-relay.arpa
Tue Dec 17 00:56:15 AEST 1985


Here's one a faculty member pointed out, I suspect it was in
relation to one of his courses:

He makes a directory, call it 'gumby' and makes it 777 (world write
is what's important here.) Someone else comes along and creates
a directory 'gumby/pokey' (say protection 755) and puts a file (or
more) into it, call it gumby/pokey/foo.

At that point he can no longer remove the directory gumby because
it is not empty. 'rm -r' et al don't help because the directory
gumby/pokey is owned by the other user and does not allow him to
delete the file gumby/pokey/foo, nor chmod it. I think he is stuck
(obviously the student or myself can remove it.)

If I recall correctly, what he does is create a subdir for his students.
His students then create a subdir for themselves and put homeworks into
it, so the way he got there is fairly reasonable (it is a high level,
small course so security is not a big issue here I suspect, no need to
belabor that.)

Other than the obvious 'don't do it that way' am I missing something?
Is this a bug? Anyone want to suggest a fix?

	-Barry Shein, Boston University

P.S. If you think it's incredibly obvious you may have missed the
point, try the following first from root:

mkdir gumby
chown yournonprivacct gumby
chmod 777 gumby
mkdir gumby/pokey
chmod 755 gumby/pokey
echo hello > gumby/pokey/foo

Now make yourself non-prived (I just 'suspend' the 'su'd csh back to bzs)
and try to remove everything. pokey and foo should be owned by root
(or some other account.)



More information about the Comp.unix.wizards mailing list