Problem with SAMR pipe (ChangePassword() Python binding)

Andrew Bartlett abartlet at
Fri Aug 14 02:47:04 MDT 2009

On Wed, 2009-08-12 at 17:15 +0300, Zahari Zahariev wrote:
> Hello Samba4,
> I am preparing a Python binding for the samr_ChangePassword() function. 
> It took quite a while (usual reasons no know-how), but finally Andrew 
> helped me out by taking a 'magic look' and refactoring py_net_join() in 
> samba4/libbet/py_net.c.
> I copied the same approach to passing credentials along but then I 
> bumped across another error:
> python lib/ldb/tests/python/ <Windows_2003_AD_IP> 
> -UAdministrator%old123@
> test: test_samr (__main__.SamrTests)
> baseDN: DC=zahari,DC=tk
> ['ChangePassword', 'Join', '__doc__', '__file__', '__name__']
> Unable to setup messaging listener for 
> '/usr/local/samba/private/smbd.tmp/messaging/msg.0.193676647.0':NT_STATUS_OBJECT_NAME_NOT_FOUND
> error: test_samr (__main__.SamrTests) [
> Traceback (most recent call last):
>   File "lib/ldb/tests/python/", line 79, in test_samr
>     newpassword="samba123@", level=1, credentials=creds)
> RuntimeError: Connection to SAMR pipe of PDC of domain 'ZAHARI' failed: 
> ]

The way you need to debug this is with gdb on the python script:

gdb --args python lib/ldb/tests/python/ <hostname>

break libnet_ChangePassword

This will break you into the C code, and you can go from there.  Be
warned however that I've tried

Also confirm first that 'net password change' to the same server works,
and look carefully (ie, in gdb) at the parameters that is passes to
libnet_ChangePassword compared to what you supply.

I hope this helps,

Andrew Bartlett

Andrew Bartlett
Authentication Developer, Samba Team 
Samba Developer, Cisco Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the samba-technical mailing list