Bug 196390

Summary: [makefs] when using METALOG, multiple file entries with the same leaf file name result in incorrect permissions
Product: Base System Reporter: Adrian Chadd <adrian>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Unable to Reproduce    
Severity: Affects Only Me CC: emaste
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240619

Description Adrian Chadd freebsd_committer freebsd_triage 2014-12-30 22:02:35 UTC
Hi,

When using makefs with METALOG, I've noticed that things like 'passwd' aren't set suid.

I found that this in METALOG:

. type=dir uname=root gname=wheel mode=0755
./etc type=dir uname=root gname=wheel mode=0755
./sbin type=dir uname=root gname=wheel mode=0755
./usr type=dir uname=root gname=wheel mode=0755
./usr/bin type=dir uname=root gname=wheel mode=0755
./usr/bin/passwd type=file uname=root gname=wheel mode=04555 size=7000
./etc/passwd type=file mode=0644 uname=root gname=wheel

.. results in /usr/bin/passwd being not setuid.

But:

. type=dir uname=root gname=wheel mode=0755
./etc type=dir uname=root gname=wheel mode=0755
./sbin type=dir uname=root gname=wheel mode=0755
./usr type=dir uname=root gname=wheel mode=0755
./usr/bin type=dir uname=root gname=wheel mode=0755
./etc/passwd type=file mode=0644 uname=root gname=wheel
./usr/bin/passwd type=file uname=root gname=wheel mode=04555 size=7000

.. results in /usr/bin/passwd being setuid.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2019-09-16 21:12:24 UTC
Not reproducible on -current at r348071.