svn commit: samba r5264 - branches/SAMBA_3_0/source/auth branches/SAMBA_3_0/source/groupdb branches/SAMBA_3_0/source/rpc_server branches/SAMBA_3_0/source/utils trunk/source/auth trunk/source/groupdb trunk/source/rpc_server trunk/source/utils

gd at samba.org gd at samba.org
Mon Feb 7 18:20:07 GMT 2005


Author: gd
Date: 2005-02-07 18:20:06 +0000 (Mon, 07 Feb 2005)
New Revision: 5264

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5264

Log:
Log with loglevel 0 when account-administration scripts fail.

Guenther

Modified:
   branches/SAMBA_3_0/source/auth/auth_util.c
   branches/SAMBA_3_0/source/groupdb/mapping.c
   branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c
   branches/SAMBA_3_0/source/utils/net_rpc_samsync.c
   trunk/source/auth/auth_util.c
   trunk/source/groupdb/mapping.c
   trunk/source/rpc_server/srv_samr_nt.c
   trunk/source/utils/net_rpc_samsync.c


Changeset:
Modified: branches/SAMBA_3_0/source/auth/auth_util.c
===================================================================
--- branches/SAMBA_3_0/source/auth/auth_util.c	2005-02-07 15:35:42 UTC (rev 5263)
+++ branches/SAMBA_3_0/source/auth/auth_util.c	2005-02-07 18:20:06 UTC (rev 5264)
@@ -50,7 +50,7 @@
 	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;
 }
 

Modified: branches/SAMBA_3_0/source/groupdb/mapping.c
===================================================================
--- branches/SAMBA_3_0/source/groupdb/mapping.c	2005-02-07 15:35:42 UTC (rev 5263)
+++ branches/SAMBA_3_0/source/groupdb/mapping.c	2005-02-07 18:20:06 UTC (rev 5264)
@@ -975,7 +975,7 @@
 		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 @@
 		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 @@
 		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 @@
 		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 @@
 		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;
 	}
 	

Modified: branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c	2005-02-07 15:35:42 UTC (rev 5263)
+++ branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c	2005-02-07 18:20:06 UTC (rev 5264)
@@ -2305,7 +2305,7 @@
 			
   			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 @@
 		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;
 }

Modified: branches/SAMBA_3_0/source/utils/net_rpc_samsync.c
===================================================================
--- branches/SAMBA_3_0/source/utils/net_rpc_samsync.c	2005-02-07 15:35:42 UTC (rev 5263)
+++ branches/SAMBA_3_0/source/utils/net_rpc_samsync.c	2005-02-07 18:20:06 UTC (rev 5264)
@@ -523,7 +523,7 @@
 			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"));

Modified: trunk/source/auth/auth_util.c
===================================================================
--- trunk/source/auth/auth_util.c	2005-02-07 15:35:42 UTC (rev 5263)
+++ trunk/source/auth/auth_util.c	2005-02-07 18:20:06 UTC (rev 5264)
@@ -50,7 +50,7 @@
 	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;
 }
 

Modified: trunk/source/groupdb/mapping.c
===================================================================
--- trunk/source/groupdb/mapping.c	2005-02-07 15:35:42 UTC (rev 5263)
+++ trunk/source/groupdb/mapping.c	2005-02-07 18:20:06 UTC (rev 5264)
@@ -974,7 +974,7 @@
 		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;
 			
@@ -1021,7 +1021,7 @@
 		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;
 	}
 
@@ -1049,7 +1049,7 @@
 		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;
 	}
@@ -1081,7 +1081,7 @@
 		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;
 	}
 	
@@ -1112,7 +1112,7 @@
 		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;
 	}
 	

Modified: trunk/source/rpc_server/srv_samr_nt.c
===================================================================
--- trunk/source/rpc_server/srv_samr_nt.c	2005-02-07 15:35:42 UTC (rev 5263)
+++ trunk/source/rpc_server/srv_samr_nt.c	2005-02-07 18:20:06 UTC (rev 5264)
@@ -2416,7 +2416,7 @@
 			
   			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 */
 		{
@@ -3870,7 +3870,7 @@
 		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;
 }

Modified: trunk/source/utils/net_rpc_samsync.c
===================================================================
--- trunk/source/utils/net_rpc_samsync.c	2005-02-07 15:35:42 UTC (rev 5263)
+++ trunk/source/utils/net_rpc_samsync.c	2005-02-07 18:20:06 UTC (rev 5264)
@@ -523,7 +523,7 @@
 			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"));



More information about the samba-cvs mailing list