[Samba] samba-tool user syncpasswords crashes with python3
Heinz Hölzl
heinz.hoelzl at gvcc.net
Fri Oct 4 11:03:52 UTC 2019
Hi,
i sync the passwords from samba to other backends using "samba-tool
user syncpasswords"
On my operative system (samba 4.10 and python2) all works fine.
I upgraded my test-DC to samba 4.11 and python3 and now the samba-tool
user syncpasswords --daemon crashes.
Fri Oct 4 12:29:47 2019: pid[983]: Attached to
logfile[/usr/local/samba/var/log.syncpw]
Fri Oct 4 12:29:47 2019: pid[983]: Using
cache_ldb[/usr/local/samba/private/user-syncpasswords-cache.ldb]
Fri Oct 4 12:29:47 2019: pid[985]: Daemonized as pid 985 (from 983)
Fri Oct 4 12:29:47 2019: pid[985]: Using
cache_ldb[/usr/local/samba/private/user-syncpasswords-cache.ldb]
Fri Oct 4 12:29:47 2019: pid[985]: currentPid: 985
Fri Oct 4 12:29:47 2019: pid[985]: Wait before connect - sleep(1)
Fri Oct 4 12:29:48 2019: pid[985]: Connecting to
'ldapi:///usr/local/samba/private/ldap_priv/ldapi'
Fri Oct 4 12:29:48 2019: pid[985]: Resuming monitoring
dirsyncFilter:
(&(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=512)(!(
sAMAccountName=krbtgt*)))
dirsyncControls: ['dirsync:1:0:0', 'extended_dn:1:0']
syncCommand: /usr/local/bin/syncpw.py
Fri Oct 4 12:29:52 2019: pid[985]: dirsync_loop(): results 15220
Fri Oct 4 12:29:52 2019: pid[985]: # Dirsync[0] 7d1b0000-b7f7-4fda-
8479-b5cb70a01030 S-1-5-21-1608159440-4144762864-1017073214-15729
dn: <GUID=7d1b0000-b7f7-4fda-8479-b5cb70a01030>;<SID=S-1-5-21-
1608159440-4144762864-1017073214-
15729>;CN=gorkon_klingons,OU=Users,OU=klingons,OU=Organizations,DC=xxx,
xx=net
pwdLastSet: 132112663830494760
userPrincipalName: gorkon_klingons at klingons.imp
sAMAccountName: gorkon_klingons
userAccountControl: 512
objectGUID: 7d1b0000-b7f7-4fda-8479-b5cb70a01030
instanceType: 4
# unicodePwd::: REDACTED SECRET ATTRIBUTE
# supplementalCredentials::: REDACTED SECRET ATTRIBUTE
Fri Oct 4 12:29:52 2019: pid[985]: # Passwords[0] 7d1b0000-b7f7-4fda-
8479-b5cb70a01030 S-1-5-21-1608159440-4144762864-1017073214-15729
# attrs=['dn', 'mail', 'objectGUID', 'objectSid', 'proxyAddresses',
'pwdLastSet', 'sAMAccountName', 'userAccountControl',
'virtualClearTextUTF8']
Fri Oct 4 12:29:52 2019: pid[985]: Call
Popen[/usr/local/bin/syncpw.py] for
CN=gorkon_klingons,OU=Users,OU=klingons,OU=Organizations,DC=xxxx,DC=xxx
ERROR(<class 'TypeError'>): uncaught exception - memoryview: a bytes-
like object is required, not 'str'
File "/usr/local/samba/lib/python3.6/site-
packages/samba/netcmd/__init__.py", line 186, in _run
return self.run(*args, **kwargs)
File "/usr/local/samba/lib/python3.6/site-
packages/samba/netcmd/user.py", line 2368, in run
sync_loop(wait)
File "/usr/local/samba/lib/python3.6/site-
packages/samba/netcmd/user.py", line 2257, in sync_loop
dirsync_loop()
File "/usr/local/samba/lib/python3.6/site-
packages/samba/netcmd/user.py", line 2234, in dirsync_loop
handle_object(ri, r)
File "/usr/local/samba/lib/python3.6/site-
packages/samba/netcmd/user.py", line 2043, in handle_object
run_sync_command(obj.dn, ldif)
File "/usr/local/samba/lib/python3.6/site-
packages/samba/netcmd/user.py", line 2001, in run_sync_command
reply = bytes(sync_command_p.communicate(input)[0], encoding =
'utf-8')
File "/usr/lib/python3.6/subprocess.py", line 863, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.6/subprocess.py", line 1519, in _communicate
input_view = memoryview(self._input)
~
my setup:
samba-tool user syncpasswords --cache-ldb-initialize --
attributes=virtualClearTextUTF8,objectGUID,objectSID,sAMAccountName,use
rPrincipalName,userAccountControl,pwdLastSet,mail,proxyAddresses --
decrypt-samba-gpg --script=/usr/local/bin/syncpw.py
samba-tool user syncpasswords --daemon --
logfile=/usr/local/samba/var/log.syncpw
regards,
heinz
More information about the samba
mailing list