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 FreeBSD.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/eb8fe3490e33
branches:  trunk
changeset: 348721:eb8fe3490e33
user:      youri <youri%pkgsrc.org@localhost>
date:      Sat Jun 18 12:16:23 2016 +0000

description:
polkit: Fix build on FreeBSD.

diffstat:

 security/polkit/distinfo                                                   |  14 +-
 security/polkit/patches/patch-src_polkit_polkitunixprocess.c               |  40 +++++-----
 security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c |   6 +-
 security/polkit/patches/patch-src_programs_pkexec.c                        |   8 +-
 security/polkit/patches/patch-test_mocklib_src_netdb.c                     |  14 +-
 security/polkit/patches/patch-test_mocklibc_src_grp.c                      |   4 +-
 security/polkit/patches/patch-test_mocklibc_src_pwd.c                      |   4 +-
 7 files changed, 45 insertions(+), 45 deletions(-)

diffs (298 lines):

diff -r f834580a6fbd -r eb8fe3490e33 security/polkit/distinfo
--- a/security/polkit/distinfo  Sat Jun 18 11:38:09 2016 +0000
+++ b/security/polkit/distinfo  Sat Jun 18 12:16:23 2016 +0000
@@ -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 -r f834580a6fbd -r eb8fe3490e33 security/polkit/patches/patch-src_polkit_polkitunixprocess.c
--- a/security/polkit/patches/patch-src_polkit_polkitunixprocess.c      Sat Jun 18 11:38:09 2016 +0000
+++ b/security/polkit/patches/patch-src_polkit_polkitunixprocess.c      Sat Jun 18 12:16:23 2016 +0000
@@ -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 @@
 +#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 @@
 +#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 @@
  {
    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 @@
 @@ -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 @@
 @@ -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 @@
 -  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 @@
 +    }
 +
    start_time = (guint64) p.ki_start.tv_sec;
-
+ 
  out:
 +#elif HAVE_SOLARIS
 +  psinfo_t p;
@@ -167,7 +167,7 @@
 +#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 @@
 @@ -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 @@
 @@ -688,7 +764,23 @@ _polkit_unix_process_get_owner (PolkitUn
        goto out;
      }
-
+ 
 +#ifdef __NetBSD__
 +  result = p.p_uid;
 +#else
@@ -211,5 +211,5 @@
 +    }
 +  result = p.pr_uid;
  #else
-
+ 
    /* see 'man proc' for layout of the status file
diff -r f834580a6fbd -r eb8fe3490e33 security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c
--- a/security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c        Sat Jun 18 11:38:09 2016 +0000
+++ b/security/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c        Sat Jun 18 12:16:23 2016 +0000
@@ -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 @@
    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 -r f834580a6fbd -r eb8fe3490e33 security/polkit/patches/patch-src_programs_pkexec.c
--- a/security/polkit/patches/patch-src_programs_pkexec.c       Sat Jun 18 11:38:09 2016 +0000
+++ b/security/polkit/patches/patch-src_programs_pkexec.c       Sat Jun 18 12:16:23 2016 +0000
@@ -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 @@
    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 -r f834580a6fbd -r eb8fe3490e33 security/polkit/patches/patch-test_mocklib_src_netdb.c
--- a/security/polkit/patches/patch-test_mocklib_src_netdb.c    Sat Jun 18 11:38:09 2016 +0000
+++ b/security/polkit/patches/patch-test_mocklib_src_netdb.c    Sat Jun 18 12:16:23 2016 +0000
@@ -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 @@
    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 -r f834580a6fbd -r eb8fe3490e33 security/polkit/patches/patch-test_mocklibc_src_grp.c
--- a/security/polkit/patches/patch-test_mocklibc_src_grp.c     Sat Jun 18 11:38:09 2016 +0000
+++ b/security/polkit/patches/patch-test_mocklibc_src_grp.c     Sat Jun 18 12:16:23 2016 +0000
@@ -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 @@
  
  static FILE *global_stream = NULL;
  
-+#ifdef __NetBSD__
++#if defined(__NetBSD__) || defined(__FreeBSD__)
 +static struct group *fgetgrent(FILE *stream) {
 +  return NULL;
 +}
diff -r f834580a6fbd -r eb8fe3490e33 security/polkit/patches/patch-test_mocklibc_src_pwd.c
--- a/security/polkit/patches/patch-test_mocklibc_src_pwd.c     Sat Jun 18 11:38:09 2016 +0000
+++ b/security/polkit/patches/patch-test_mocklibc_src_pwd.c     Sat Jun 18 12:16:23 2016 +0000
@@ -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 @@
  
  static FILE *global_stream = NULL;
  
-+#ifdef __NetBSD__
++#if defined(__NetBSD__) || defined(__FreeBSD__)
 +static struct passwd *fgetpwent(FILE* stream) {
 +  return NULL;
 +}



Home | Main Index | Thread Index | Old Index