From 6acbcd1b0ce6529eb381ea94573a707e677eebb4 Mon Sep 17 00:00:00 2001 From: Bjoern Baumbach Date: Tue, 7 Dec 2010 14:36:44 +0100 Subject: Make sure that user exists after running add user script before adding sam account. Autobuild-User: Michael Adam Autobuild-Date: Tue Dec 7 17:37:52 CET 2010 on sn-devel-104 --- source3/passdb/pdb_interface.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/passdb') diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index a6fe2e0408..1361c178b6 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -476,6 +476,11 @@ static NTSTATUS pdb_default_create_user(struct pdb_methods *methods, flush_pwnam_cache(); pwd = Get_Pwnam_alloc(tmp_ctx, name); + + if(pwd == NULL) { + DEBUG(3, ("Could not find user %s, add script did not work\n", name)); + return NT_STATUS_NO_SUCH_USER; + } } /* we have a valid SID coming out of this call */ -- cgit