From: Todd C. Miller Date: Fri, 1 Dec 2017 19:58:37 +0000 (-0700) Subject: Add debug printfs around group list retrieval. X-Git-Tag: SUDO_1_8_22^2~58 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4168668f5356b0ed6f330a59de019c28ff3664ac;p=sudo Add debug printfs around group list retrieval. --- diff --git a/src/sudo.c b/src/sudo.c index 2d516fde9..bde103b1d 100644 --- a/src/sudo.c +++ b/src/sudo.c @@ -421,6 +421,15 @@ fill_group_list(struct user_details *ud, int system_maxgroups) #endif /* HAVE_GETGROUPLIST_2 */ } done: + if (ret == -1) { + sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_ERRNO, + "%s: %s: unable to get groups via getgrouplist()", + __func__, ud->username); + } else { + sudo_debug_printf(SUDO_DEBUG_INFO, + "%s: %s: got %d groups via getgrouplist()", + __func__, ud->username, ud->ngroups); + } debug_return_int(ret); } @@ -446,8 +455,15 @@ get_user_groups(struct user_details *ud) if (ud->groups == NULL) goto oom; if (getgroups(ud->ngroups, ud->groups) < 0) { + sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_ERRNO, + "%s: %s: unable to get %d groups via getgroups()", + __func__, ud->username, ud->ngroups); free(ud->groups); ud->groups = NULL; + } else { + sudo_debug_printf(SUDO_DEBUG_INFO, + "%s: %s: got %d groups via getgroups()", + __func__, ud->username, ud->ngroups); } } }