Subject: Re: "make install" owerwrites files without asking
To: Jeremy C. Reed <reed@reedmedia.net>
From: Pavel Cahyna <pcah8322@artax.karlin.mff.cuni.cz>
List: tech-pkg
Date: 06/30/2005 19:16:34
On Thu, Jun 30, 2005 at 10:08:44AM -0700, Jeremy C. Reed wrote:
> > I don't understand how I should do the steps as a non-root user (you mean
> > outside the fakeroot environment?)
> 
> Do the fakeroot. Then maybe do a su to switch to a non-privileged user. Or
> run your fakeroot as non-root in the first place if it allows you.
> 
> Or did you run fakeroot as a non-root user in the first place?

You mean the user that I was before starting fakeroot? Yes, I'm not root
on this machine, as indicated by the dollar prompt:

$ fakeroot
...

> If so, I am curious: how does fakeroot keep track of what ownerships are
> on files (since they aren't recorded in the filesystem metadata itself
> since chown can't work as non-root in the first place).
> 
> So for an example, please do:
> 
> ls -l somefile
> id
> fakeroot
> id
> chown otheruser somefile
> ls -l somefile
> exit # exit the fakeroot
> ls -l somefile

pcah8322@artax:~$ touch somefile
pcah8322@artax:~$ ls -l somefile 
-rw-r--r--    1 pcah8322 users           0 Jun 30 19:12 somefile
pcah8322@artax:~$ id
uid=18322(pcah8322) gid=100(users) groups=100(users)
pcah8322@artax:~$ fakeroot
bash-2.05a# id
uid=0(root) gid=0(root) groups=100(users)
bash-2.05a# chown daemon somefile 
bash-2.05a# ls -l somefile
-rw-r--r--    1 daemon   root            0 Jun 30 19:12 somefile
bash-2.05a# exit
pcah8322@artax:~$ ls -l somefile 
-rw-r--r--    1 pcah8322 users           0 Jun 30 19:12 somefile
pcah8322@artax:~$

Please IM me as pc@njs.netlab.cz or ICQ 219248907 if you have further
questions.

Bye	Pavel