pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/security/polkit polkit: Fix build on SunOS.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a1d3b73ad740
branches:  trunk
changeset: 307831:a1d3b73ad740
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Mon May 14 09:30:35 2018 +0000
description:
polkit: Fix build on SunOS.

diffstat:

 security/polkit/distinfo                                                     |   4 +-
 security/polkit/patches/patch-src_polkit_polkitunixprocess.c                 |  18 +++
 security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.cpp |  54 ++++++++++
 3 files changed, 75 insertions(+), 1 deletions(-)

diffs (97 lines):

diff -r d24009f8aef1 -r a1d3b73ad740 security/polkit/distinfo
--- a/security/polkit/distinfo  Mon May 14 09:13:26 2018 +0000
+++ b/security/polkit/distinfo  Mon May 14 09:30:35 2018 +0000
@@ -1,10 +1,12 @@
-$NetBSD: distinfo,v 1.5 2018/04/29 05:14:36 wiz Exp $
+$NetBSD: distinfo,v 1.6 2018/05/14 09:30:35 jperkin Exp $
 
 SHA1 (polkit-0.114.tar.gz) = f29deef0076e76588f209a028a3e33ef70c2d9cd
 RMD160 (polkit-0.114.tar.gz) = 000749a5f902b9be347f462d486bed20f8bbe8d5
 SHA512 (polkit-0.114.tar.gz) = 49cdf9dd3663714b1c6569ad8740cb413d9c5bd5c11e4bdbba3ce82b744f36638b652547edff9203caab9287834bc68a1d6a4895ec7a188fa1524dc1e9c9b4ea
 Size (polkit-0.114.tar.gz) = 1557340 bytes
+SHA1 (patch-src_polkit_polkitunixprocess.c) = 8a709f90dca2143765e4a3388dc736bc72292add
 SHA1 (patch-src_polkitbackend_polkitbackendinteractiveauthority.c) = dd91b4e74e6c39f24e0f5a9b3150fdac12899cb5
+SHA1 (patch-src_polkitbackend_polkitbackendjsauthority.cpp) = 43e8ec118601e978435d66ba805c35bc3db24b17
 SHA1 (patch-src_polkitbackend_polkitd.c) = b8e11b40e2b171d4f030eb4c4cbc6fdc7a96b2c2
 SHA1 (patch-src_programs_pkexec.c) = bfc0414c7a943c8e8b8412566a2519198eab8abd
 SHA1 (patch-src_programs_pkttyagent.c) = 4dbffd02c7e66910d4104a75d6f5f437bd51acc9
diff -r d24009f8aef1 -r a1d3b73ad740 security/polkit/patches/patch-src_polkit_polkitunixprocess.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/polkit/patches/patch-src_polkit_polkitunixprocess.c      Mon May 14 09:30:35 2018 +0000
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.4 2018/05/14 09:30:35 jperkin Exp $
+
+Fix SunOS includes.
+
+--- src/polkit/polkitunixprocess.c.orig        2018-03-23 15:09:30.000000000 +0000
++++ src/polkit/polkitunixprocess.c
+@@ -24,6 +24,11 @@
+ #endif
+ 
+ #include <sys/types.h>
++#ifdef HAVE_SOLARIS
++#include <sys/stat.h>
++#include <fcntl.h>
++#include <procfs.h>
++#endif
+ #ifdef HAVE_FREEBSD
+ #include <sys/param.h>
+ #include <sys/sysctl.h>
diff -r d24009f8aef1 -r a1d3b73ad740 security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.cpp      Mon May 14 09:30:35 2018 +0000
@@ -0,0 +1,54 @@
+$NetBSD: patch-src_polkitbackend_polkitbackendjsauthority.cpp,v 1.1 2018/05/14 09:30:35 jperkin Exp $
+
+Provide getgrouplist for SunOS.  This is available in newer Solaris,
+so if that becomes a problem we'll need to add a configure test.
+
+--- src/polkitbackend/polkitbackendjsauthority.cpp.orig        2018-04-03 18:16:49.000000000 +0000
++++ src/polkitbackend/polkitbackendjsauthority.cpp
+@@ -55,6 +55,46 @@
+ #error "This code is not safe in SpiderMonkey exact stack rooting configurations"
+ #endif
+ 
++#ifdef __sun
++int
++getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt)
++{
++      const struct group *grp;
++      int i, maxgroups, ngroups, ret;
++
++      ret = 0;
++      ngroups = 0;
++      maxgroups = *grpcnt;
++      groups ? groups[ngroups++] = agroup : ngroups++;
++      if (maxgroups > 1)
++              groups ? groups[ngroups++] = agroup : ngroups++;
++      setgrent();
++      while ((grp = getgrent()) != NULL) {
++              if (groups) {
++                      for (i = 0; i < ngroups; i++) {
++                              if (grp->gr_gid == groups[i])
++                                      goto skip;
++                      }
++              }
++              for (i = 0; grp->gr_mem[i]; i++) {
++                      if (!strcmp(grp->gr_mem[i], uname)) {
++                              if (ngroups >= maxgroups) {
++                                      ret = -1;
++                                      break;
++                              }
++                              groups ? groups[ngroups++] = grp->gr_gid : ngroups++;
++                              break;
++                      }
++              }
++skip:
++              ;
++      }
++      endgrent();
++      *grpcnt = ngroups;
++      return (ret);
++}
++#endif
++
+ /**
+  * SECTION:polkitbackendjsauthority
+  * @title: PolkitBackendJsAuthority



Home | Main Index | Thread Index | Old Index