Date: Mon, 8 Aug 2011 00:55:15 +0930 (CST) From: J R M <freebsd@eliti.st> To: FreeBSD-gnats-submit@FreeBSD.org Subject: conf/159586: mergemaster -p breaks /etc/group when /usr/src/etc/group is 0600 Message-ID: <201108071525.p77FPFjs026778@inferno.darktide.net> Resent-Message-ID: <201108071600.p77G0UVA081108@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 159586 >Category: conf >Synopsis: mergemaster -p breaks /etc/group when /usr/src/etc/group is 0600 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Aug 07 16:00:30 UTC 2011 >Closed-Date: >Last-Modified: >Originator: J R M >Release: FreeBSD 8.0-RELEASE-p2 i386 >Organization: n/a >Environment: System: FreeBSD inferno 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan 5 16:02:27 UTC 2010 root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386 >Description: When performing a 'mergemaster -p' as part of an upgrade, and merging the /etc/group file, when it installs the file it breaks the permissions on /etc/group to 0600 when the /usr/src/etc/group file is set to 0600 from what I can tell. This is irrespective of the umask set by the user. On my systems I've always kept /usr/src to 077 during cvsup. This has never been a problem in the past and I've been using these same permissions on /usr/src since 3.x days -- This only seems to have cropped up in 8.x. Running mergemaster -x, I can see the following: + [ -n /etc -a ! -d /etc ] + find_mode ./etc/group + local OCTAL + echo 'obase=10; ibase=8; 022' + bc + stat -f %OMp%OLp ./etc/group + bc + echo 'obase=10; ibase=8; 0600' + OCTAL=384 + printf '%04o\n' 384 + FILE_MODE=0600 + [ ! -x ./etc/group ] + do_install_and_rm 0600 ./etc/group /etc + [ ! -d /etc/group ] + install -m 0600 ./etc/group /etc + unlink ./etc/group + return 0 + echo ' *** Merged version of ./etc/group installed successfully' The permissions on /var/tmp/temproot/etc/group and group.merged stay at 0600 and this seems to pass through to /etc when the install takes place. This seems to be a bug to me. Other configuration files seem to install perfectly without any issue with their individual permissions. >How-To-Repeat: Set /usr/src/etc/group to 0600 permissions. Run 'mergemaster -p' ensuring that the installed /etc/group file differs sufficiently from /usr/src/etc/group. Hit 'install' or 'merge' to merge the file. The file will be installed with 0600 permissions. This works perfectly when /usr/src/etc/group has 0644 permissions - but this situation cannot be guaranteed - and has never been required in the past (nor is a requirement for other files). I suspect this problem also affects /etc/master.passwd but because this file should be 0600, it is not noticed. Note: if you mergemaster the entire tree during a regular mergemaster, the permissions on /etc/group are handled correctly. >Fix: Modify mergemaster to properly handle the permissions on /etc/group during 'mergemaster -p' as it does other files during a regular mermgemaster >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108071525.p77FPFjs026778>