Re: [expert] Wierd unmount only permitted as root

2002-12-17 Thread J. Grant
Hi,

Thanks for the reply.

after making it suid root it still said you need to be root to unmount 
perhaps there is something else stopping it working that we don't know. 
Strange how it works in redhat.

Regards

JG

Dave Sherman wrote:
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-x1 root root   548K Nov 20 11:18 /usr/bin/smbmnt
-rwxr-xr-x1 root root   558K Nov 20 11:18 /usr/bin/smbmount
-rwsr-sr-x1 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-x1 root root  80K Aug 30 15:00 /bin/mount
-rwsr-xr-x1 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.






Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [expert] Wierd unmount only permitted as root

2002-12-17 Thread Dave Sherman
On Tue, 2002-12-17 at 07:44, J. Grant wrote:
 Hi,
 
 Thanks for the reply.
 
 after making it suid root it still said you need to be root to unmount 
 perhaps there is something else stopping it working that we don't know. 
 Strange how it works in redhat.

How about you post the line in your /etc/fstab file? Then we can compare
it to mine or someone else's and see if there is a difference.

Here's mine:
/dev/cdrom  /mnt/cdrom iso9660 noauto,owner,kudzu,ro   0 0

-- 
Dave Sherman
MCSE, MCSA, CCNA
If we wanted you to understand it, we wouldn't call it code.



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


Re: [expert] Wierd unmount only permitted as root

2002-12-17 Thread J. Grant

This is from my desktop, i disabled supermount

/dev/scd0 /mnt/cdrom iso9660 
user,iocharset=iso8859-15,codepage=850,noauto,umask=0 0 0
/dev/hda /mnt/cdrom2 iso9660 
user,iocharset=iso8859-15,codepage=850,noauto,umask=0 0 0

from my other machine with supermount

none /mnt/cdrom supermount 
dev=/dev/hdc,fs=auto,ro,--,umask=0,codepage=850,iocharset=iso8859-15,user 
0 0

Both can only be unmounted by root normlaly. Occasionally the fomer lets 
me unmount as a normal user i think.

I just changed to users so that any user can unmount, and it works! I 
guess its because the fs was mounted by root at startup

Regards

JG



Dave Sherman wrote:
On Tue, 2002-12-17 at 07:44, J. Grant wrote:


Hi,

Thanks for the reply.

after making it suid root it still said you need to be root to unmount 
perhaps there is something else stopping it working that we don't know. 
Strange how it works in redhat.


How about you post the line in your /etc/fstab file? Then we can compare
it to mine or someone else's and see if there is a difference.

Here's mine:
/dev/cdrom  /mnt/cdrom iso9660 noauto,owner,kudzu,ro   0 0





Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [expert] Wierd unmount only permitted as root

2002-12-16 Thread J. Grant
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

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.




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Re: [expert] Wierd unmount only permitted as root

2002-12-16 Thread Dave Sherman
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-x1 root root   548K Nov 20 11:18 /usr/bin/smbmnt
-rwxr-xr-x1 root root   558K Nov 20 11:18 /usr/bin/smbmount
-rwsr-sr-x1 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-x1 root root  80K Aug 30 15:00 /bin/mount
-rwsr-xr-x1 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.



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


Re: [expert] Wierd unmount only permitted as root

2002-12-15 Thread Dave Sherman
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.



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