From 5a37b3fc5d42beffaf4bdca70b1f0c5f80f92280 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 14 Apr 2008 11:51:02 +0200 Subject: Fix newuser and setpassword scripts, and port to idmap. The new idmap world does not use the unixUser any more, so we need to set up the entry (if wanted) in the idmap database. Users without a backing unix user will get an allocated uid by idmap later. Andrew Bartlett (This used to be commit 8bd8bc1475ddf22d4702dcd17028a9043a5e629f) --- source4/setup/newuser | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'source4/setup/newuser') diff --git a/source4/setup/newuser b/source4/setup/newuser index f622058a5d..04a5440ee1 100755 --- a/source4/setup/newuser +++ b/source4/setup/newuser @@ -45,15 +45,9 @@ else: if opts.unixname is None: opts.unixname = username -try: - pwd.getpwnam(opts.unixname) -except KeyError: - print "ERROR: Unix user '%s' does not exist" % opts.unixname - sys.exit(1) - -creds = credopts.get_credentials() - 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.newuser(username, opts.unixname, password) -- cgit