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:
parent
38fcad60a8
commit
07ce480888
@ -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. "
|
||||
|
@ -1 +0,0 @@
|
||||
samba.tests.samba_tool.user.samba.tests.samba_tool.user.UserCmdTestCase
|
Loading…
Reference in New Issue
Block a user