Subject: Archive libraries end up with incorrect permissions
To: current-users@netbsd.org <current-users@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: current-users
Date: 02/01/2002 18:03:32
If I use the METALOG generated during a build to set the permissions on
the installed files, then almost all the archive libraries end up with
600 permissions and can only be accessed by root.

(I have written a little shell script to copy all the recently build
files (from destdir) into the main filesystem after an unprivileged
build, but the same problem will happen if/when makefs understands the
METALOG file.)

share/mk/bsd.lib.mk contains:

__archiveinstall: .USE
        ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m 600 ${.ALLSRC} \
		 ${.TARGET}
        ${RANLIB} -t ${.TARGET}
        chmod ${LIBMODE} ${.TARGET}

The METALOG permissions are saved by 'install' so are always 600.

I don't know what the undocumented '-t' flag to ranlib does!
If this second ranlib call is needed, then maybe bsd.lib.mk should read:

__archiveinstall: .USE
        ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m $(LIBMODE) \
		 ${.ALLSRC} ${.TARGET}
	chmod u+w $(.TARGET)
        ${RANLIB} -t ${.TARGET}
        chmod ${LIBMODE} ${.TARGET}

	David