I use the SU_CMD feature in make.conf to avoid compiling ports as root. If I run 'make' in misc/gnomehier, it creates an mtree file that contains my normal user and group IDs as owners for all directories in the mtree file. So when mtree is used to create the gnome hierarchy, the corresponding directories under /usr/local/ end up being owned by my normal user. This leads to various problems, including ldconfig refusing to create symlinks in /usr/local/lib. Fix: The problem is that the pre-install target creates a directory tree by simply running 'mkdir' for each directory that needs to be in the gnome hierarchy. One obvious way of trying to solve this is prefixing the mkdir commands with ${SU_CMD}. This is has a problem though: If /usr/obj is owned by a group other than wheel (say, "wobj") to allow users in that group to write to it (as on my system), the resulting mtree file will still specify a wrong group ownership (not "wheel", but "wobj" in my case). I could not find an mtree flag to override ownership information it picks up from the filesystem. Of course, more commands could added to the "mkdir loop" to ensure the ownership of all directories is set to root:wheel. But this would running 'make clean' as a normal user impossible, which is slightly annoying. So I decided to pipe mtree's output through sed instead and carry out the necessary substitutions there. This works fine for me: How-To-Repeat: As non-root user who can write to /usr/obj, run: $ echo 'SU_CMD="/usr/bin/su root -c"' >> /etc/make.conf $ cd /usr/ports/misc/gnomehier $ make clean deinstall reinstall $ head /usr/local/etc/mtree/BSD.gnome.dist The first line of the file will show your own user in uname and gname fields, even though it should be: /set type=dir uname=root gname=wheel mode=0755
Responsible Changed From-To: freebsd-ports-bugs->gnome Over to maintainer (via the GNATS Auto Assign Tool)
mezz 2007-12-11 21:22:28 UTC FreeBSD ports repository Modified files: misc/gnomehier Makefile Log: Fix the creates bad mtree file when built as non-root that will ending up the gnomehier in /usr/local/* will have the incorrect owner/group permission. PR: ports/117976 Submitted by: Stefan Sperling <stsp@stsp.name> Revision Changes Path 1.39 +3 -1 ports/misc/gnomehier/Makefile _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Committed, thanks!