[TAG] Mounting a Samba share
Jay R. Ashworth
jra at baylink.com
Tue Nov 22 20:07:48 MSK 2005
On Sun, Nov 20, 2005 at 06:56:16PM -0500, Benjamin A. Okopnik wrote:
> > [pete at localhost src]$ ./mount-cifs
> > >>mount: only root can mount //192.168.16.3/Trinsite on
> > >>/home/pete/Desktop/LisaTrinsite
> > >>Mount failed!
> > >>: Success
> > >>[pete at localhost src]$
>
> Hmmm. I've just tried it myself, and got much the same result - not sure
> why, since SUID binaries seem to work just fine for other stuff.
>
> Well, let's take a different tack: I've found this on the Web, which
> seems to do just the kind of thing you want (and is an "official"
> program rather than a quick hack, above - but don't let it out of your
> hands, because an SUID 'mount' can be a Bad Thing indeed!):
>
> http://us2.samba.org/samba/ftp/cifs-cvs/mount.cifs.c
>
> As to the other thing - Gang, any idea why a system() call in an SUID(0)
> binary fail to execute as root? This program works fine:
I'm fairly sure that's mount(8) enforcing a policy restriction, though
I don't have the code handy either: some programs required that the UID
(not just the EUID) be 0 or they won't do their work.
Cheers,
-- jra
--
Jay R. Ashworth jra at baylink.com
Designer Baylink RFC 2100
Ashworth & Associates The Things I Think '87 e24
St Petersburg FL USA http://baylink.pitas.com +1 727 647 1274
"Space is called 'space' because there's so much *space* there."
- John Walker, of Fourmilab, on Trek's End
More information about the TAG
mailing list