1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

samba-tool: Create unix user with modified template homedir

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
David Mulder 2020-08-27 14:22:34 -06:00 committed by Jeremy Allison
parent 38fcad60a8
commit 07ce480888
2 changed files with 3 additions and 3 deletions

View File

@ -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. "

View File

@ -1 +0,0 @@
samba.tests.samba_tool.user.samba.tests.samba_tool.user.UserCmdTestCase