diff options
author | Daniel Solano Gómez <gentoo@sattvik.com> | 2013-05-21 17:07:05 -0500 |
---|---|---|
committer | Daniel Solano Gómez <gentoo@sattvik.com> | 2013-05-21 17:07:05 -0500 |
commit | 028ea23022d19cf0b82b23282539a0a42da79ccc (patch) | |
tree | 03fcc57078ad25412196ca0d84848bbe38f76ce2 /profiles | |
parent | Add fixed version of sssd (diff) | |
download | sattvik-028ea23022d19cf0b82b23282539a0a42da79ccc.tar.gz sattvik-028ea23022d19cf0b82b23282539a0a42da79ccc.tar.bz2 sattvik-028ea23022d19cf0b82b23282539a0a42da79ccc.zip |
Add CUPS group fix patch
Diffstat (limited to 'profiles')
-rw-r--r-- | profiles/sattvik/linux/amd64/13.0/sattvik_patches/net-print/cups/cups-1.5.0-group_fix.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/profiles/sattvik/linux/amd64/13.0/sattvik_patches/net-print/cups/cups-1.5.0-group_fix.patch b/profiles/sattvik/linux/amd64/13.0/sattvik_patches/net-print/cups/cups-1.5.0-group_fix.patch new file mode 100644 index 0000000..28d3fb5 --- /dev/null +++ b/profiles/sattvik/linux/amd64/13.0/sattvik_patches/net-print/cups/cups-1.5.0-group_fix.patch @@ -0,0 +1,67 @@ +diff -Naur cups-1.5.0/scheduler/auth.c cups-1.5.0-group_fix/scheduler/auth.c +--- cups-1.5.0/scheduler/auth.c 2011-05-19 22:49:49.000000000 -0500 ++++ cups-1.5.0-group_fix/scheduler/auth.c 2011-08-23 18:13:32.000000000 -0500 +@@ -1431,6 +1431,7 @@ + const char *groupname) /* I - Group name */ + { + int i; /* Looping var */ ++ int foundit; /* Whether or not the search returned a positive result. */ + struct group *group; /* System group info */ + char junk[33]; /* MD5 password (not used) */ + #ifdef HAVE_MBR_UID_TO_UUID +@@ -1452,29 +1453,43 @@ + return (0); + + /* +- * Check to see if the user is a member of the named group... ++ * Iterate through all group entries until a match is found. + */ +- +- group = getgrnam(groupname); +- endgrent(); +- +- if (group != NULL) ++ setgrent(); ++ foundit=0; ++ while(!foundit && (group=getgrent())!=NULL) + { + /* +- * Group exists, check it... ++ * If the group name doesn't match, move on... ++ */ ++ if(_cups_strcasecmp(groupname, group->gr_name)) ++ continue; ++ ++ /* ++ * First, check to see if group ID matches the user's group ID. + */ ++ if(user && group->gr_gid == user->pw_gid) ++ { ++ foundit=1; ++ break; ++ } + ++ /* ++ * Check to see if the user is listed as a member of the group... ++ */ + for (i = 0; group->gr_mem[i]; i ++) + if (!_cups_strcasecmp(username, group->gr_mem[i])) +- return (1); ++ { ++ foundit=1; ++ break; ++ } + } ++ endgrent(); + + /* +- * Group doesn't exist or user not in group list, check the group ID +- * against the user's group ID... ++ * If the group membership was confirmed, return. + */ +- +- if (user && group && group->gr_gid == user->pw_gid) ++ if (foundit) + return (1); + + #ifdef HAVE_MBR_UID_TO_UUID |