pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

emulators/suse100_base: mtab problem under -current NetBSD/{amd64,i386}



Hi,

I just discovered that applications running under compat linux
emulation on my NetBSD -current machines cannot open `/etc/mtab'
anymore ...

 23861      1 mtab32   CALL  open(0x804853c,0,0xbfbfec78)
 23861      1 mtab32   NAMI  "/emul/linux/etc/mtab"
 23861      1 mtab32   NAMI  "/etc/mtab"
 23861      1 mtab32   RET   open -1 errno -2 No such file or directory

The main problem is that `mtab' file, installed by
`emulators/suse100_base' package, is a symlink that points to
`/usr/pkg/emul/linux/proc/mounts', outside the allowed `/emul/linux'
tree.

njoly@calamity [~]> ls -l /emul/linux/etc/mtab /usr/pkg/emul/linux/proc/mounts
lrwxr-xr-x  1 root  wheel  31 Aug 15 00:15 /emul/linux/etc/mtab -> 
/usr/pkg/emul/linux/proc/mounts
-r--r--r--  1 root  wheel   0 Oct 17 19:37 /usr/pkg/emul/linux/proc/mounts

The attached patch fix the problem by making the symlink relative
instead of absolute; but i wonder if this is correct ?

Thanks.

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.
Index: INSTALL
===================================================================
RCS file: /cvsroot/pkgsrc/emulators/suse100_base/INSTALL,v
retrieving revision 1.8
diff -u -p -r1.8 INSTALL
--- INSTALL     23 Aug 2007 21:50:23 -0000      1.8
+++ INSTALL     17 Oct 2007 17:09:09 -0000
@@ -142,7 +142,7 @@ POST-INSTALL)
 
        # Make /etc/mtab usable for Linux programs.
        ${RM} -f ${EMULDIR}/etc/mtab
-       ${LN} -fs ${EMULDIR}/proc/mounts ${EMULDIR}/etc/mtab
+       ${LN} -fs ../proc/mounts ${EMULDIR}/etc/mtab
 
        # Run any actions that require root privileges.
        ${TEST} ! -x ./+ROOT_ACTIONS ||


Home | Main Index | Thread Index | Old Index