diff options
author | jperkin <jperkin@pkgsrc.org> | 2018-05-14 09:30:35 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2018-05-14 09:30:35 +0000 |
commit | ba605fbc4003361cda5527fd4d2cffa06eb0d523 (patch) | |
tree | c4e738e3a790d12490fbfec8cd2c61cc42901188 /security | |
parent | 5e5efbd92ffc340548f9803dbf319a0ab9f3f5b5 (diff) | |
download | pkgsrc-ba605fbc4003361cda5527fd4d2cffa06eb0d523.tar.gz |
polkit: Fix build on SunOS.
Diffstat (limited to 'security')
-rw-r--r-- | security/polkit/distinfo | 4 | ||||
-rw-r--r-- | security/polkit/patches/patch-src_polkit_polkitunixprocess.c | 18 | ||||
-rw-r--r-- | security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.cpp | 54 |
3 files changed, 75 insertions, 1 deletions
diff --git a/security/polkit/distinfo b/security/polkit/distinfo index 9a6d9d9922d..1571acc4c28 100644 --- a/security/polkit/distinfo +++ b/security/polkit/distinfo @@ -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 --git a/security/polkit/patches/patch-src_polkit_polkitunixprocess.c b/security/polkit/patches/patch-src_polkit_polkitunixprocess.c new file mode 100644 index 00000000000..3e768c24237 --- /dev/null +++ b/security/polkit/patches/patch-src_polkit_polkitunixprocess.c @@ -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 --git a/security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.cpp b/security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.cpp new file mode 100644 index 00000000000..efed5c97012 --- /dev/null +++ b/security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.cpp @@ -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 |