Date: Tue, 18 Jul 1995 21:20:01 -0700 From: gordon@sneaky.lonestar.org To: freebsd-bugs Subject: bin/623: mtree(8) changes file modes and owners it shouldn't Message-ID: <199507190420.VAA02981@freefall.cdrom.com> In-Reply-To: Your message of Tue, 18 Jul 95 20:51 CDT <m0sYOI6-0001hSC@hammy.lonestar.org>
next in thread | previous in thread | raw e-mail | index | archive | help
>Number: 623 >Category: bin >Synopsis: mtree(8) changes file modes and owners it shouldn't >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs (FreeBSD bugs mailing list) >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jul 18 21:20:00 1995 >Originator: Gordon Burditt >Organization: what organization? >Release: FreeBSD 2.0-BUILT-19950603 i386 >Environment: FreeBSD 2.0.5 >Description: mtree(8) seems to change modes and owners of files not contained in the description file if files with the same last component are described elsewhere in the description. This was originally discovered when it appeared that a slightly modified BSD.local.dist and BSD.usr.dist were fighting over the permissions of /usr/local/bin when BSD.usr.dist contained no specification for them. >How-To-Repeat: % su root # cat > /tmp/mtree # This is a cut-down version of BSD.usr.dist /set type=dir uname=bin gname=bin mode=0755 . uname=root gname=wheel bin .. /set type=dir uname=bin gname=bin mode=0755 include .. /set type=dir uname=bin gname=bin mode=0775 # you can get around the problem by putting "ignore" on the local line. local mode=0775 .. .. ^D # mkdir /tmp/test # cd /tmp/test # mtree -e -U -f ../mtree -p /tmp/test (mtree creates 3 directories, bin, include, and local, as it should) # mkdir local/bin local/include local/lib local/libexec # chmod 0 local/* # chown root.wheel local/* (these 4 directories are NOT described in the mtree description) # mtree -e -U -f ../mtree -p /tmp/test local/bin: user (3, 0, modified) gid (7, 0, modified) permissions (0755, 0, modified) local/include: user (3, 0, modified) gid (7, 0, modified) permissions (0755, 0, modified) # ls -l local total 8 drwxr-xr-x 2 bin bin 512 Jul 18 20:23 bin drwxr-xr-x 2 bin bin 512 Jul 18 20:23 include d--------- 2 root wheel 512 Jul 18 20:23 lib d--------- 2 root wheel 512 Jul 18 20:23 libexec Why is it changing modes and owners on these files which have no specified permissions? It seems to be using the permissions for ./bin and ./include to change ./local/bin and ./local/include . >Fix: You can work around this by putting "ignore" on directories whose substructure you don't want changed. >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507190420.VAA02981>