On Mon, 2002-12-16 at 21:35, J. Grant wrote:
> Hi Dave,
> 
> I am surprised that works, here chmod +s only gives user and group +s
> so my normal user can still not run it.
> 
> Any other ideas? I could use a script, but there must be something more 
> elegant
> 
> Regards
> 
> JG

Here are the relevant permissions on /usr/bin/smb* (RedHat 8.0,
remember):
-rwsr-sr-x    1 root     root       548K Nov 20 11:18 /usr/bin/smbmnt
-rwxr-xr-x    1 root     root       558K Nov 20 11:18 /usr/bin/smbmount
-rwsr-sr-x    1 root     root       547K Nov 20 11:18 /usr/bin/smbumount

Notice that smbmount does not have the setuid ("sticky") bit set,
because it really just calls smbmnt anyway. The only one I have to
change was smbumount, the others were already set.

Now, here are my /bin/mount and /bin/umount perms:
-rwsr-xr-x    1 root     root          80K Aug 30 15:00 /bin/mount
-rwsr-xr-x    1 root     root          40K Aug 30 15:00 /bin/umount

Neither of these have been changed from their defaults. Notice that root
is both owner/user and group, as I assume they are on your Mandrake
system. But with the sticky bit set (the 'chmod +s' trick), this causes
the program to run with the permissions of the owner and/or group,
whichever bit is set. So a user can run these programs, but the program
actually runs with root authority, not just the user's authority. That's
why I said this isn't a secure solution, but it works on my single-user
laptop.

If, after trying 'chmod +s umount', you still can't use umount -- well,
I guess I really don't know why. Do you get any specific error messages,
like maybe the command 'umount' is not found? Perhaps it simply isn't in
your $PATH, but it is in root's $PATH. The error I originally got
indicated that only root had permission to smbumount network
filesystems. Thus, I fixed it by making it setuid root.

Dave

> 
> Dave Sherman wrote:
> > On Sun, 2002-12-15 at 12:07, J. Grant wrote:
> > 
> >>Hi,
> >>
> >>I'm seeing some strange effects, this has been going on for a while, but 
> >>i've not got around to asking if there is a solution, basically, even 
> >>though I have "user" in my fstab I can only unmount my cdrom as root.
> >>
> >>Any ideas or solutions?
> > 
> > 
> > I ran into a similar problem with RedHat 8.0 and Samba (couldn't unmount
> > a share as a user, even though I had mounted the share as the same
> > user), my solution was to (as root):
> >     # chmod +s /usr/bin/smbumount
> > 
> > I would think your solution would be to check /bin/mount and
> > /bin/umount, and try the same thing on umount.
> > 
> > This is not a secure solution, but it works on my (single-user) laptop.
> 
-- 
Dave Sherman
MCSE, MCSA, CCNA
"If we wanted you to understand it, we wouldn't call it code."

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to