]> granicus.if.org Git - sudo/commitdiff
When filtering netgroups, use the passwd struct stashed in the handle,
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 3 Dec 2013 22:39:12 +0000 (15:39 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 3 Dec 2013 22:39:12 +0000 (15:39 -0700)
not user_name since we may be listing another users privileges.

plugins/sudoers/sssd.c

index 4467c0d43450e56ed5276ab44ed1e2c9a03f3cc8..d73546b121e51904ca697a1c50db586643dda6fc 100644 (file)
@@ -628,10 +628,10 @@ sudo_sss_filter_user_netgroup(struct sudo_sss_handle *handle, struct sss_sudo_ru
            netgroup_spec_found = true;
        }
        sudo_debug_printf(SUDO_DEBUG_DEBUG, "val[%d]=%s", i, val);
-       if (strcmp(val, "ALL") == 0 || netgr_matches(val, NULL, NULL, user_name)) {
+       if (strcmp(val, "ALL") == 0 || netgr_matches(val, NULL, NULL, handle->pw->pw_name)) {
            ret = true;
            sudo_debug_printf(SUDO_DEBUG_DIAG,
-               "sssd/ldap sudoUser '%s' ... MATCH! (%s)", val, user_name);
+               "sssd/ldap sudoUser '%s' ... MATCH! (%s)", val, handle->pw->pw_name);
        }
     }
     handle->fn_free_values(val_array);