r5264: Log with loglevel 0 when account-administration scripts fail.
authorGünther Deschner <gd@samba.org>
Mon, 7 Feb 2005 18:20:06 +0000 (18:20 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:55:35 +0000 (10:55 -0500)
Guenther
(This used to be commit 3d391ef149639750db376b05528a27422f8a3321)

source3/auth/auth_util.c
source3/groupdb/mapping.c
source3/rpc_server/srv_samr_nt.c
source3/utils/net_rpc_samsync.c

index 4a23ec8adc5a1e595215d1aef6faf2eb5716d1a6..30902a8dad6e443460af67bbb70f3c9641c1fa21 100644 (file)
@@ -50,7 +50,7 @@ static int smb_create_user(const char *domain, const char *unix_username, const
        if (homedir)
                all_string_sub(add_script, "%H", homedir, sizeof(pstring));
        ret = smbrun(add_script,NULL);
-       DEBUG(3,("smb_create_user: Running the command `%s' gave %d\n",add_script,ret));
+       DEBUG(ret ? 0 : 3,("smb_create_user: Running the command `%s' gave %d\n",add_script,ret));
        return ret;
 }
 
index e574a7cf204a74cb65f02ab1b31d05c8d2af6dba..1c29cc77c42a3241f978e7ffcfe472637b7f716b 100644 (file)
@@ -975,7 +975,7 @@ int smb_create_group(char *unix_group, gid_t *new_gid)
                pstrcpy(add_script, lp_addgroup_script());
                pstring_sub(add_script, "%g", unix_group);
                ret = smbrun(add_script, (new_gid!=NULL) ? &fd : NULL);
-               DEBUG(3,("smb_create_group: Running the command `%s' gave %d\n",add_script,ret));
+               DEBUG(ret ? 0 : 3,("smb_create_group: Running the command `%s' gave %d\n",add_script,ret));
                if (ret != 0)
                        return ret;
                        
@@ -1022,7 +1022,7 @@ int smb_delete_group(char *unix_group)
                pstrcpy(del_script, lp_delgroup_script());
                pstring_sub(del_script, "%g", unix_group);
                ret = smbrun(del_script,NULL);
-               DEBUG(3,("smb_delete_group: Running the command `%s' gave %d\n",del_script,ret));
+               DEBUG(ret ? 0 : 3,("smb_delete_group: Running the command `%s' gave %d\n",del_script,ret));
                return ret;
        }
 
@@ -1050,7 +1050,7 @@ int smb_set_primary_group(const char *unix_group, const char* unix_user)
                all_string_sub(add_script, "%g", unix_group, sizeof(add_script));
                all_string_sub(add_script, "%u", unix_user, sizeof(add_script));
                ret = smbrun(add_script,NULL);
-               DEBUG(3,("smb_set_primary_group: "
+               DEBUG(ret ? 0 : 3,("smb_set_primary_group: "
                         "Running the command `%s' gave %d\n",add_script,ret));
                return ret;
        }
@@ -1082,7 +1082,7 @@ int smb_add_user_group(char *unix_group, char *unix_user)
                pstring_sub(add_script, "%g", unix_group);
                pstring_sub(add_script, "%u", unix_user);
                ret = smbrun(add_script,NULL);
-               DEBUG(3,("smb_add_user_group: Running the command `%s' gave %d\n",add_script,ret));
+               DEBUG(ret ? 0 : 3,("smb_add_user_group: Running the command `%s' gave %d\n",add_script,ret));
                return ret;
        }
        
@@ -1113,7 +1113,7 @@ int smb_delete_user_group(const char *unix_group, const char *unix_user)
                pstring_sub(del_script, "%g", unix_group);
                pstring_sub(del_script, "%u", unix_user);
                ret = smbrun(del_script,NULL);
-               DEBUG(3,("smb_delete_user_group: Running the command `%s' gave %d\n",del_script,ret));
+               DEBUG(ret ? 0 : 3,("smb_delete_user_group: Running the command `%s' gave %d\n",del_script,ret));
                return ret;
        }
        
index 4e7d239b2cf2a25909b01df6974c9b9721359aed..9c8a35045f02027cbf9c2fe8ffd374f9fe17ef4f 100644 (file)
@@ -2305,7 +2305,7 @@ NTSTATUS _samr_create_user(pipes_struct *p, SAMR_Q_CREATE_USER *q_u, SAMR_R_CREA
                        
                        all_string_sub(add_script, "%u", account, sizeof(add_script));
                        add_ret = smbrun(add_script,NULL);
-                       DEBUG(3,("_samr_create_user: Running the command `%s' gave %d\n", add_script, add_ret));
+                       DEBUG(add_ret ? 0 : 3,("_samr_create_user: Running the command `%s' gave %d\n", add_script, add_ret));
                }
                else    /* no add user script -- ask winbindd to do it */
                {
@@ -3813,7 +3813,7 @@ static int smb_delete_user(const char *unix_user)
                return -1;
        all_string_sub(del_script, "%u", unix_user, sizeof(del_script));
        ret = smbrun(del_script,NULL);
-       DEBUG(3,("smb_delete_user: Running the command `%s' gave %d\n",del_script,ret));
+       DEBUG(ret ? 0 : 3,("smb_delete_user: Running the command `%s' gave %d\n",del_script,ret));
 
        return ret;
 }
index 2db8ff054b0c38b2e3c084e2f16b18d6e937a5a1..cc81719b6ab13a424cacf0f3d13238b7cc59fb99 100644 (file)
@@ -523,7 +523,7 @@ static NTSTATUS fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
                        all_string_sub(add_script, "%u", account,
                                       sizeof(account));
                        add_ret = smbrun(add_script,NULL);
-                       DEBUG(1,("fetch_account: Running the command `%s' "
+                       DEBUG(add_ret ? 0 : 1,("fetch_account: Running the command `%s' "
                                 "gave %d\n", add_script, add_ret));
                } else {
                        DEBUG(8,("fetch_account_info: no add user/machine script.  Asking winbindd\n"));