summaryrefslogtreecommitdiff
path: root/source4/setup
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-08-01 21:12:37 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-08-01 21:12:37 +0200
commit47124efe420f4f4f08494cbb2255eacdc9625c8d (patch)
tree9c7a83f327fbe2815803e67a50f48fa08eed6011 /source4/setup
parent1c94f3e95da5b520ee631670a30f96e487f12ac8 (diff)
downloadsamba-47124efe420f4f4f08494cbb2255eacdc9625c8d.tar.gz
samba-47124efe420f4f4f08494cbb2255eacdc9625c8d.tar.bz2
samba-47124efe420f4f4f08494cbb2255eacdc9625c8d.zip
Add helper object Hostconfig to make it easier to get to e.g. the
SAM database. (This used to be commit be75b2a36ee49f66ada3ec3ababa82d74085d559)
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)