Blame SOURCES/0001-The-scheduler-now-uses-the-getgrouplist-function-whe.patch

d905e8
diff -up cups-1.6.3/config.h.in.getgrouplist cups-1.6.3/config.h.in
d905e8
--- cups-1.6.3/config.h.in.getgrouplist	2019-02-06 17:51:23.338680247 +0100
d905e8
+++ cups-1.6.3/config.h.in	2019-02-06 17:51:23.388679840 +0100
d905e8
@@ -550,6 +550,13 @@
d905e8
 
d905e8
 
d905e8
 /*
d905e8
+ * Do we have the getgrouplist() function?
d905e8
+ */
d905e8
+
d905e8
+#undef HAVE_GETGROUPLIST
d905e8
+ 
d905e8
+
d905e8
+/*
d905e8
  * Do we have OS X 10.4's mbr_XXX functions?
d905e8
  */
d905e8
 
d905e8
diff -up cups-1.6.3/config-scripts/cups-common.m4.getgrouplist cups-1.6.3/config-scripts/cups-common.m4
d905e8
--- cups-1.6.3/config-scripts/cups-common.m4.getgrouplist	2019-02-06 17:51:23.387679848 +0100
d905e8
+++ cups-1.6.3/config-scripts/cups-common.m4	2019-02-06 17:52:42.256037532 +0100
d905e8
@@ -202,6 +202,9 @@ AC_CHECK_FUNCS(sigaction)
d905e8
 dnl Checks for wait functions.
d905e8
 AC_CHECK_FUNCS(waitpid wait3)
d905e8
 
d905e8
+dnl Check for getgrouplist
d905e8
+AC_CHECK_FUNCS(getgrouplist)
d905e8
+
d905e8
 dnl See if the tm structure has the tm_gmtoff member...
d905e8
 AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
d905e8
 AC_TRY_COMPILE([#include <time.h>],[struct tm t;
d905e8
diff -up cups-1.6.3/configure.getgrouplist cups-1.6.3/configure
d905e8
--- cups-1.6.3/configure.getgrouplist	2013-07-11 23:13:11.000000000 +0200
d905e8
+++ cups-1.6.3/configure	2019-02-06 17:51:23.391679815 +0100
d905e8
@@ -5155,6 +5155,18 @@ fi
d905e8
 done
d905e8
 
d905e8
 
d905e8
+for ac_func in getgrouplist
d905e8
+do :
d905e8
+  ac_fn_c_check_func "$LINENO" "getgrouplist" "ac_cv_func_getgrouplist"
d905e8
+if test "x$ac_cv_func_getgrouplist" = xyes; then :
d905e8
+  cat >>confdefs.h <<_ACEOF
d905e8
+#define HAVE_GETGROUPLIST 1
d905e8
+_ACEOF
d905e8
+
d905e8
+fi
d905e8
+done
d905e8
+
d905e8
+
d905e8
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tm_gmtoff member in tm structure" >&5
d905e8
 $as_echo_n "checking for tm_gmtoff member in tm structure... " >&6; }
d905e8
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
d905e8
diff -up cups-1.6.3/scheduler/auth.c.getgrouplist cups-1.6.3/scheduler/auth.c
d905e8
--- cups-1.6.3/scheduler/auth.c.getgrouplist	2019-02-06 17:51:23.003682975 +0100
d905e8
+++ cups-1.6.3/scheduler/auth.c	2019-02-06 17:51:23.391679815 +0100
d905e8
@@ -1489,6 +1489,21 @@ cupsdCheckGroup(
d905e8
     * Group exists, check it...
d905e8
     */
d905e8
 
d905e8
+#ifdef HAVE_GETGROUPLIST
d905e8
+    if (user)
d905e8
+    {
d905e8
+      int	ngroups;		/* Number of groups */
d905e8
+      gid_t	groups[2048];		/* Groups that user belongs to */
d905e8
+
d905e8
+      ngroups = (int)(sizeof(groups) / sizeof(groups[0]));
d905e8
+      getgrouplist(username, user->pw_gid, groups, &ngroups);
d905e8
+
d905e8
+      for (i = 0; i < ngroups; i ++)
d905e8
+        if (group->gr_gid == groups[i])
d905e8
+	  return (1);
d905e8
+    }
d905e8
+#endif /* HAVE_GETGROUPLIST */
d905e8
+
d905e8
     for (i = 0; group->gr_mem[i]; i ++)
d905e8
       if (!_cups_strcasecmp(username, group->gr_mem[i]))
d905e8
 	return (1);
d905e8
diff -up cups-1.6.3/vcnet/config.h.getgrouplist cups-1.6.3/vcnet/config.h
d905e8
--- cups-1.6.3/vcnet/config.h.getgrouplist	2013-06-07 03:12:52.000000000 +0200
d905e8
+++ cups-1.6.3/vcnet/config.h	2019-02-06 17:51:23.392679807 +0100
d905e8
@@ -599,6 +599,13 @@
d905e8
 
d905e8
 
d905e8
 /*
d905e8
+ * Do we have the getgrouplist() function?
d905e8
+ */
d905e8
+
d905e8
+#undef HAVE_GETGROUPLIST
d905e8
+
d905e8
+
d905e8
+/*
d905e8
  * Do we have OS X 10.4's mbr_XXX functions?
d905e8
  */
d905e8
 
d905e8
diff -up cups-1.6.3/xcode/config.h.getgrouplist cups-1.6.3/xcode/config.h
d905e8
--- cups-1.6.3/xcode/config.h.getgrouplist	2019-02-06 17:51:23.392679807 +0100
d905e8
+++ cups-1.6.3/xcode/config.h	2019-02-06 17:53:54.616448200 +0100
d905e8
@@ -536,6 +536,13 @@
d905e8
 
d905e8
 
d905e8
 /*
d905e8
+ * Do we have the getgrouplist() function?
d905e8
+ */
d905e8
+
d905e8
+#define HAVE_GETGROUPLIST 1
d905e8
+ 
d905e8
+
d905e8
+/*
d905e8
  * Do we have OS X 10.4's mbr_XXX functions?
d905e8
  */
d905e8