diff options
author | youri <youri@pkgsrc.org> | 2016-06-18 12:16:23 +0000 |
---|---|---|
committer | youri <youri@pkgsrc.org> | 2016-06-18 12:16:23 +0000 |
commit | 7c225e32c2f5b8ddd5dd97c2dc23a42c43324189 (patch) | |
tree | df49eb3a5bb3fd83e98897224733b205b58f5447 | |
parent | 65ca16f04fe1b11805bdc1c073f09ebaf12ba60a (diff) | |
download | pkgsrc-7c225e32c2f5b8ddd5dd97c2dc23a42c43324189.tar.gz |
polkit: Fix build on FreeBSD.
7 files changed, 45 insertions, 45 deletions
diff --git a/security/polkit/distinfo b/security/polkit/distinfo index 2e6fa1da2df..d1e2a31679d 100644 --- a/security/polkit/distinfo +++ b/security/polkit/distinfo @@ -1,15 +1,15 @@ -$NetBSD: distinfo,v 1.1 2016/05/20 18:39:33 youri Exp $ +$NetBSD: distinfo,v 1.2 2016/06/18 12:16:23 youri Exp $ SHA1 (polkit-0.113.tar.gz) = ef855c2d04184dceb38e0940dc7bec9cc3da415c RMD160 (polkit-0.113.tar.gz) = 661b0a678f7c770c213404db3af604935fdb25bc SHA512 (polkit-0.113.tar.gz) = ab177c89a20eeb2978ddbe28afb205d3619f9c5defe833eb68a85e71a0f2c905367f1295cbbfb85da5eafdd661bce474d5d84aca9195cd425a18c9b4170eb5f9 Size (polkit-0.113.tar.gz) = 1448865 bytes -SHA1 (patch-src_polkit_polkitunixprocess.c) = 214541bcb012892b4fc2416897424bce8ed95518 +SHA1 (patch-src_polkit_polkitunixprocess.c) = dbfdfd441b211c80183ea5c63a20252c58a594b2 SHA1 (patch-src_polkitbackend_polkitbackendinteractiveauthority.c) = d8b7cbcd0db26969bc4b83c32a731ae920c2e87b -SHA1 (patch-src_polkitbackend_polkitbackendjsauthority.c) = 88ed2d42208743db4013399e9ece4cf24a3eaf62 +SHA1 (patch-src_polkitbackend_polkitbackendjsauthority.c) = f0771b27e192ed199c65ed7514962ec5a8cb28a4 SHA1 (patch-src_polkitbackend_polkitd.c) = a567b31131f63f92f8e2967c3aabfa7f3d41f627 -SHA1 (patch-src_programs_pkexec.c) = 2c1191d5e5246b62d7bfac144ad2f23eb122efec +SHA1 (patch-src_programs_pkexec.c) = bfc0414c7a943c8e8b8412566a2519198eab8abd SHA1 (patch-src_programs_pkttyagent.c) = 72a1c3750e6b496b981eb5479201946da80b6d15 -SHA1 (patch-test_mocklib_src_netdb.c) = 7d378cd31577c63a336bad4714ac30f87b892e6f -SHA1 (patch-test_mocklibc_src_grp.c) = 1ad61ca043e0586ded84c3157d0271a1e3af2b9e -SHA1 (patch-test_mocklibc_src_pwd.c) = 8f2b35cb90f96a115f7621a8751b9e64cba0a106 +SHA1 (patch-test_mocklib_src_netdb.c) = 5d24d5d37eabd552bc8a3cf1d6de03c6c8ffa600 +SHA1 (patch-test_mocklibc_src_grp.c) = 6e82f05c89658ed166c3752a802d4b03f1c90bcb +SHA1 (patch-test_mocklibc_src_pwd.c) = ff69388ad64f883b1bb459f198e8fc24be1089fd diff --git a/security/polkit/patches/patch-src_polkit_polkitunixprocess.c b/security/polkit/patches/patch-src_polkit_polkitunixprocess.c index c3652944abc..0e56e68b7f0 100644 --- a/security/polkit/patches/patch-src_polkit_polkitunixprocess.c +++ b/security/polkit/patches/patch-src_polkit_polkitunixprocess.c @@ -1,9 +1,9 @@ -$NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.1 2016/05/20 18:39:33 youri Exp $ +$NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.2 2016/06/18 12:16:23 youri Exp $ * NetBSD support * SunOS support ---- src/polkit/polkitunixprocess.c.orig 2014-01-14 22:42:25.000000000 +0000 +--- src/polkit/polkitunixprocess.c.orig 2014-01-14 22:42:25.000000000 +0000 +++ src/polkit/polkitunixprocess.c @@ -29,10 +29,19 @@ #include <sys/sysctl.h> @@ -22,17 +22,17 @@ $NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.1 2016/05/20 18:39:33 youri Ex +#ifdef HAVE_SOLARIS +#include <procfs.h> +#endif - + #include "polkitunixprocess.h" #include "polkitsubject.h" @@ -80,7 +89,7 @@ enum - + static void subject_iface_init (PolkitSubjectIface *subject_iface); - + -static guint64 get_start_time_for_pid (gint pid, +static guint64 get_start_time_for_pid (pid_t pid, GError **error); - + static gint _polkit_unix_process_get_owner (PolkitUnixProcess *process, @@ -89,6 +98,9 @@ static gint _polkit_unix_process_get_own #ifdef HAVE_FREEBSD @@ -41,11 +41,11 @@ $NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.1 2016/05/20 18:39:33 youri Ex +#if defined(__NetBSD__) +static gboolean get_kinfo_proc (gint pid, struct kinfo_proc2 *p); +#endif - + G_DEFINE_TYPE_WITH_CODE (PolkitUnixProcess, polkit_unix_process, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (POLKIT_TYPE_SUBJECT, subject_iface_init) @@ -514,17 +526,17 @@ subject_iface_init (PolkitSubjectIface * - + #ifdef HAVE_SOLARIS static int -get_pid_psinfo (pid_t pid, struct psinfo *ps) @@ -53,7 +53,7 @@ $NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.1 2016/05/20 18:39:33 youri Ex { char pname[32]; int procfd; - + - (void) snprintf(pname, sizeof(pname), "/proc/%d/psinfo", pid); + (void) snprintf(pname, sizeof(pname), "/proc/%lu/psinfo", pid); if ((procfd = open(pname, O_RDONLY)) == -1) @@ -68,7 +68,7 @@ $NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.1 2016/05/20 18:39:33 youri Ex @@ -554,12 +566,38 @@ get_kinfo_proc (pid_t pid, struct kinfo_ } #endif - + +#ifdef __NetBSD__ +static gboolean +get_kinfo_proc (pid_t pid, struct kinfo_proc2 *p) @@ -108,10 +108,10 @@ $NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.1 2016/05/20 18:39:33 youri Ex @@ -571,7 +609,7 @@ get_start_time_for_pid (pid_t pid, start_time = 0; contents = NULL; - + - filename = g_strdup_printf ("/proc/%d/stat", pid); + filename = g_strdup_printf ("/proc/%lu/stat", pid); - + if (!g_file_get_contents (filename, &contents, &length, error)) goto out; @@ -631,8 +669,8 @@ get_start_time_for_pid (pid_t pid, @@ -122,13 +122,13 @@ $NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.1 2016/05/20 18:39:33 youri Ex - struct kinfo_proc p; +#elif defined(__NetBSD__) + struct kinfo_proc2 p; - + start_time = 0; - + @@ -647,9 +685,43 @@ get_start_time_for_pid (pid_t pid, goto out; } - + + start_time = (guint64) p.p_ustart_sec; + +out: @@ -148,7 +148,7 @@ $NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.1 2016/05/20 18:39:33 youri Ex + } + start_time = (guint64) p.ki_start.tv_sec; - + out: +#elif HAVE_SOLARIS + psinfo_t p; @@ -167,7 +167,7 @@ $NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.1 2016/05/20 18:39:33 youri Ex +#else +#warning Your system is not supported #endif - + return start_time; @@ -664,6 +736,10 @@ _polkit_unix_process_get_owner (PolkitUn gchar **lines; @@ -183,7 +183,7 @@ $NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.1 2016/05/20 18:39:33 youri Ex @@ -676,7 +752,7 @@ _polkit_unix_process_get_owner (PolkitUn lines = NULL; contents = NULL; - + -#ifdef HAVE_FREEBSD +#if defined(HAVE_FREEBSD) || defined(__NetBSD__) if (get_kinfo_proc (process->pid, &p) == 0) @@ -192,7 +192,7 @@ $NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.1 2016/05/20 18:39:33 youri Ex @@ -688,7 +764,23 @@ _polkit_unix_process_get_owner (PolkitUn goto out; } - + +#ifdef __NetBSD__ + result = p.p_uid; +#else @@ -211,5 +211,5 @@ $NetBSD: patch-src_polkit_polkitunixprocess.c,v 1.1 2016/05/20 18:39:33 youri Ex + } + result = p.pr_uid; #else - + /* see 'man proc' for layout of the status file diff --git a/security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c b/security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c index 4a7fd77c360..182149778c4 100644 --- a/security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c +++ b/security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c @@ -1,11 +1,11 @@ -$NetBSD: patch-src_polkitbackend_polkitbackendjsauthority.c,v 1.1 2016/05/20 18:39:33 youri Exp $ +$NetBSD: patch-src_polkitbackend_polkitbackendjsauthority.c,v 1.2 2016/06/18 12:16:23 youri Exp $ * for *BSD netgroup functions * for no SIGPOLL * Fix a memory leak * Add getgrouplist for SunOS ---- src/polkitbackend/polkitbackendjsauthority.c.orig 2015-06-19 20:39:58.000000000 +0000 +--- src/polkitbackend/polkitbackendjsauthority.c.orig 2015-06-19 20:39:58.000000000 +0000 +++ src/polkitbackend/polkitbackendjsauthority.c @@ -24,7 +24,12 @@ #include <errno.h> @@ -50,7 +50,7 @@ $NetBSD: patch-src_polkitbackend_polkitbackendjsauthority.c,v 1.1 2016/05/20 18: char *netgroup; +#endif JSBool is_in_netgroup = JS_FALSE; - + if (!JS_ConvertArguments (cx, argc, JS_ARGV (cx, vp), "SS", &user_str, &netgroup_str)) @@ -1913,3 +1923,52 @@ utils_spawn_finish (GAsyncResult *res, out: diff --git a/security/polkit/patches/patch-src_programs_pkexec.c b/security/polkit/patches/patch-src_programs_pkexec.c index d4c337519fd..d853c3ff39f 100644 --- a/security/polkit/patches/patch-src_programs_pkexec.c +++ b/security/polkit/patches/patch-src_programs_pkexec.c @@ -1,12 +1,12 @@ -$NetBSD: patch-src_programs_pkexec.c,v 1.1 2016/05/20 18:39:33 youri Exp $ +$NetBSD: patch-src_programs_pkexec.c,v 1.2 2016/06/18 12:16:23 youri Exp $ Avoid conflict with SunOS function. ---- src/programs/pkexec.c.orig 2015-06-18 20:20:50.000000000 +0000 +--- src/programs/pkexec.c.orig 2015-06-18 20:20:50.000000000 +0000 +++ src/programs/pkexec.c @@ -247,7 +247,7 @@ set_close_on_exec (gint fd, } - + static gboolean -fdwalk (FdCallback callback, +gfdwalk (FdCallback callback, @@ -15,7 +15,7 @@ Avoid conflict with SunOS function. gint fd; @@ -922,7 +922,7 @@ main (int argc, char *argv[]) } - + /* set close_on_exec on all file descriptors except stdin, stdout, stderr */ - if (!fdwalk (set_close_on_exec, GINT_TO_POINTER (3))) + if (!gfdwalk (set_close_on_exec, GINT_TO_POINTER (3))) diff --git a/security/polkit/patches/patch-test_mocklib_src_netdb.c b/security/polkit/patches/patch-test_mocklib_src_netdb.c index 57dd48d5bf9..3f609a90c24 100644 --- a/security/polkit/patches/patch-test_mocklib_src_netdb.c +++ b/security/polkit/patches/patch-test_mocklib_src_netdb.c @@ -1,15 +1,15 @@ -$NetBSD: patch-test_mocklib_src_netdb.c,v 1.1 2016/05/20 18:39:33 youri Exp $ +$NetBSD: patch-test_mocklib_src_netdb.c,v 1.2 2016/06/18 12:16:23 youri Exp $ Darwin has setnetgrent. SunOS has endnetgrent. ---- test/mocklibc/src/netdb.c.orig 2014-01-14 22:42:25.000000000 +0000 +--- test/mocklibc/src/netdb.c.orig 2014-01-14 22:42:25.000000000 +0000 +++ test/mocklibc/src/netdb.c @@ -36,6 +36,7 @@ static struct netgroup_iter global_iter; - + // REMEMBER: 1 means success, 0 means failure for netgroup methods - -+#ifndef __APPLE__ + ++#if !defined(__APPLE__) && !defined(__FreeBSD__) int setnetgrent(const char *netgroup) { if (!global_netgroup_head) global_netgroup_head = netgroup_parse_all(); @@ -18,13 +18,13 @@ SunOS has endnetgrent. return 1; } +#endif - + +#ifndef __sun__ void endnetgrent(void) { netgroup_free_all(global_netgroup_head); global_netgroup_head = NULL; } +#endif - + int getnetgrent(char **host, char **user, char **domain) { if (!global_netgroup_head) diff --git a/security/polkit/patches/patch-test_mocklibc_src_grp.c b/security/polkit/patches/patch-test_mocklibc_src_grp.c index 3fc9456c729..b028d41e496 100644 --- a/security/polkit/patches/patch-test_mocklibc_src_grp.c +++ b/security/polkit/patches/patch-test_mocklibc_src_grp.c @@ -1,4 +1,4 @@ -$NetBSD: patch-test_mocklibc_src_grp.c,v 1.1 2016/05/20 18:39:33 youri Exp $ +$NetBSD: patch-test_mocklibc_src_grp.c,v 1.2 2016/06/18 12:16:23 youri Exp $ * XXX: no fgetgrent(3) @@ -8,7 +8,7 @@ $NetBSD: patch-test_mocklibc_src_grp.c,v 1.1 2016/05/20 18:39:33 youri Exp $ static FILE *global_stream = NULL; -+#ifdef __NetBSD__ ++#if defined(__NetBSD__) || defined(__FreeBSD__) +static struct group *fgetgrent(FILE *stream) { + return NULL; +} diff --git a/security/polkit/patches/patch-test_mocklibc_src_pwd.c b/security/polkit/patches/patch-test_mocklibc_src_pwd.c index e21dd7b0e45..edc7901a4b8 100644 --- a/security/polkit/patches/patch-test_mocklibc_src_pwd.c +++ b/security/polkit/patches/patch-test_mocklibc_src_pwd.c @@ -1,4 +1,4 @@ -$NetBSD: patch-test_mocklibc_src_pwd.c,v 1.1 2016/05/20 18:39:33 youri Exp $ +$NetBSD: patch-test_mocklibc_src_pwd.c,v 1.2 2016/06/18 12:16:23 youri Exp $ * XXX: no fgetpwent(3) @@ -8,7 +8,7 @@ $NetBSD: patch-test_mocklibc_src_pwd.c,v 1.1 2016/05/20 18:39:33 youri Exp $ static FILE *global_stream = NULL; -+#ifdef __NetBSD__ ++#if defined(__NetBSD__) || defined(__FreeBSD__) +static struct passwd *fgetpwent(FILE* stream) { + return NULL; +} |