[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-928-g4260c79

Volker Lendecke vl at samba.org
Fri Dec 28 08:41:36 GMT 2007


The branch, v3-2-test has been updated
       via  4260c79bf7687bd2ebcc4ca5e0a5f020a759c1fb (commit)
      from  5088b704791be2f36641fa0ec59dff7f289ae868 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 4260c79bf7687bd2ebcc4ca5e0a5f020a759c1fb
Author: Karolin Seeger <ks at sernet.de>
Date:   Thu Dec 27 14:08:40 2007 +0100

    Improve error messages of 'net rpc user [add|delete]' commands.
    
    Karolin

-----------------------------------------------------------------------

Summary of changes:
 source/utils/net_rpc.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/utils/net_rpc.c b/source/utils/net_rpc.c
index ab0cc73..155cda6 100644
--- a/source/utils/net_rpc.c
+++ b/source/utils/net_rpc.c
@@ -682,10 +682,10 @@ static NTSTATUS rpc_user_add_internals(const DOM_SID *domain_sid,
 	}
  done:
 	if (!NT_STATUS_IS_OK(result)) {
-		d_fprintf(stderr, "Failed to add user %s - %s\n", acct_name, 
-			 nt_errstr(result));
+		d_fprintf(stderr, "Failed to add user '%s' with %s.\n",
+			  acct_name, nt_errstr(result));
 	} else {
-		d_printf("Added user %s\n", acct_name);
+		d_printf("Added user '%s'.\n", acct_name);
 	}
 	return result;
 }
@@ -732,12 +732,16 @@ static NTSTATUS rpc_user_del_internals(const DOM_SID *domain_sid,
 {
 	NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
 	POLICY_HND connect_pol, domain_pol, user_pol;
+	const char *acct_name;
 
 	if (argc < 1) {
 		d_printf("User must be specified\n");
 		rpc_user_usage(argc, argv);
 		return NT_STATUS_OK;
 	}
+
+	acct_name = argv[0];
+
 	/* Get sam policy and domain handles */
 
 	result = rpccli_samr_connect(pipe_hnd, mem_ctx, MAXIMUM_ALLOWED_ACCESS, 
@@ -762,7 +766,7 @@ static NTSTATUS rpc_user_del_internals(const DOM_SID *domain_sid,
 		uint32 flags = 0x000003e8; /* Unknown */
 
 		result = rpccli_samr_lookup_names(pipe_hnd, mem_ctx, &domain_pol,
-					       flags, 1, &argv[0],
+					       flags, 1, &acct_name,
 					       &num_rids, &user_rids,
 					       &name_types);
 
@@ -787,14 +791,14 @@ static NTSTATUS rpc_user_del_internals(const DOM_SID *domain_sid,
 		goto done;
 	}
 
-	/* Display results */
+ done:
 	if (!NT_STATUS_IS_OK(result)) {
-		d_fprintf(stderr, "Failed to delete user account - %s\n", nt_errstr(result));
-	} else {
-		d_printf("Deleted user account\n");
-	}
+                d_fprintf(stderr, "Failed to delete user '%s' with %s.\n",
+			  acct_name, nt_errstr(result));
+        } else {
+                d_printf("Deleted user '%s'.\n", acct_name);
+        }
 
- done:
 	return result;
 }
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list