Gentoo Archives: gentoo-user

From: JimD <Jim@×××××××××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] User mounting
Date: Thu, 16 Mar 2006 21:33:48
Message-Id: 20060316162849.00f264c6@keelie.localdomain
In Reply to: Re: [gentoo-user] User mounting by Mike Williams
1 On Thu, 16 Mar 2006 21:08:29 +0000
2 Mike Williams <mike@××××××××.uk> wrote:
3
4 > It's the user option.
5 > user lets any normal user mount it, but no-one else unmount it.
6 > users does the same, but lets a normal user other than the one which
7 > mounted it, to unmount it.
8 >
9 > man mount
10 > for more info.
11
12 The problem is that I cannot even *mount* it as a regular user.
13
14 jim@keelie $ mount /mnt/kaleb/
15 mount error: permission denied or not superuser and mount.cifs not
16 installed SUID
17
18 mount.cifs is SUID:
19
20 jim@keelie $ ls -l /usr/bin/mount.cifs
21 -rws--x--x 1 root root 21232 Mar 10 12:14 /usr/bin/mount.cifs
22
23
24 Running strace on the mount command like so:
25 strace mount /mnt/kaleb/ &> trace.txt
26
27 Gives me this at the end of the output:
28
29 readlink("/mnt", 0xbf95d3e0, 4096) = -1 EINVAL (Invalid argument)
30 readlink("/mnt/kaleb", 0xbf95d3e0, 4096) = -1 EINVAL (Invalid argument)
31 umask(077) = 02
32 open("/etc/fstab", O_RDONLY|O_LARGEFILE) = 3
33 umask(02) = 077
34 fstat64(3, {st_mode=S_IFREG|0644, st_size=454, ...}) = 0
35 mmap2(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
36 -1, 0) = 0xb7dee000 read(3, "/dev/hda1\t/\t\t\treiserfs\tnotail,no"...,
37 131072) = 454 read(3, "", 131072) = 0
38 close(3) = 0
39 munmap(0xb7dee000, 131072) = 0
40 stat64("/sbin/mount.cifs", {st_mode=S_IFREG|S_ISUID|0755,
41 st_size=21232, ...}) = 0 clone(mount error: permission denied or not
42 superuser and mount.cifs not installed SUID child_stack=0,
43 flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
44 child_tidptr=0xb7e0e708) = 23707 --- SIGCHLD (Child exited) @ 0 (0) ---
45 wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 255}], 0, NULL) = 23707
46 exit_group(255) = ?
47
48
49 The interesting part is where stat64 is called on /sbin/mount.cifs.
50 /sbin/mount.cifs is a symlink to ../usr/bin/mount.cifs. Maybe mount
51 thinks that /sbin/mount.cifs is not SUID even though where it points to
52 is SUID?
53
54 Jim
55 --
56 gentoo-user@g.o mailing list