summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorKarolin Seeger <ks@sernet.de>2007-12-27 14:08:40 +0100
committerVolker Lendecke <vl@samba.org>2007-12-28 09:44:40 +0100
commit9dfde0ebec14edc25ac79336b77c133c8319ea92 (patch)
tree022028ad2ff06343c600fcb63594132dd0e199a3 /source3/utils
parent38369ba74190259b437e9a875ac75a33d3ff3c24 (diff)
downloadsamba-9dfde0ebec14edc25ac79336b77c133c8319ea92.tar.gz
samba-9dfde0ebec14edc25ac79336b77c133c8319ea92.tar.bz2
samba-9dfde0ebec14edc25ac79336b77c133c8319ea92.zip
Improve error messages of 'net rpc user [add|delete]' commands.
Karolin (This used to be commit 4260c79bf7687bd2ebcc4ca5e0a5f020a759c1fb)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index ab0cc73e49..155cda64df 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/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;
}