Remote password change function in libsmbclient

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Mar 9 02:20:56 MST 2011

On Tue, Mar 08, 2011 at 05:09:39PM -0600, Eduardo Kienetz wrote:
> Guys, I have this libsmbclient-php
> (, and I want to add
> support for password changes (initially remote passwords, because
> that's what I need right now). Since libsmbclient does not offer any
> password change function (as far as I've looked at libsmbclient.h), I
> looked around and found that I should use remote_password_change()
> from source3/libsmb/passchange.c (which is ultimately what smbpasswd
> uses).
> I have changed libsmbclient.syms to have remote_password_change (as a
> proof of concept, I'll put it in awk script after I'm done testing),
> added it to libsmbclient.h and it gets compiled. Yet I wanted to make
> sure what return type NTSTATUS is, since all other libsmbclient.h
> functions have clear return types (to me, as I'm not a really
> experienced C developer). Naturally I'm gonna need the return type to
> handle errors properly, etc.
> So far I've seen source3/include/module.h with: typedef NTSTATUS
> (init_module_function) (void);
> What does that do / how does it work?

NTSTATUS is our internal error code, defined in

Exposing NTSTATUS at the libsmbclient layer is the
wrong approach. What needs doing is a separate function in
the same style as smbc_open() and smbc_close(), hiding the
NTSTATUS behind an abstraction layer.

With best regards,

Volker Lendecke

SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen

More information about the samba-technical mailing list