Smbpasswd and setuid

The DJ hartman at mac.com
Sat Oct 20 05:16:04 GMT 2001


>> The application would be called by my program, in a way in which no
>> additional options other then the ones I have told my application can be
>> specified (hardcoded in program).
> 
> then why not become root in your app before running it? Or write a
> setuid wrapper?
> 
> Having the smbpasswd binary itself setuid seems unnecessary
> 

You'r thinking too much unix style now ;-)
It wouldn't be the mac way to do.

This is how it works.
I make an app. It is acompanied by an adapted version of smbpasswd which
will allow itself to run setuid. (I won't distribute it with setuid bit on
in the permissions or something). In the code I ask the system to run a
command (smbpasswd -a user) with root privs if a user presses a certain
button and if he can give the system appropriate loginname/password. If the
system can confirm this, then the SYSTEM runs the command (setuid, don't ask
me why, it's the way the API was written.) and gives back results to my app.

The only thing I'm a bit worried about is the environment variables of
libsmb. I don't exactly know how that works. Can any random user effect the
execution of smbpasswd this way? If so, then I seem to have a problem. I
would have to write my own variant of the Security API, that would simply
call sudo.

DJ
---------------------------------------------------------------------------
Universiteit Twente
---------------------------------------------------------------------------
Derk-Jan 'The DJ' Hartman
ICQnr: 10111559
Mail:  mailto:hartman at mac.com
WWW:   http://home.student.utwente.nl/d.hartman/
Goto:  http://www.student.utwente.nl/~macsatcampus





More information about the samba-technical mailing list