summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_sam.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c
index 4d3102b51f..06fc73da4b 100644
--- a/source3/utils/net_sam.c
+++ b/source3/utils/net_sam.c
@@ -580,7 +580,7 @@ static int net_sam_deletelocalgroup(int argc, const char **argv)
DOM_SID sid;
enum lsa_SidType type;
const char *dom, *name;
- int ret;
+ NTSTATUS status;
if (argc != 1) {
d_fprintf(stderr, "usage: net sam deletelocalgroup <name>\n");
@@ -589,7 +589,7 @@ static int net_sam_deletelocalgroup(int argc, const char **argv)
if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_ISOLATED,
&dom, &name, &sid, &type)) {
- d_fprintf(stderr, "Could not find name %s.\n", argv[0]);
+ d_fprintf(stderr, "Could not find %s.\n", argv[0]);
return -1;
}
@@ -599,12 +599,13 @@ static int net_sam_deletelocalgroup(int argc, const char **argv)
return -1;
}
- ret = pdb_delete_alias(&sid);
+ status = pdb_delete_alias(&sid);
- if ( !ret ) {
- d_fprintf(stderr, "Could not delete local group %s.\n", argv[0]);
- return -1;
- }
+ if (!NT_STATUS_IS_OK(status)) {
+ d_fprintf(stderr, "Deleting local group %s failed with %s\n",
+ argv[0], nt_errstr(status));
+ return -1;
+ }
d_printf("Deleted local group %s.\n", argv[0]);