PATCH 1/1: Expose remote_password_change() via libsmbclient

Guenther Deschner gd at
Wed Mar 16 11:21:23 MDT 2011

Hi Eduardo,

On 03/16/2011 05:27 PM, Eduardo Kienetz wrote:
> Hello guys,
> I'm submitting attached a patch I've created so that I could access
> remote_password_change() from PHP through libsmbclient-php, which I
> now 'maintain'.
> It was created due to a real necessity, not just to add yet another
> function to libsmbclient. Tested from PHP and it works (password gets
> changed).
> In case the attachment is removed it can be seen via
> Comments appreciated as I'm not a really experienced C developer
> (although this one seemed trivial just by following the examples).
> Thanks in advance for your time!

Hm, I would much rather prefer if we flesh out the already existing 
NetUserChangePassword() call from which provides almost 
exactly the same semantics. From netapi.h:

  * NetUserChangePassword
  * @brief Change the password for a user on a given server or in a 
given domain
  * @param[in] domain_name The server or domain name to connect to
  * @param[in] user_name The user account to change the password for
  * @param[in] old_password The user account's old password
  * @param[in] new_password The user account's new password
  * @return NET_API_STATUS
  * example user/user_chgpwd.c

NET_API_STATUS NetUserChangePassword(const char * domain_name /* [in] */,
                                      const char * user_name /* [in] */,
                                      const char * old_password /* [in] */,
                                      const char * new_password /* [in] */);

Currently that call is not working though, but that is something we can 
certainly fix short term. Would that work as well for you ?


Günther Deschner                    GPG-ID: 8EE11688
Red Hat                         gdeschner at
Samba Team                              gd at

More information about the samba-technical mailing list