From a3e1f7e44d2d6a5ef801badc189b3dcf19dc72d9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 20 Sep 2006 00:15:50 +0000 Subject: r18703: Fix the annoying effect that happens when nscd is running: We usually do not get the results from user/group script modifications immediately. A lot of users do add nscd restart/refresh commands into their scripts to workaround that while we could flush the nscd caches directly using libnscd. Guenther (This used to be commit 7db6ce295afbedfada7b207ad56566d2195a0d21) --- source3/passdb/pdb_interface.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/passdb/pdb_interface.c') diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index cc05d97468..7252ea4c8c 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -366,6 +366,9 @@ static NTSTATUS pdb_default_create_user(struct pdb_methods *methods, add_ret = smbrun(add_script,NULL); DEBUG(add_ret ? 0 : 3, ("_samr_create_user: Running the command `%s' gave %d\n", add_script, add_ret)); + if (add_ret == 0) { + smb_nscd_flush_user_cache(); + } #ifdef ENABLE_BUILD_FARM_HACKS if (add_ret != 0) { @@ -443,6 +446,9 @@ static int smb_delete_user(const char *unix_user) all_string_sub(del_script, "%u", unix_user, sizeof(del_script)); ret = smbrun(del_script,NULL); flush_pwnam_cache(); + if (ret == 0) { + smb_nscd_flush_user_cache(); + } DEBUG(ret ? 0 : 3,("smb_delete_user: Running the command `%s' gave %d\n",del_script,ret)); return ret; -- cgit