[comp.os.minix] Unable to remove directories in V1.5

greg@mobius.Viewlogic.COM (Gregory Larkin) (03/06/91)

Hi all,

I've got a fairly bizarre problem with V1.5: I cannot remove any 
directory that I create! This can be duplicated if I am user "root"
or user "ast".  "root" cannot remove directories with 777 protection!
My umask for "root" is 0000.  The umask for "ast" is "0022".

What's going on here?

PS:  If I am "ast" and create a directory, then "su" to root, "root"
     cannot remove a 777 directory owned by "ast"!!  I've tried rmdir
     and "rm -rf".

Please help!

Thanks,
--
Greg Larkin (ASIC Engineer)
Viewlogic Systems, Inc. (The CAE Company)
293 Boston Post Road West ____________________________________________
Marlboro, MA 01752        |"This is a fragile ball we are living on; |
508 480 0881 x321         |it's a miracle and we are destroying it.."|
Email: greg@Viewlogic.COM |Peter Garrett, Midnight Oil               |
                          --------------------------------------------

wayne@ledgepc.uucp (Wayne Brown) (03/09/91)

From article <1991Mar6.105044@mobius.Viewlogic.COM>, by greg@mobius.Viewlogic.COM (Gregory Larkin):
> Hi all,
> 
> I've got a fairly bizarre problem with V1.5: I cannot remove any 
> directory that I create! This can be duplicated if I am user "root"
> or user "ast".  "root" cannot remove directories with 777 protection!
> My umask for "root" is 0000.  The umask for "ast" is "0022".

< stuff deleted >

It sounds like rmdir has its setuid bit set and is owned by someone other
than root (probably bin).  This would prevent you from removing anything
not owned by the owner of rmdir. (And since "rm -r" actually execs rmdir,
that wouldn't work either.)  Try using chmod u-s /usr/bin/rmdir and see
if the problem goes away.

-- 
Wayne Brown	wayne@ledgepc.uucp
		uunet!{loft386,dsuvax}!ledgepc!wayne
		72447.2645@compuserve.com
Warning:  .signature truncated; maximum trivia level exceeded.

tsarna@pooh (Tyler Sarna) (03/12/91)

In comp.os.minix, Mike Zanker <A.M.Zanker%NEWCASTLE.AC.UK@VM1.NoDak.EDU>
writes:

> It seems that if you issue a command (that sits in the background) from
> a certain directory then you cannot remove that directory until the process
> has finished one way or another. Is this normal Minix behaviour? Is it
> normal Unix behaviour?!

I don't know about normal Unix behavior, it it's normal for at
least some OS's (Amiga OS for one...). It also seems like the
"right" behavior to me. I nearly scared myself silly once while
porting the Quelo 68K assembler to the DECstation 3100 because
Unix (or at least Ultrix) does let you remove a directory that a
program is currently in.

I was working on two different machines, and after cleaning up
some garbage files and directories on one machine I returned to
the other. Now, not remembering where I left that machine, I did
an ls, and nearly had a heart attack when it responded
".: not found". After about 5 minutes of swearing under my
breath and wondering how badly I'd trashed DEC's porting
machine's filesystem and how, I had the bright idea of doing a
pwd, and realized that I was in one of the directories which I'd
deleted from another machine.

Of course you don't have to do it from another machine, you can
do it from the same shell:

	pooh% md foo
	pooh% cd foo
	pooh% rm -r ../foo
	pooh% ls
	.: Stale NFS file handle

(I assume the difference in the message is due to this machine
running a later version of Ultrix)

------///------------------------------------------------------------
     /// Tyler "Ty" Sarna            E-Mail: tsarna@polar.bowdoin.edu 
 \\\///  "Welcome to the Late Show/Starring Null and Void" - Men@Work
--\XX/---------------------------------------------------------------

PS. Yes, they really did name this workstation after Winnie the Pooh...

klamer@mi.eltn.utwente.nl (Klamer Schutte -- Universiteit Twente) (03/12/91)

In <1991Mar6.105044@mobius.Viewlogic.COM> greg@mobius.Viewlogic.COM (Gregory Larkin) writes:

>Hi all,

>I've got a fairly bizarre problem with V1.5: I cannot remove any 
>directory that I create! This can be duplicated if I am user "root"
>or user "ast".  "root" cannot remove directories with 777 protection!
>My umask for "root" is 0000.  The umask for "ast" is "0022".

>What's going on here?

>PS:  If I am "ast" and create a directory, then "su" to root, "root"
>     cannot remove a 777 directory owned by "ast"!!  I've tried rmdir
>     and "rm -rf".

(Your directories are empty, aren't they?)

I encountered the same problem in upgrading from minix-st 1.1 -> 1.5.0 -> 1.5.10.

Using the 1.5.10 version of the appropriate programs solved the problem.

Klamer
-- 
Klamer Schutte
Faculty of electrical engineering -- University of Twente, The Netherlands
klamer@mi.eltn.utwente.nl	{backbone}!mcsun!mi.eltn.utwente.nl!klamer