]> granicus.if.org Git - sudo/commitdiff
In array_to_member_list() use the correct type for netgroups and
authorTodd C. Miller <Todd.Miller@sudo.ws>
Thu, 22 Feb 2018 04:09:57 +0000 (21:09 -0700)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Thu, 22 Feb 2018 04:09:57 +0000 (21:09 -0700)
user groups.

plugins/sudoers/ldap_common.c

index 2fdebcb435da14417624a3dd81ef78be69b2a989..097568b1309d0b7b3fe91349beb4c0a9cb4bd783 100644 (file)
@@ -136,6 +136,22 @@ array_to_member_list(void *a, sudo_ldap_iter_t iter)
            /* Empty RunAsUser means run as the invoking user. */
            m->type = MYSELF;
            break;
+       case '+':
+           m->type = NETGROUP;
+           m->name = strdup(val);
+           if (m->name == NULL) {
+               free(m);
+               goto bad;
+           }
+           break;
+       case '%':
+           m->type = USERGROUP;
+           m->name = strdup(val);
+           if (m->name == NULL) {
+               free(m);
+               goto bad;
+           }
+           break;
        case 'A':
            if (strcmp(val, "ALL") == 0) {
                m->type = ALL;