How does 'mv' rename directories?

Conor P. Cahill cpcahil at virtech.UUCP
Sat Sep 16 00:08:22 AEST 1989


In article <4158 at buengc.BU.EDU>, bph at buengc.BU.EDU (Blair P. Houghton) writes:
> Does mv not do setuid()?  The setuid bit tells the OS to make the
> effective uid (that which is used to derive ownership) the owner of the
> program, but doesn't alter the possibility that there's a uid change in
> the program itself.

The only ids a program can setuid() to are as follows:

	1. the effective user id of the process 
	2. the real user id of the process
	3. (for system V) the "saved" user id of the process.

	The exception is if either the real user id or effective user id
	of the process is root, these limitations are rescinded

  (Sounds of digging Bach out of a back pack -- a
> Bachpach? :-S -- and rummaging around the indexed ref to setuid for
> verification, then the smell of paraphrasing fills the air) Since the
> owner of the files has placed his uid in the kernel's process table,
> the setuid() system call is free to change the effective uid to that
> one.  The process is now permitted to change your files.

I'm not sure what you are talking about, but it sounds like you are talking
about the method the kernel uses to interpret/execute the setuid-bits on
the file.  This automatically sets the effective user id and allows the program
to change it's "real" user id to match the effective user id (or to change
the effective user id back to the real user id) by using the setuid() syscall.


If you aint root, the only way to get root uid privileges is to run a
setuid-root program.
-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.unix.wizards mailing list