summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDavid Mulder <dmulder@suse.com>2020-08-27 14:22:34 -0600
committerJeremy Allison <jra@samba.org>2020-09-02 09:11:29 +0000
commit07ce48088824bba2054e029edfa6fbae972c1921 (patch)
tree4b6cffd05b138db1c79146cb0646d36a16875080 /python
parent38fcad60a8ea80bda70a82a3c7f9bf50a9754a8e (diff)
downloadsamba-07ce48088824bba2054e029edfa6fbae972c1921.tar.gz
samba-tool: Create unix user with modified template homedir
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'python')
-rw-r--r--python/samba/netcmd/user.py5
1 files changed, 3 insertions, 2 deletions
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. "