summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-09 15:23:33 +0200
committerVolker Lendecke <vl@samba.org>2009-06-09 15:25:15 +0200
commit6545e9e2ac50fc9afeaccc1bf9965d12bb3121e6 (patch)
treed22910bd3f3d6f618d9c34c702f217d30c30ffad /source3/utils
parent54fb170689a8ee97d95faa1a32dc53aed3e5ec58 (diff)
downloadsamba-6545e9e2ac50fc9afeaccc1bf9965d12bb3121e6.tar.gz
samba-6545e9e2ac50fc9afeaccc1bf9965d12bb3121e6.tar.bz2
samba-6545e9e2ac50fc9afeaccc1bf9965d12bb3121e6.zip
Make "net sam [add|del]mem" work for domain groups
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_sam.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c
index 1919b40605..0d8b6ff482 100644
--- a/source3/utils/net_sam.c
+++ b/source3/utils/net_sam.c
@@ -1178,6 +1178,18 @@ static int net_sam_addmem(struct net_context *c, int argc, const char **argv)
"with %s\n", nt_errstr(status));
return -1;
}
+ } else if (grouptype == SID_NAME_DOM_GRP) {
+ uint32_t grouprid, memberrid;
+
+ sid_peek_rid(&group, &grouprid);
+ sid_peek_rid(&member, &memberrid);
+
+ status = pdb_add_groupmem(talloc_tos(), grouprid, memberrid);
+ if (!NT_STATUS_IS_OK(status)) {
+ d_fprintf(stderr, "Adding domain group member failed "
+ "with %s\n", nt_errstr(status));
+ return -1;
+ }
} else {
d_fprintf(stderr, "Can only add members to local groups so "
"far, %s is a %s\n", argv[0],
@@ -1233,6 +1245,18 @@ static int net_sam_delmem(struct net_context *c, int argc, const char **argv)
"with %s\n", nt_errstr(status));
return -1;
}
+ } else if (grouptype == SID_NAME_DOM_GRP) {
+ uint32_t grouprid, memberrid;
+
+ sid_peek_rid(&group, &grouprid);
+ sid_peek_rid(&member, &memberrid);
+
+ status = pdb_del_groupmem(talloc_tos(), grouprid, memberrid);
+ if (!NT_STATUS_IS_OK(status)) {
+ d_fprintf(stderr, "Deleting domain group member "
+ "failed with %s\n", nt_errstr(status));
+ return -1;
+ }
} else {
d_fprintf(stderr, "Can only delete members from local groups "
"so far, %s is a %s\n", argv[0],