[comp.sys.sgi] Question about mv and su in 3.3.1

manson@bullet.ecf.toronto.edu (Bob Manson) (12/12/90)

If I use su to become root while in my home directory, and I mv a file
to /tmp, for example, who should own the file?  Me, or root?   Under 
3.2 I think that root would have been the owner(I don't remember, 
could someone still running 3.2 please check?).  Anyway, under 3.3.1, I 
retain ownership of the file.

Has this been "fixed"?  Is this a bug or a feature?


					Bob Manson
					manson@civ.toronto.edu

operator@IRIS.KTH.DK (Martin Liversage) (12/13/90)

In <1990Dec11.190615.3551@bullet.ecf.toronto.edu> Bob Manson
<ucsd.edu!usc!cs.utexas.edu!news-server.csri.toronto.edu!me!ecf!news-server.ecf!manson>
writes:

> If I use su to become root while in my home directory, and I mv a file
> to /tmp, for example, who should own the file?  Me, or root?   Under 
> 3.2 I think that root would have been the owner(I don't remember, 
> could someone still running 3.2 please check?).  Anyway, under 3.3.1, I 
> retain ownership of the file.

I run 3.2 and I have checked. You are right in your assumptions. When
root does a mv on a file, she becomes the owner.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\                                                                             \
\ Martin Liversage                      8616 m  /\                            \
\ Royal Dental College Copenhagen              /  \_   K2 - Mountain of Fate  \
\ Department of Pediatric Dentistry           / \   \       and Dreams        \
\ Norre Alle 20                              /   | | \                        \
\ DK-2200 Kobenhavn N                      /\    |  \ \                       \
\ +45 31 37 17 00 - 4276                  /  \ ^     | \                      \
\                                                                             \
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

eastick@me.utoronto.ca (Doug Eastick) (12/16/90)

manson@bullet.ecf.toronto.edu (Bob Manson) writes:
>If I use su to become root while in my home directory, and I mv a file
>to /tmp, for example, who should own the file?  Me, or root?   Under 

Depending if you do a "su" or "su -" you will get different results.
The latter effectively performs the same stuff a "login root" would
do.  The "su" only changes some minor things.

Homework:
	% pwd
	/foo/bar
	% su
	% id
	uid=<non-zero> gid=<something>
	% pwd
	/foo/bar
	% ^D

	% pwd
	/foo/bar
	% su -
	# pwd
	/
	# id
	uid=0(root) gid=<something>
	# ^D
	% pwd
	/foo/bar

I tend to use "su" only when I need to read certain files.  I use "su
-" for more major work.