smbfs and setuid in 5.3
Wiktor Niesiobedzki
bsd at w.evip.pl
Wed Dec 1 13:48:19 PST 2004
On Wed, Dec 01, 2004 at 02:28:37PM -0600, animecowboy at animecowboy.com wrote:
> > Try to use the -u and -g switches to mount_smbfs to specify the user
> > that should access the mounted file system.
> >
> > harti
> >
>
> The base directory was already set to the user/group I wanted, makeing the
> defaults to -u -g what I wanted. So as an experiement I set the base dir to
> root:wheel, and used the -u -g attribs.
>
I can easily reproduce that:
Amnesiac# mkdir /testmount
Amnesiac# chown w /testmount
Amnesiac# chmod 700 /testmount
Amnesiac# mount_smbfs //w at portal/share /testmount
Password:
Amnesiac# ls /testmount
.snap bea oracle
Amnesiac# ls /testmount/.snap
Amnesiac# su - w
w at Amnesiac:~$ ls /testmount
ls: testmount: Permission denied
w at Amnesiac:~$
I think that smbfs is the only FS that does not change the mountpoint access
mode, what may I expose a more global problem. But quickly scanning the
sourcecode, I still cannot find the source of the problem.
And one question arising:
w at Amnesiac:~$ kdump| grep -c NAMI
11
w at Amnesiac:~$ ktrace -t n ls /testmount >/dev/null 2>/dev/null
w at Amnesiac:~$ kdump| grep -c NAMI
18
Where from this change of calls to NAMI stems? The second output has follwing
lines more (at the end of execution):
1750 ls NAMI "/etc/malloc.conf"
1750 ls NAMI "/testmount"
1750 ls NAMI "."
1750 ls NAMI "/testmount"
1750 ls NAMI "/testmount"
1750 ls NAMI "/testmount"
1750 ls NAMI "/testmount"
Cheers,
Wiktor Niesiobedzki
More information about the freebsd-current
mailing list