Bug 14231 - Samba user password synchronization hook unusable because python type error
Summary: Samba user password synchronization hook unusable because python type error
Status: RESOLVED DUPLICATE of bug 14154
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Python (show other bugs)
Version: 4.11.1
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Douglas Bagnall
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-07 11:53 UTC by Torsten Fohrer
Modified: 2020-01-08 20:07 UTC (History)
0 users

See Also:


Attachments
Adding text=True to popen call (1.09 KB, patch)
2020-01-07 11:53 UTC, Torsten Fohrer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Torsten Fohrer 2020-01-07 11:53:23 UTC
Created attachment 15722 [details]
Adding text=True to popen call

Setting up user password synchronization hook and running it results in following error stacktrace. Adding argument "text=true" to Popen call resolves it:

Jan 07 11:42:42 samba4-dc1 systemd[1]: Started Samba user password synchronization hook.
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: ERROR(<class 'TypeError'>): uncaught exception - memoryview: a bytes-like object is required, not 'str'
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:   File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 186, in _run
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:     return self.run(*args, **kwargs)
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:   File "/usr/lib/python3/dist-packages/samba/netcmd/user.py", line 2368, in run
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:     sync_loop(wait)
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:   File "/usr/lib/python3/dist-packages/samba/netcmd/user.py", line 2257, in sync_loop
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:     dirsync_loop()
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:   File "/usr/lib/python3/dist-packages/samba/netcmd/user.py", line 2234, in dirsync_loop
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:     handle_object(ri, r)
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:   File "/usr/lib/python3/dist-packages/samba/netcmd/user.py", line 2043, in handle_object
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:     run_sync_command(obj.dn, ldif)
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:   File "/usr/lib/python3/dist-packages/samba/netcmd/user.py", line 2001, in run_sync_command
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:     reply = sync_command_p.communicate(input)[0]
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:   File "/usr/lib/python3.7/subprocess.py", line 964, in communicate
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:     stdout, stderr = self._communicate(input, endtime, timeout)
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:   File "/usr/lib/python3.7/subprocess.py", line 1695, in _communicate
Jan 07 11:42:43 samba4-dc1 samba-tool[7474]:     input_view = memoryview(self._input)
Comment 1 Björn Jacke 2020-01-08 20:07:39 UTC

*** This bug has been marked as a duplicate of bug 14154 ***