summaryrefslogtreecommitdiff
path: root/source3/utils/net_sam.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-05-09 11:39:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:21:55 -0500
commit16ae8eff937c1344192a3afa84ff1eb14de5d46d (patch)
tree4915e8c90f33050071091879a8ec77d3ae828f54 /source3/utils/net_sam.c
parent1e6e3f82798d31bc7f5d33d84b5413c4d7f91e97 (diff)
downloadsamba-16ae8eff937c1344192a3afa84ff1eb14de5d46d.tar.gz
samba-16ae8eff937c1344192a3afa84ff1eb14de5d46d.tar.bz2
samba-16ae8eff937c1344192a3afa84ff1eb14de5d46d.zip
r22766: Merge from 3_0:
r22412 | obnox | 2007-04-20 14:23:36 +0200 (Fr, 20 Apr 2007) | 5 lines Add a "deletelocalgroup" subcommand to net sam. Thanks to Karolin Seeger <ks@sernet.de>. (This used to be commit fb6ac8a5b247a961963a9b6a95cd6608c5b53d09)
Diffstat (limited to 'source3/utils/net_sam.c')
-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]);