From: David Mulder Date: Thu, 27 Aug 2020 20:22:34 +0000 (-0600) Subject: samba-tool: Create unix user with modified template homedir X-Git-Tag: talloc-2.3.2~660 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07ce48088824bba2054e029edfa6fbae972c1921;p=thirdparty%2Fsamba.git samba-tool: Create unix user with modified template homedir Signed-off-by: David Mulder Reviewed-by: Jeremy Allison --- diff --git a/python/samba/netcmd/user.py b/python/samba/netcmd/user.py index 95c21f52a04..b76d55b7d40 100644 --- a/python/samba/netcmd/user.py +++ b/python/samba/netcmd/user.py @@ -3006,11 +3006,12 @@ The users gecos field will be set to 'User4 test' res = samdb.search(searchdn, scope=ldb.SCOPE_SUBTREE, expression=filter) - unix_domain = res[0]["nETBIOSName"][0] + unix_domain = res[0]["nETBIOSName"][0].decode() except IndexError: raise CommandError('Unable to find Unix domain') - unix_home = "/home/{0}/{1}".format(unix_domain, username) + tmpl = lp.get('template homedir') + unix_home = tmpl.replace('%D', unix_domain).replace('%U', username) if not lp.get("idmap_ldb:use rfc2307"): self.outf.write("You are setting a Unix/RFC2307 UID & GID. " diff --git a/selftest/knownfail.d/samba-tool b/selftest/knownfail.d/samba-tool deleted file mode 100644 index 9f922a18dc4..00000000000 --- a/selftest/knownfail.d/samba-tool +++ /dev/null @@ -1 +0,0 @@ -samba.tests.samba_tool.user.samba.tests.samba_tool.user.UserCmdTestCase