net: Fix sam addgroupmem
authorVolker Lendecke <vl@samba.org>
Tue, 13 Jan 2015 11:51:13 +0000 (12:51 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 13 Jan 2015 14:28:16 +0000 (15:28 +0100)
Domain local groups come across as SID_TYPE_ALIAS and are sent to us in the
PAC/Info3 struct. We should allow this in net sam addgroupmem.

Volker

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Jan 13 15:28:16 CET 2015 on sn-devel-104

source3/utils/net_sam.c

index 2ee9a91b704238e10713b1d9641481800f1d20c2..f1cb0a4167b2572ae635d4c8758117e4f4e755a2 100644 (file)
@@ -1220,10 +1220,12 @@ static int net_sam_addmem(struct net_context *c, int argc, const char **argv)
 
        if ((grouptype == SID_NAME_ALIAS) || (grouptype == SID_NAME_WKN_GRP)) {
                if ((membertype != SID_NAME_USER) &&
+                   (membertype != SID_NAME_ALIAS) &&
                    (membertype != SID_NAME_DOM_GRP)) {
-                       d_fprintf(stderr, _("%s is a local group, only users "
-                                 "and domain groups can be added.\n"
-                                 "%s is a %s\n"), argv[0], argv[1],
+                       d_fprintf(stderr, _("Can't add %s: only users, domain "
+                                           "groups and domain local groups "
+                                           "can be added. %s is a %s\n"),
+                                 argv[0], argv[1],
                                  sid_type_lookup(membertype));
                        return -1;
                }