Re: fakeroot inquiry
On Fri, May 03, 2002 at 09:13:57AM -0400, Roland McGrath wrote:
> The unimplemented functions are the sysvipc interfaces (msgsnd/msgrcv et
> al). They're not implemented. They would not be real hard to implement
> and I won't get into to how to implement them, but there is almost never
> any worthwhile reason to be using them and so will probably never implement
> them. So one thing you could do is implement some of all that. But...
I have never seen the ipc itnerface used elsewhere, but the shm and
semaphores are used by some other big projects (like postgresql and gimp).
> So, following the described behavior of fakeroot, I whipped up a translator
> to do approximately the same thing. I've checked the new file
> trans/fakeroot.c into hurd cvs with code that I have compiled but not
> tested at all.
I gave it a quick test. netfs_node_norefs is called with the node locked,
so I changed it to unlock the node. I am not sure if libnetfs should
instead be changed to unlock the node itself, but anyway this thought
occured to me only after checking the change in. With this change, it seems
to work (but I only tried one chown, so no extensive tests).
2002-05-03 Marcus Brinkmann <email@example.com>
* fakeroot.c (netfs_node_norefs): Unlock node after not dropping
it at all.
It would be nice if someone else could test it with many files, and changing
> The "fakeroot" purpose of building packages just wants to fake attributes
> long enough to have tar read them back that way. This feature is useful
> for things other than that, such as making filesystem images to put onto
> floppy or use for direct disk copy (i.e. used on ext2fs when you plan to
> keep the resulting ext2fs image), or unrelated purposes like mapping users'
> local IDs to an NFS server's uncorrelated ID space.
> For building packages, you could just use a tmpfs with uid-mapping.
> $ settrans -ca my-pkg /hurd/tmpfs --map-uid=`whoami`:root
> $ make install prefix=my-pkg
> $ tar cf my-pkg.tar my-pkg
> $ settrans -g my-pkg
> $ rm -f my-pkg
One problem in the context of Debian packaging is that some files want to be
owned by other user and/or groups than root, for example news/news, or
things like that.
> Note also, this all is only the filesystem part of what fakeroot does.
> fakeroot also fakes out getuid and so forth so that e.g. `whoami' says
And in fact, this is necessary, because Debian packages check for that
specifically. It's a bit silly, because you don't really need to be root to
change files to root on the Hurd (in particular with things like filesystem
hacks), but it's in 4000 packages and impossible to change anytime soon.
(Of course people could just change the PATH and add a whoami dummy).
> Again, the Hurd can do it better. The obvious thing is to
> interpose on the auth port, so it authenticates to servers as the normal
> user, but reports to the user himself that he is root to reinforce his
> delusions of grandeur. I haven't written that program yet, but it's easy.
Yes, I think that would one of the cleaner way to do it.
`Rhubarb is no Egyptian god.' Debian http://www.debian.org firstname.lastname@example.org
Marcus Brinkmann GNU http://www.gnu.org email@example.com
To UNSUBSCRIBE, email to firstname.lastname@example.org
with a subject of "unsubscribe". Trouble? Contact email@example.com