Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 152173 Details for
Bug 235915
sudo can't always correctly determine group membership
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
use getgrouplist() if all else fails
sudo-1.6.8p12-getgrouplist.patch (text/plain), 2.31 KB, created by
Nalin Dahyabhai
on 2007-04-10 19:21:42 UTC
(
hide
)
Description:
use getgrouplist() if all else fails
Filename:
MIME Type:
Creator:
Nalin Dahyabhai
Created:
2007-04-10 19:21:42 UTC
Size:
2.31 KB
patch
obsolete
>Use getgrouplist(), if available, to check for group membership. If a name >service is in use which stores group membership in a location or form which >is not readily parsed into a gr_mem list, using getgrouplist() may be the >only viable way to determine if the user is in the specified group. > >--- sudo-1.6.8p12/configure.in 2007-04-10 14:09:10.000000000 -0400 >+++ sudo-1.6.8p12/configure.in 2007-04-10 14:09:18.000000000 -0400 >@@ -1694,7 +1694,7 @@ > dnl Function checks > dnl > AC_CHECK_FUNCS(strchr strrchr memchr memcpy memset sysconf tzset \ >- strftime setrlimit initgroups fstat gettimeofday) >+ strftime setrlimit initgroups getgrouplist fstat gettimeofday) > AC_CHECK_FUNCS(seteuid, , [AC_DEFINE(NO_SAVED_IDS)]) > if test -z "$SKIP_SETRESUID"; then > AC_CHECK_FUNCS(setresuid, [SKIP_SETREUID=yes]) >--- sudo-1.6.8p12/check.c 2005-03-24 20:55:31.000000000 -0500 >+++ sudo-1.6.8p12/check.c 2007-04-10 14:13:54.000000000 -0400 >@@ -299,6 +299,24 @@ > return(TRUE); > } > >+#ifdef HAVE_GETGROUPLIST >+ { >+ gid_t *grouplist, grouptmp; >+ int n_groups, i; >+ n_groups = 1; >+ if (getgrouplist(user_name, user_gid, &grouptmp, &n_groups) == -1) { >+ grouplist = (gid_t *) emalloc(sizeof(gid_t) * (n_groups + 1)); >+ if (getgrouplist(user_name, user_gid, grouplist, &n_groups) > 0) >+ for (i = 0; i < n_groups; i++) >+ if (grouplist[i] == grp->gr_gid) { >+ free(grouplist); >+ return(TRUE); >+ } >+ free(grouplist); >+ } >+ } >+#endif >+ > return(FALSE); > } > >--- sudo-1.6.8p12/config.h.in 2004-11-25 12:31:54.000000000 -0500 >+++ sudo-1.6.8p12/config.h.in 2007-04-10 14:23:42.000000000 -0400 >@@ -122,6 +122,9 @@ > /* Define to 1 if you have the `getdomainname' function. */ > #undef HAVE_GETDOMAINNAME > >+/* Define to 1 if you have the `getgrouplist' function. */ >+#undef HAVE_GETGROUPLIST >+ > /* Define to 1 if you have the `getifaddrs' function. */ > #undef HAVE_GETIFADDRS > >--- sudo-1.6.8p12/configure 2007-04-10 15:01:47.000000000 -0400 >+++ sudo-1.6.8p12/configure 2007-04-10 15:01:50.000000000 -0400 >@@ -24677,7 +24677,7 @@ > > > for ac_func in strchr strrchr memchr memcpy memset sysconf tzset \ >- strftime setrlimit initgroups fstat gettimeofday >+ strftime setrlimit initgroups getgrouplist fstat gettimeofday > do > as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` > echo "$as_me:$LINENO: checking for $ac_func" >&5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 235915
: 152173