Hi,

i've found http://web.onda.com.br/orso/chetcpasswd.html to be very
suitable for my task. All i had to do was add a call for a shell script
to make it change linux password and samba passwort at once.

Look around line 230 in chetcpasswd.c and change to something like

if(ok) {
        sprintf(command,"cp %s %s",template,pwdfile);
        system(command);
        unlink(template);
        /*here goes code for smbpasswd*/
                sprintf(command,"/some/path/smbpass.sh %s %s %s",User,
Old_pw, New_pw1);
                system(command);      
                /*fine code*/
        sprintf(Msg,"<font color=blue size=+2>%s %s.",msg18,User);
        Hmsg(Msg, Uid, Gid);

Now compile as needed. The Shellscript needs to be suid root so be able
to change any users password.

Haven't had the time to write the shell script itself which actually
changes the smb password but should be not too hard. I figured out how
to use the -s (silent option by now though): 
echo -e "oldpass\nnewpass\nnewpass\" | smbpassword -youroptions go here
-s 

should do the trick. Hope this helps.

kind regards from Germany

Phil 

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Chris
Wong
Gesendet: Dienstag, 8. Juli 2003 07:25
An: [EMAIL PROTECTED]
Betreff: [Samba] How to change password on web?


Dear all

I've to create a webpage that let user change both
their linux & samba password.

Would you give me any resource to achieve this
requirement?

Thanks

Chris

_________________________________________________________
最新??推介:十面埋伏,千金,心淡...
http://ringtone.yahoo.com.hk
--
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba

--
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba

Reply via email to