summaryrefslogtreecommitdiff
path: root/source4/setup
diff options
context:
space:
mode:
Diffstat (limited to 'source4/setup')
-rwxr-xr-xsource4/setup/newuser5
1 files changed, 2 insertions, 3 deletions
diff --git a/source4/setup/newuser b/source4/setup/newuser
index e6ab4eda2b..5b677af142 100755
--- a/source4/setup/newuser
+++ b/source4/setup/newuser
@@ -15,7 +15,6 @@ import samba.getopt as options
import optparse
from getpass import getpass
from samba.auth import system_session
-from samba.samdb import SamDB
parser = optparse.OptionParser("newuser [options] <username> [<password>]")
sambaopts = options.SambaOptions(parser)
@@ -44,6 +43,6 @@ if opts.unixname is None:
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
-samdb = SamDB(url=lp.get("sam database"), session_info=system_session(),
- credentials=creds, lp=lp)
+samdb = sambaopts.get_hostconfig().get_samdb(session_info=system_session(),
+ credentials=creds)
samdb.newuser(username, opts.unixname, password)