On Thu, Dec 17, 1998 at 10:54:59AM -0600, Marcelo E. Magallon wrote: > On Thu, Dec 17, 1998 at 08:41:54AM -0800, Oscar Levi wrote: > > > I'd let this drop, but I think I'm gonna learn somthing. > > > > How is it that you created files owned by root without ever changing > > your uid to root? > > > > fakeroot chown root.root FILENAME > > > > doesn't do it, right? > > No, it doesn't. But it does what you need. Try this: > > $ fakeroot bash > $ whoami > $ ls -l > $ rm /etc/passwd (don't try rm -rf /, you'll get a nasty surprise) > $ passwd root > $ exit > > read fakeroot(1)
I read it before I made any posts. Maybe you should read it again because the documentation is vague. It says: DESCRIPTION fakeroot runs a command in an environment were it appears to have root privileges for file manipulation. This is ... fakeroot works by replacing the file manipulation library functions (chmod(2), stat(2) etc.) by ones that simulate the effect the real library functions would have had, had the user really been root. These wrapper functions are in These statements are not very accurate. Had I 'really been root', the files owned by user joe would still be owned by user joe. It would be more clear to say: fakeroot simulates root priviledges by replacing instances of the user's real id with root id such that files owned by the user before running fakeroot appear to be owned by root while running fakeroot. Ho hum. I now see the utility of fakeroot.