[Midnightbsd-cvs] mports: policykit/files: add patches.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat May 31 12:58:41 EDT 2008


Log Message:
-----------
add patches.

Added Files:
-----------
    mports/sysutils/policykit/files:
        patch-config.h.in (r1.1)
        patch-configure (r1.1)
        patch-configure.in (r1.1)
        patch-data_Makefile.in (r1.1)
        patch-data_PolicyKit.conf.in (r1.1)
        patch-src_kit_Makefile.am (r1.1)
        patch-src_kit_Makefile.in (r1.1)
        patch-src_kit_kit-file.c (r1.1)
        patch-src_kit_kit-file.h (r1.1)
        patch-src_kit_kit-lib.c (r1.1)
        patch-src_kit_kit-lib.h (r1.1)
        patch-src_kit_kit-spawn.c (r1.1)
        patch-src_kit_kit-string.c (r1.1)
        patch-src_kit_kit.h (r1.1)
        patch-src_polkit-dbus_polkit-read-auth-helper.c (r1.1)
        patch-src_polkit-dbus_polkit-resolve-exe-helper.c (r1.1)
        patch-src_polkit-dbus_polkit-set-default-helper.c (r1.1)
        patch-src_polkit-grant_Makefile.am (r1.1)
        patch-src_polkit-grant_Makefile.in (r1.1)
        patch-src_polkit-grant_polkit-explicit-grant-helper.c (r1.1)
        patch-src_polkit-grant_polkit-grant-helper-pam.c (r1.1)
        patch-src_polkit-grant_polkit-grant-helper.c (r1.1)
        patch-src_polkit-grant_polkit-grant.c (r1.1)
        patch-src_polkit-grant_polkit-revoke-helper.c (r1.1)
        patch-src_polkit_polkit-config.c (r1.1)
        patch-src_polkit_polkit-context.c (r1.1)
        patch-src_polkit_polkit-policy-cache.c (r1.1)
        patch-src_polkit_polkit-policy-file.c (r1.1)
        patch-src_polkit_polkit-sysdeps.c (r1.1)
        patch-tools_polkit-auth.c (r1.1)

-------------- next part --------------
--- /dev/null
+++ sysutils/policykit/files/patch-src_kit_kit-string.c
@@ -0,0 +1,31 @@
+--- src/kit/kit-string.c.orig	2008-04-08 15:44:50.000000000 -0400
++++ src/kit/kit-string.c	2008-04-22 01:00:49.000000000 -0400
+@@ -113,6 +113,28 @@ out:
+ 
+ #else
+ 
++#ifndef HAVE_STRNDUP
++static char
++*strndup ( const char *s, size_t n)
++{
++        size_t nAvail;
++        char *p;
++
++        if ( !s )
++                return NULL;
++
++        if ( strlen(s) > n )
++                nAvail = n + 1;
++        else
++                nAvail = strlen(s) + 1;
++        p = malloc ( nAvail );
++        memcpy ( p, s, nAvail );
++        p[nAvail - 1] = '\0';
++
++        return p;
++}
++#endif
++
+ char *
+ kit_strdup (const char *s)
+ {
--- /dev/null
+++ sysutils/policykit/files/patch-src_kit_kit-file.c
@@ -0,0 +1,26 @@
+--- src/kit/kit-file.c.orig	2007-11-28 16:32:08.000000000 -0500
++++ src/kit/kit-file.c	2007-12-24 14:48:35.000000000 -0500
+@@ -283,7 +283,11 @@ _kit_get_num_fd (void)
+         DIR *dir;
+         char buf[128];
+         ssize_t num;
++#ifdef HAVE_READDIR64
+         struct dirent64 *d;
++#else
++	struct dirent *d;
++#endif
+ 
+         num = -1;
+ 
+@@ -296,7 +300,11 @@ _kit_get_num_fd (void)
+         }
+ 
+         num = -2;
++#ifdef HAVE_READDIR64
+         while ((d = readdir64 (dir)) != NULL) {
++#else
++	while ((d = readdir (dir)) != NULL) {
++#endif
+                 if (d->d_name == NULL)
+                         continue;
+                 num++;
--- /dev/null
+++ sysutils/policykit/files/patch-data_PolicyKit.conf.in
@@ -0,0 +1,11 @@
+--- data/PolicyKit.conf.in.orig	2008-03-29 12:05:27.000000000 -0400
++++ data/PolicyKit.conf.in	2008-03-29 12:06:48.000000000 -0400
+@@ -6,4 +6,8 @@
+ <!-- See the manual page PolicyKit.conf(5) for file format -->
+ 
+ <config version="0.1">
++    <match user="root">
++	<return result="yes"/>
++    </match>
++    <define_admin_auth group="wheel"/>
+ </config>
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c
@@ -0,0 +1,78 @@
+--- src/polkit-grant/polkit-grant.c.orig	2008-04-08 12:23:22.000000000 -0400
++++ src/polkit-grant/polkit-grant.c	2008-04-30 20:46:00.000000000 -0400
+@@ -39,6 +39,7 @@
+ #include <sys/types.h>
+ #include <unistd.h>
+ #include <sys/wait.h>
++#include <signal.h>
+ 
+ #include <glib.h>
+ #include "polkit-grant.h"
+@@ -302,7 +303,7 @@ polkit_grant_io_func (PolKitGrant *polki
+         g_return_if_fail (polkit_grant != NULL);
+         g_return_if_fail (polkit_grant->helper_is_running);
+ 
+-        while (getline (&line, &line_len, polkit_grant->child_stdout_f) != -1) {
++        while (kit_getline (&line, &line_len, polkit_grant->child_stdout_f) != -1) {
+                 if (strlen (line) > 0 &&
+                     line[strlen (line) - 1] == '\n')
+                         line[strlen (line) - 1] = '\0';
+@@ -419,6 +420,8 @@ polkit_grant_io_func (PolKitGrant *polki
+ 
+         if (line != NULL)
+                 free (line);
++
++        polkit_grant->func_remove_watch (polkit_grant, polkit_grant->io_watch_id);
+ }
+ 
+ /**
+@@ -543,49 +546,6 @@ error:
+         return FALSE;
+ }
+ 
+-#ifdef HAVE_SOLARIS
+-#define BUFFER_LEN      256
+-
+-ssize_t getline (char **lineptr, size_t *n, FILE *f)
+-{
+-        char ch;
+-        size_t m = 0;
+-        ssize_t buf_len = 0;
+-        char * buf = NULL;
+-        char * p = NULL;
+-
+-
+-        while ( (ch = getc(f)) !=EOF )
+-        {
+-                if (errno != 0)
+-                        return -1;
+-                if ( m++ >= buf_len )
+-                {
+-                        buf_len += BUFFER_LEN;
+-                        buf = (char *) realloc(buf, buf_len + 1);
+-                        if ( buf == NULL )
+-                        {
+-                                return -1;
+-                        }
+-                        p = buf + buf_len - BUFFER_LEN;
+-                }
+-                if ( ch == '\n' )
+-                        break;
+-                *p = ch;
+-                p++;
+-        }
+-        if ( m == 0 )
+-        {
+-                return -1;
+-        } else {
+-                *p = '\0';
+-                *lineptr = buf;
+-                *n = m;
+-                return m;
+-        }
+-}
+-#endif
+-
+ #ifdef POLKIT_BUILD_TESTS
+ 
+ static polkit_bool_t
--- /dev/null
+++ sysutils/policykit/files/patch-tools_polkit-auth.c
@@ -0,0 +1,89 @@
+--- tools/polkit-auth.c.orig	2008-04-08 12:23:22.000000000 -0400
++++ tools/polkit-auth.c	2008-04-22 01:24:55.000000000 -0400
+@@ -37,7 +37,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/types.h>
+-#ifdef HAVE_SOLARIS
++#if defined(HAVE_SOLARIS) || defined(HAVE_FREEBSD)
+ #include <sys/wait.h>
+ #endif
+ #include <pwd.h>
+@@ -72,6 +72,77 @@ typedef struct {
+         GMainLoop *loop;
+ } UserData;
+ 
++#ifndef HAVE_GETLINE
++static ssize_t
++getline (char **lineptr, size_t *n, FILE *stream)
++{
++  char *line, *p;
++  long size, copy;
++
++  if (lineptr == NULL || n == NULL) {
++          errno = EINVAL;
++          return (ssize_t) -1;
++  }
++
++  if (ferror (stream))
++          return (ssize_t) -1;
++
++  /* Make sure we have a line buffer to start with.  */
++  if (*lineptr == NULL || *n < 2) /* !seen and no buf yet need 2 chars.  */ {
++#ifndef        MAX_CANON
++#define        MAX_CANON        256
++#endif
++          if (!*lineptr)
++                  line = (char *) malloc (MAX_CANON);
++          else
++                  line = (char *) realloc (*lineptr, MAX_CANON);
++          if (line == NULL)
++                  return (ssize_t) -1;
++          *lineptr = line;
++          *n = MAX_CANON;
++  }
++
++  line = *lineptr;
++  size = *n;
++
++  copy = size;
++  p = line;
++
++  while (1) {
++          long len;
++
++          while (--copy > 0) {
++                  int c = getc (stream);
++
++                  if (c == EOF)
++                          goto lose;
++                  else if ((*p++ = c) == '\n')
++                          goto win;
++          }
++
++          /* Need to enlarge the line buffer.  */
++          len = p - line;
++          size *= 2;
++          line = (char *) realloc (line, size);
++          if (line == NULL)
++                  goto lose;
++          *lineptr = line;
++          *n = size;
++          p = line + len;
++          copy = size - len;
++  }
++
++lose:
++  if (p == *lineptr)
++          return (ssize_t) -1;
++
++  /* Return a partial line since we got an error in the middle.  */
++win:
++  *p = '\0';
++  return p - *lineptr;
++}
++#endif
++
+ static void
+ conversation_type (PolKitGrant *polkit_grant, PolKitResult auth_type, void *user_data)
+ {
--- /dev/null
+++ sysutils/policykit/files/patch-data_Makefile.in
@@ -0,0 +1,25 @@
+--- data/Makefile.in.orig	2008-01-07 23:51:57.000000000 -0500
++++ data/Makefile.in	2008-01-07 23:52:15.000000000 -0500
+@@ -305,14 +305,14 @@ mostlyclean-libtool:
+ clean-libtool:
+ 	-rm -rf .libs _libs
+ install-confDATA: $(conf_DATA)
+-	@$(NORMAL_INSTALL)
+-	test -z "$(confdir)" || $(MKDIR_P) "$(DESTDIR)$(confdir)"
+-	@list='$(conf_DATA)'; for p in $$list; do \
+-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+-	  f=$(am__strip_dir) \
+-	  echo " $(confDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(confdir)/$$f'"; \
+-	  $(confDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(confdir)/$$f"; \
+-	done
++#	@$(NORMAL_INSTALL)
++#	test -z "$(confdir)" || $(MKDIR_P) "$(DESTDIR)$(confdir)"
++#	@list='$(conf_DATA)'; for p in $$list; do \
++#	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
++#	  f=$(am__strip_dir) \
++#	  echo " $(confDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(confdir)/$$f'"; \
++#	  $(confDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(confdir)/$$f"; \
++#	done
+ 
+ uninstall-confDATA:
+ 	@$(NORMAL_UNINSTALL)
--- /dev/null
+++ sysutils/policykit/files/patch-config.h.in
@@ -0,0 +1,44 @@
+--- config.h.in.orig	2008-04-08 16:24:43.000000000 -0400
++++ config.h.in	2008-04-18 01:07:15.000000000 -0400
+@@ -24,6 +24,18 @@
+ /* Define to 1 if you have the `getgrouplist' function. */
+ #undef HAVE_GETGROUPLIST
+ 
++/* Define to 1 if you have the `clearenv' function. */
++#undef HAVE_CLEARENV
++
++/* Define to 1 if you have the `strndup' function. */
++#undef HAVE_STRNDUP
++
++/* Define to 1 if you have the `readdir64' function. */
++#undef HAVE_READDIR64
++
++/* Define to 1 if you have the `getline' function. */
++#undef HAVE_GETLINE
++
+ /* Define if the GNU gettext() function is already present or preinstalled. */
+ #undef HAVE_GETTEXT
+ 
+@@ -57,6 +69,9 @@
+ /* Is this a Solaris system? */
+ #undef HAVE_SOLARIS
+ 
++/* Is this a FreeBSD system? */
++#undef HAVE_FREEBSD
++
+ /* Define to 1 if you have the <stdint.h> header file. */
+ #undef HAVE_STDINT_H
+ 
+@@ -120,6 +135,12 @@
+ /* Define if pam_strerror takes two arguments */
+ #undef PAM_STRERROR_TWO_ARGS
+ 
++/* Enable Linux inotify() usage */
++#undef HAVE_INOTIFY
++
++/* Enable BSD kqueue() usage */
++#undef HAVE_KQUEUE
++
+ /* Authorization Database to use */
+ #undef POLKIT_AUTHDB
+ 
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper-pam.c
@@ -0,0 +1,28 @@
+--- src/polkit-grant/polkit-grant-helper-pam.c.orig	2008-04-08 12:23:22.000000000 -0400
++++ src/polkit-grant/polkit-grant-helper-pam.c	2008-04-21 23:55:43.000000000 -0400
+@@ -41,6 +41,8 @@
+ #include <syslog.h>
+ #include <security/pam_appl.h>
+ 
++#include <kit/kit.h>
++
+ #ifdef HAVE_SOLARIS
+ #define LOG_AUTHPRIV    (10<<3)
+ #endif
+@@ -67,15 +69,8 @@ main (int argc, char *argv[])
+         pam_h = NULL;
+ 
+         /* clear the entire environment to avoid attacks using with libraries honoring environment variables */
+-#ifdef HAVE_SOLARIS
+-        extern char **environ;
+-
+-        if (environ != NULL)
+-                environ[0] = NULL;
+-#else
+-        if (clearenv () != 0)
++        if (kit_clearenv () != 0)
+                 goto error;
+-#endif
+         /* set a minimal environment */
+         setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+ 
--- /dev/null
+++ sysutils/policykit/files/patch-src_kit_Makefile.am
@@ -0,0 +1,10 @@
+--- src/kit/Makefile.am.orig	2008-04-21 23:44:56.000000000 -0400
++++ src/kit/Makefile.am	2008-04-21 23:45:23.000000000 -0400
+@@ -23,6 +23,7 @@ libkit_la_SOURCES =					\
+ 	kit-test.h		kit-test.c		\
+ 	kit-memory.h		kit-memory.c		\
+ 	kit-string.h		kit-string.c		\
++	kit-lib.h		kit-lib.c		\
+ 	kit-list.h		kit-list.c		\
+ 	kit-hash.h		kit-hash.c		\
+ 	kit-file.h		kit-file.c		\
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.c
@@ -0,0 +1,80 @@
+--- src/polkit/polkit-sysdeps.c.orig	2008-04-08 12:23:22.000000000 -0400
++++ src/polkit/polkit-sysdeps.c	2008-04-18 01:03:41.000000000 -0400
+@@ -51,7 +51,7 @@
+ #else
+ #include <procfs.h>
+ #endif
+-#else
++#elif defined(HAVE_INOTIFY)
+ #include <sys/inotify.h>
+ #endif
+ #include <syslog.h>
+@@ -106,7 +106,11 @@ polkit_sysdeps_get_start_time_for_pid (p
+         }
+         start_time = (unsigned long long) (info.pr_start.tv_sec);
+ #else
++#ifdef __FreeBSD__
++	filename = kit_strdup_printf ("/proc/%d/status", pid);
++#else
+         filename = kit_strdup_printf ("/proc/%d/stat", pid);
++#endif
+         if (filename == NULL) {
+                 errno = ENOMEM;
+                 goto out;
+@@ -117,6 +121,36 @@ polkit_sysdeps_get_start_time_for_pid (p
+                 goto out;
+         }
+ 
++#ifdef __FreeBSD__
++        tokens = kit_strsplit (contents, ' ', &num_tokens);
++        if (tokens == NULL)
++                goto out;
++        if (num_tokens < 8) {
++                kit_strfreev (tokens);
++                goto out;
++        }
++
++        p = kit_strdup (tokens[7]);
++        kit_strfreev (tokens);
++
++        tokens = kit_strsplit (p, ',', &num_tokens);
++        kit_free (p);
++        if (tokens == NULL)
++                goto out;
++        if (num_tokens >= 1) {
++                start_time = strtoll (tokens[0], &endp, 10);
++                if (endp == tokens[0]) {
++                        kit_strfreev (tokens);
++                        goto out;
++                }
++        } else {
++                kit_strfreev (tokens);
++                goto out;
++        }
++
++        kit_strfreev (tokens);
++#else
++
+         /* start time is the 19th token after the '(process name)' entry */
+ 
+         p = strchr (contents, ')');
+@@ -143,6 +177,7 @@ polkit_sysdeps_get_start_time_for_pid (p
+ 
+         kit_strfreev (tokens);
+ #endif
++#endif
+ 
+ out:
+ #ifndef HAVE_SOLARIS
+@@ -235,7 +270,11 @@ polkit_sysdeps_get_exe_for_pid (pid_t pi
+         ret = strlen (info.pr_psargs);
+         strncpy (out_buf, info.pr_psargs, ret);
+ #else
++#ifdef __FreeBSD__
++	snprintf (proc_name, sizeof (proc_name), "/proc/%d/file", pid);
++#else
+         snprintf (proc_name, sizeof (proc_name), "/proc/%d/exe", pid);
++#endif
+         ret = readlink (proc_name, out_buf, buf_size - 1);
+         if (ret == -1) {
+                 strncpy (out_buf, "(unknown)", buf_size);
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit_polkit-context.c
@@ -0,0 +1,171 @@
+--- src/polkit/polkit-context.c.orig	2008-04-15 20:31:16.000000000 -0400
++++ src/polkit/polkit-context.c	2008-04-18 01:12:13.000000000 -0400
+@@ -43,7 +43,13 @@
+ #include <port.h>
+ #include <sys/stat.h>
+ #else
++#ifdef HAVE_INOTIFY
+ #include <sys/inotify.h>
++#elif HAVE_KQUEUE
++#include <sys/event.h>
++#include <sys/time.h>
++#include <fcntl.h>
++#endif
+ #endif
+ #include <syslog.h>
+ 
+@@ -111,11 +117,19 @@ struct _PolKitContext
+ 
+         polkit_bool_t load_descriptions;
+ 
++#ifdef HAVE_INOTIFY
+         int inotify_fd;
+         int inotify_fd_watch_id;
+         int inotify_config_wd;
+         int inotify_policy_wd;
+         int inotify_grant_perm_wd;
++#elif HAVE_KQUEUE
++	int kqueue_fd;
++	int kqueue_fd_watch_id;
++	int kqueue_config_fd;
++	int kqueue_policy_fd;
++	int kqueue_grant_perm_fd;
++#endif
+ };
+ 
+ /**
+@@ -149,6 +163,10 @@ polkit_context_new (void)
+ polkit_bool_t
+ polkit_context_init (PolKitContext *pk_context, PolKitError **error)
+ {
++#ifdef HAVE_KQUEUE
++	struct kevent ev;
++#endif
++
+         kit_return_val_if_fail (pk_context != NULL, FALSE);
+ 
+         pk_context->policy_dir = kit_strdup (PACKAGE_DATA_DIR "/PolicyKit/policy");
+@@ -209,7 +227,87 @@ polkit_context_init (PolKitContext *pk_c
+                         goto error;
+                 }
+         }
++#elif HAVE_KQUEUE
++	if (pk_context->io_add_watch_func != NULL) {
++		pk_context->kqueue_fd = kqueue ();
++		if (pk_context->kqueue_fd < 0) {
++			polkit_debug ("failed to initialize kqueue: %s", strerror (errno));
++			/* TODO: set error */
++			goto error;
++		}
++
++		/* Watch the /etc/PolicyKit/PolicyKit.conf file */
++		pk_context->kqueue_config_fd = open (PACKAGE_SYSCONF_DIR "/PolicyKit/PolicyKit.conf", O_RDONLY);
++		if (pk_context->kqueue_config_fd < 0) {
++			polkit_debug ("failed '" PACKAGE_SYSCONF_DIR "/PolicyKit/PolicyKit.conf' for reading: %s",
++				strerror (errno));
++			/* TODO: set error */
++			goto error;
++		}
++
++		EV_SET (&ev, pk_context->kqueue_config_fd, EVFILT_VNODE,
++			EV_ADD | EV_ENABLE | EV_CLEAR,
++			NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_RENAME,
++			0, 0);
++		if (kevent (pk_context->kqueue_fd, &ev, 1, NULL, 0, NULL) == -1) {
++			polkit_debug ("failed to add watch on file '" PACKAGE_SYSCONF_DIR "/PolicyKit/PolicyKit.conf': %s",
++				strerror (errno));
++			close (pk_context->kqueue_config_fd);
++			/* TODO: set error */
++			goto error;
++		}
++
++		/* Watch the /usr/share/PolicyKit/policy directory */
++		pk_context->kqueue_policy_fd = open (PACKAGE_DATA_DIR "/PolicyKit/policy", O_RDONLY);
++		if (pk_context->kqueue_policy_fd < 0) {
++			polkit_debug ("failed to open '" PACKAGE_DATA_DIR "/PolicyKit/policy for reading: %s",
++				strerror (errno));
++			/* TODO: set error */
++			goto error;
++		}
++
++		EV_SET (&ev, pk_context->kqueue_policy_fd, EVFILT_VNODE,
++			EV_ADD | EV_ENABLE | EV_CLEAR,
++			NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_RENAME,
++			0, 0);
++		if (kevent (pk_context->kqueue_fd, &ev, 1, NULL, 0, NULL) == -1) {
++			polkit_debug ("failed to add watch on directory '" PACKAGE_DATA_DIR "/PolicyKit/policy': %s",
++				strerror (errno));
++			close (pk_context->kqueue_policy_fd);
++			/* TODO: set error */
++			goto error;
++		}
++
++#ifdef POLKIT_AUTHDB_DEFAULT
++		/* Watch the /var/lib/misc/PolicyKit.reload file */
++		pk_context->kqueue_grant_perm_fd = open (PACKAGE_LOCALSTATE_DIR "/lib/misc/PolicyKit.reload", O_RDONLY);
++		if (pk_context->kqueue_grant_perm_fd < 0) {
++			polkit_debug ("failed to open '" PACKAGE_LOCALSTATE_DIR "/lib/misc/PolicyKit.reload' for reading: %s",
++				strerror (errno));
++			/* TODO: set error */
++			goto error;
++		}
++
++		EV_SET (&ev, pk_context->kqueue_grant_perm_fd, EVFILT_VNODE,
++			EV_ADD | EV_ENABLE | EV_CLEAR,
++			NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_RENAME | NOTE_ATTRIB,
++			0, 0);
++		if (kevent (pk_context->kqueue_fd, &ev, 1, NULL, 0, NULL) == -1) {
++			polkit_debug ("failed to add watch on file '" PACKAGE_LOCALSTATE_DIR "/lib/misc/PolicyKit.reload': %s",
++				strerror (errno));
++			close (pk_context->kqueue_grant_perm_fd);
++			/* TODO: set error */
++			goto error;
++		}
++#endif
+ 
++		pk_context->kqueue_fd_watch_id = pk_context->io_add_watch_func (pk_context, pk_context->kqueue_fd);
++		if (pk_context->kqueue_fd_watch_id == 0) {
++			polkit_debug ("failed to add io watch");
++			/* TODO: set error */
++			goto error;
++		}
++	}
+ #else
+         if (pk_context->io_add_watch_func != NULL) {
+                 pk_context->inotify_fd = inotify_init ();
+@@ -444,6 +542,35 @@ polkit_context_io_func (PolKitContext *p
+                 }
+         }
+ 
++#elif HAVE_KQUEUE
++	if (fd == pk_context->kqueue_fd) {
++		struct kevent ev[1024];
++		struct timespec nullts = { 0, 0 };
++		int res;
++		int i = 0;
++
++		res = kevent (fd, NULL, 0, ev, 1024, &nullts);
++
++		if (res > 0) {
++			/* Sleep for a half-second to avoid potential races
++			 * during install/uninstall. */
++			usleep (500000);
++
++			while (i < res) {
++				struct kevent *evptr;
++
++				evptr = &ev[i];
++				polkit_debug ("ident=%d filter=%d flags=%u fflags=%u",
++					   evptr->ident, evptr->filter, evptr->flags, evptr->fflags);
++				polkit_debug ("config changed!");
++				config_changed = TRUE;
++
++				i++;
++			}
++		} else {
++			polkit_debug ("failed to read kqueue event: %s", strerror (errno));
++		}
++	}
+ #else
+         if (fd == pk_context->inotify_fd) {
+ /* size of the event structure, not counting name */
--- /dev/null
+++ sysutils/policykit/files/patch-src_kit_kit-lib.h
@@ -0,0 +1,55 @@
+--- src/kit/kit-lib.h.orig	2008-04-21 23:44:10.000000000 -0400
++++ src/kit/kit-lib.h	2008-04-21 23:48:03.000000000 -0400
+@@ -0,0 +1,52 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
++/***************************************************************************
++ *
++ * kit-string.h : General utilities
++ *
++ * Copyright (C) 2007 David Zeuthen, <david at fubar.dk>
++ *
++ * Permission is hereby granted, free of charge, to any person
++ * obtaining a copy of this software and associated documentation
++ * files (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy,
++ * modify, merge, publish, distribute, sublicense, and/or sell copies
++ * of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ **************************************************************************/
++
++#if !defined (KIT_COMPILATION) && !defined(_KIT_INSIDE_KIT_H)
++#error "Only <kit/kit.h> can be included directly, this file may disappear or change contents."
++#endif
++
++#ifndef KIT_LIB_H
++#define KIT_LIB_H
++
++#include <sys/types.h>
++#include <stdio.h>
++
++#include <kit/kit.h>
++
++KIT_BEGIN_DECLS
++
++ssize_t kit_getline 	(char **lineptr, size_t *n, FILE *f);
++
++int kit_clearenv 	(void);
++
++KIT_END_DECLS
++
++#endif /* KIT_LIB_H */
++
++
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit_polkit-config.c
@@ -0,0 +1,10 @@
+--- src/polkit/polkit-config.c.orig	2008-04-21 19:47:19.000000000 -0400
++++ src/polkit/polkit-config.c	2008-04-21 19:47:27.000000000 -0400
+@@ -39,7 +39,6 @@
+ #include <grp.h>
+ #include <unistd.h>
+ #include <errno.h>
+-#include <sys/inotify.h>
+ #include <regex.h>
+ #include <syslog.h>
+ #include <regex.h>
--- /dev/null
+++ sysutils/policykit/files/patch-src_kit_kit-lib.c
@@ -0,0 +1,139 @@
+--- src/kit/kit-lib.c.orig	2008-04-22 00:52:17.000000000 -0400
++++ src/kit/kit-lib.c	2008-04-22 01:15:38.000000000 -0400
+@@ -0,0 +1,136 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
++/***************************************************************************
++ *
++ * kit-lib.c : General utilities
++ *
++ * Copyright (C) 2007 David Zeuthen, <david at fubar.dk>
++ *
++ * Permission is hereby granted, free of charge, to any person
++ * obtaining a copy of this software and associated documentation
++ * files (the "Software"), to deal in the Software without
++ * restriction, including without limitation the rights to use, copy,
++ * modify, merge, publish, distribute, sublicense, and/or sell copies
++ * of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ **************************************************************************/
++
++#ifdef HAVE_CONFIG_H
++#  include <config.h>
++#endif
++
++#define _GNU_SOURCE
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <errno.h>
++
++#include <kit/kit.h>
++#include "kit-test.h"
++
++#ifndef HAVE_GETLINE
++ssize_t
++kit_getline (char **lineptr, size_t *n, FILE *stream)
++{
++  char *line, *p;
++  long size, copy;
++
++  if (lineptr == NULL || n == NULL) {
++          errno = EINVAL;
++          return (ssize_t) -1;
++  }
++
++  if (ferror (stream))
++          return (ssize_t) -1;
++
++  /* Make sure we have a line buffer to start with.  */
++  if (*lineptr == NULL || *n < 2) /* !seen and no buf yet need 2 chars.  */ {
++#ifndef        MAX_CANON
++#define        MAX_CANON        256
++#endif
++          if (!*lineptr)
++                  line = (char *) malloc (MAX_CANON);
++          else
++                  line = (char *) realloc (*lineptr, MAX_CANON);
++          if (line == NULL)
++                  return (ssize_t) -1;
++          *lineptr = line;
++          *n = MAX_CANON;
++  }
++
++  line = *lineptr;
++  size = *n;
++
++  copy = size;
++  p = line;
++
++  while (1) {
++          long len;
++
++          while (--copy > 0) {
++                  int c = getc (stream);
++
++                  if (c == EOF)
++                          goto lose;
++                  else if ((*p++ = c) == '\n')
++                          goto win;
++          }
++
++          /* Need to enlarge the line buffer.  */
++          len = p - line;
++          size *= 2;
++          line = (char *) realloc (line, size);
++          if (line == NULL)
++                  goto lose;
++          *lineptr = line;
++          *n = size;
++          p = line + len;
++          copy = size - len;
++  }
++
++lose:
++  if (p == *lineptr)
++          return (ssize_t) -1;
++
++  /* Return a partial line since we got an error in the middle.  */
++win:
++  *p = '\0';
++  return p - *lineptr;
++}
++#else
++ssize_t
++kit_getline (char **lineptr, size_t *n, FILE *f)
++{
++        return getline (lineptr, n, f);
++}
++#endif
++
++#ifndef HAVE_CLEARENV
++extern char **environ;
++
++int
++kit_clearenv (void)
++{
++        if (environ != NULL)
++                environ[0] = NULL;
++        return 0;
++}
++#else
++int
++kit_clearenv (void)
++{
++        return clearenv ();
++}
++#endif
--- /dev/null
+++ sysutils/policykit/files/patch-src_kit_Makefile.in
@@ -0,0 +1,85 @@
+--- src/kit/Makefile.in.orig	2008-04-21 23:45:47.000000000 -0400
++++ src/kit/Makefile.in	2008-04-21 23:46:09.000000000 -0400
+@@ -1,8 +1,8 @@
+-# Makefile.in generated by automake 1.10.1 from Makefile.am.
++# Makefile.in generated by automake 1.10 from Makefile.am.
+ # @configure_input@
+ 
+ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
++# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+@@ -48,7 +48,7 @@ LTLIBRARIES = $(noinst_LTLIBRARIES)
+ libkit_la_LIBADD =
+ am__objects_1 =
+ am_libkit_la_OBJECTS = kit-test.lo kit-memory.lo kit-string.lo \
+-	kit-list.lo kit-hash.lo kit-file.lo kit-spawn.lo \
++	kit-lib.lo kit-list.lo kit-hash.lo kit-file.lo kit-spawn.lo \
+ 	kit-message.lo kit-entity.lo $(am__objects_1)
+ libkit_la_OBJECTS = $(am_libkit_la_OBJECTS)
+ @KIT_BUILD_TESTS_TRUE at am__EXEEXT_1 = kit-test$(EXEEXT)
+@@ -60,7 +60,7 @@ kit_test_OBJECTS = $(am_kit_test_OBJECTS
+ kit_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ 	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(kit_test_LDFLAGS) \
+ 	$(LDFLAGS) -o $@
+-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
++DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+@@ -273,6 +273,7 @@ libkit_la_SOURCES = \
+ 	kit-test.h		kit-test.c		\
+ 	kit-memory.h		kit-memory.c		\
+ 	kit-string.h		kit-string.c		\
++	kit-lib.h		kit-lib.c		\
+ 	kit-list.h		kit-list.c		\
+ 	kit-hash.h		kit-hash.c		\
+ 	kit-file.h		kit-file.c		\
+@@ -351,6 +352,7 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kit-entity.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kit-file.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kit-hash.Plo at am__quote@
++ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kit-lib.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kit-list.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kit-memory.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/kit-message.Plo at am__quote@
+@@ -391,8 +393,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS
+ 	unique=`for i in $$list; do \
+ 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ 	  done | \
+-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
++	  $(AWK) '    { files[$$0] = 1; } \
++	       END { for (i in files) print i; }'`; \
+ 	mkid -fID $$unique
+ tags: TAGS
+ 
+@@ -404,8 +406,8 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEP
+ 	unique=`for i in $$list; do \
+ 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ 	  done | \
+-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
++	  $(AWK) '    { files[$$0] = 1; } \
++	       END { for (i in files) print i; }'`; \
+ 	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ 	  test -n "$$unique" || unique=$$empty_fix; \
+ 	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+@@ -415,12 +417,13 @@ ctags: CTAGS
+ CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+ 		$(TAGS_FILES) $(LISP)
+ 	tags=; \
++	here=`pwd`; \
+ 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+ 	unique=`for i in $$list; do \
+ 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ 	  done | \
+-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
++	  $(AWK) '    { files[$$0] = 1; } \
++	       END { for (i in files) print i; }'`; \
+ 	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ 	     $$tags $$unique
--- /dev/null
+++ sysutils/policykit/files/patch-src_kit_kit-file.h
@@ -0,0 +1,10 @@
+--- src/kit/kit-file.h.orig	2007-12-22 19:14:03.000000000 -0500
++++ src/kit/kit-file.h	2007-12-22 19:14:13.000000000 -0500
+@@ -34,6 +34,7 @@
+ #ifndef KIT_FILE_H
+ #define KIT_FILE_H
+ 
++#include <sys/stat.h>
+ #include <kit/kit.h>
+ 
+ KIT_BEGIN_DECLS
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit-dbus_polkit-read-auth-helper.c
@@ -0,0 +1,51 @@
+--- src/polkit-dbus/polkit-read-auth-helper.c.orig	2008-04-08 12:23:22.000000000 -0400
++++ src/polkit-dbus/polkit-read-auth-helper.c	2008-04-21 23:40:19.000000000 -0400
+@@ -39,6 +39,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <sys/types.h>
++#include <sys/param.h>
+ #include <sys/stat.h>
+ #include <grp.h>
+ #include <pwd.h>
+@@ -159,7 +160,11 @@ dump_auths_all (const char *root)
+ {
+         DIR *dir;
+         int dfd;
++#ifdef HAVE_READDIR64
+         struct dirent64 *d;
++#else
++	struct dirent *d;
++#endif
+         polkit_bool_t ret;
+ 
+         ret = FALSE;
+@@ -176,7 +181,11 @@ dump_auths_all (const char *root)
+                 goto out;
+         }
+ 
++#ifdef HAVE_READDIR64
+         while ((d = readdir64(dir)) != NULL) {
++#else
++	while ((d = readdir(dir)) != NULL) {
++#endif
+                 unsigned int n, m;
+                 uid_t uid;
+                 size_t name_len;
+@@ -291,15 +300,8 @@ main (int argc, char *argv[])
+ 
+ #ifndef POLKIT_BUILD_TESTS
+         /* clear the entire environment to avoid attacks using with libraries honoring environment variables */
+-#ifdef HAVE_SOLARIS
+-        extern char **environ;
+-
+-        if (environ != NULL)
+-                environ[0] = NULL;
+-#else
+-        if (clearenv () != 0)
++        if (kit_clearenv () != 0)
+                 goto out;
+-#endif
+         /* set a minimal environment */
+         setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+ #endif
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit-grant_Makefile.in
@@ -0,0 +1,111 @@
+--- src/polkit-grant/Makefile.in.orig	2008-04-21 23:53:59.000000000 -0400
++++ src/polkit-grant/Makefile.in	2008-04-21 23:54:15.000000000 -0400
+@@ -1,8 +1,8 @@
+-# Makefile.in generated by automake 1.10.1 from Makefile.am.
++# Makefile.in generated by automake 1.10 from Makefile.am.
+ # @configure_input@
+ 
+ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
++# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+@@ -110,7 +110,7 @@ am__polkit_grant_helper_pam_SOURCES_DIST
+ @POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE at am_polkit_grant_helper_pam_OBJECTS = polkit-grant-helper-pam.$(OBJEXT)
+ polkit_grant_helper_pam_OBJECTS =  \
+ 	$(am_polkit_grant_helper_pam_OBJECTS)
+-polkit_grant_helper_pam_DEPENDENCIES =
++ at POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE at polkit_grant_helper_pam_DEPENDENCIES = $(top_builddir)/src/polkit/libpolkit.la
+ am__polkit_grant_helper_shadow_SOURCES_DIST =  \
+ 	polkit-grant-helper-shadow.c
+ @POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_SHADOW_TRUE at am_polkit_grant_helper_shadow_OBJECTS = polkit-grant-helper-shadow.$(OBJEXT)
+@@ -137,7 +137,7 @@ polkit_revoke_helper_LINK = $(LIBTOOL) -
+ 	$(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ 	$(polkit_revoke_helper_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ 	$(LDFLAGS) -o $@
+-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
++DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+@@ -370,7 +370,7 @@ libpolkit_grant_la_LDFLAGS = -version-in
+ @POLKIT_AUTHDB_DEFAULT_TRUE at polkit_grant_helper_SOURCES = polkit-grant-helper.c
+ @POLKIT_AUTHDB_DEFAULT_TRUE at polkit_grant_helper_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ $(top_builddir)/src/polkit/libpolkit.la $(top_builddir)/src/polkit-dbus/libpolkit-dbus.la libpolkit-grant.la
+ @POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE at polkit_grant_helper_pam_SOURCES = polkit-grant-helper-pam.c
+- at POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE at polkit_grant_helper_pam_LDADD = @AUTH_LIBS@
++ at POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE at polkit_grant_helper_pam_LDADD = @AUTH_LIBS@ $(top_builddir)/src/polkit/libpolkit.la
+ @POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_SHADOW_TRUE at polkit_grant_helper_shadow_SOURCES = polkit-grant-helper-shadow.c
+ @POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_SHADOW_TRUE at polkit_grant_helper_shadow_LDADD = @AUTH_LIBS@
+ @POLKIT_AUTHDB_DEFAULT_TRUE at polkit_explicit_grant_helper_SOURCES = polkit-explicit-grant-helper.c
+@@ -424,8 +424,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIE
+ 	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ 	  if test -f $$p; then \
+ 	    f=$(am__strip_dir) \
+-	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+-	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
++	    echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
++	    $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+ 	  else :; fi; \
+ 	done
+ 
+@@ -433,8 +433,8 @@ uninstall-libLTLIBRARIES:
+ 	@$(NORMAL_UNINSTALL)
+ 	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ 	  p=$(am__strip_dir) \
+-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
++	  echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
++	  $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+ 	done
+ 
+ clean-libLTLIBRARIES:
+@@ -463,8 +463,8 @@ install-libexecPROGRAMS: $(libexec_PROGR
+ 	     || test -f $$p1 \
+ 	  ; then \
+ 	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+-	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
+-	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
++	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
++	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
+ 	  else :; fi; \
+ 	done
+ 
+@@ -594,8 +594,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS
+ 	unique=`for i in $$list; do \
+ 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ 	  done | \
+-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
++	  $(AWK) '    { files[$$0] = 1; } \
++	       END { for (i in files) print i; }'`; \
+ 	mkid -fID $$unique
+ tags: TAGS
+ 
+@@ -607,8 +607,8 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEP
+ 	unique=`for i in $$list; do \
+ 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ 	  done | \
+-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
++	  $(AWK) '    { files[$$0] = 1; } \
++	       END { for (i in files) print i; }'`; \
+ 	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ 	  test -n "$$unique" || unique=$$empty_fix; \
+ 	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+@@ -618,12 +618,13 @@ ctags: CTAGS
+ CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+ 		$(TAGS_FILES) $(LISP)
+ 	tags=; \
++	here=`pwd`; \
+ 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+ 	unique=`for i in $$list; do \
+ 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ 	  done | \
+-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
++	  $(AWK) '    { files[$$0] = 1; } \
++	       END { for (i in files) print i; }'`; \
+ 	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ 	     $$tags $$unique
--- /dev/null
+++ sysutils/policykit/files/patch-configure.in
@@ -0,0 +1,64 @@
+--- configure.in.orig	2008-04-08 16:22:34.000000000 -0400
++++ configure.in	2008-04-18 02:09:19.000000000 -0400
+@@ -179,7 +179,7 @@ PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-
+ AC_SUBST(DBUS_GLIB_CFLAGS)
+ AC_SUBST(DBUS_GLIB_LIBS)
+ 
+-AC_CHECK_FUNCS(getgrouplist)
++AC_CHECK_FUNCS(getgrouplist readdir64 getline strndup clearenv)
+ 
+ EXPAT_LIB=""
+ AC_ARG_WITH(expat, [  --with-expat=<dir>      Use expat from here],
+@@ -471,7 +471,8 @@ AM_CONDITIONAL(OS_TYPE_RED_HAT, test x$w
+ AM_CONDITIONAL(OS_TYPE_SUSE, test x$with_os_type = xsuse, [Running on SUSE OS'es])
+ AM_CONDITIONAL(OS_TYPE_GENTOO, test x$with_os_type = xgentoo, [Running on Gentoo OS'es])
+ AM_CONDITIONAL(OS_TYPE_PARDUS, test x$with_os_type = xpardus, [Running on Pardus OS'es])
+-AM_CONDITIONAL(OS_TYPE_SALARIS, test x$with_os_type = xsolaris, [Running os Solaris OS'es])
++AM_CONDITIONAL(OS_TYPE_SOLARIS, test x$with_os_type = xsolaris, [Running os Solaris OS'es])
++AM_CONDITIONAL(OS_TYPE_FREEBSD, test x$with_os_type = xfreebsd, [Running on FreeBSD OS'es])
+ 
+ AC_ARG_WITH(pam-include, [  --with-pam-include=<file>  pam file to include])
+ 
+@@ -491,6 +492,11 @@ elif test x$with_os_type = xsuse -o x$wi
+    PAM_FILE_INCLUDE_ACCOUNT=common-account
+    PAM_FILE_INCLUDE_PASSWORD=common-password
+    PAM_FILE_INCLUDE_SESSION=common-session
++elif test x$with_os_type = xfreebsd ; then
++    PAM_FILE_INCLUDE_AUTH=system
++    PAM_FILE_INCLUDE_ACCOUNT=system
++    PAM_FILE_INCLUDE_PASSWORD=system
++    PAM_FILE_INCLUDE_SESSION=system
+ else
+    PAM_FILE_INCLUDE_AUTH=system-auth
+    PAM_FILE_INCLUDE_ACCOUNT=system-auth
+@@ -516,8 +522,30 @@ case "$host_os" in
+   *solaris*)
+ 	AC_DEFINE([HAVE_SOLARIS], 1, [Is this a Solaris system?])
+ 	;;
++  *freebsd*)
++  	AC_DEFINE([HAVE_FREEBSD], 1, [Is this a FreeBSD system?])
++	;;
+ esac
+ 
++have_inotify=no
++AC_CHECK_HEADERS([linux/inotify.h], [have_inotify=yes])
++AC_CHECK_HEADERS([sys/inotify.h], [have_inotify=yes])
++
++AM_CONDITIONAL(HAVE_INOTIFY, test "x$have_inotify" = "xyes")
++
++if test "x$have_inotify" = "xyes" ; then
++    AC_DEFINE([HAVE_INOTIFY], 1, [Enable Linux inotify() usage])
++fi
++
++have_kqueue=yes
++AC_CHECK_FUNCS([kqueue],,have_kqueue=no)
++
++AM_CONDITIONAL(HAVE_KQUEUE, test "x$have_kqueue" = "xyes")
++
++if test "x$have_kqueue" = "xyes" ; then
++    AC_DEFINE([HAVE_KQUEUE], 1, [Enable BSD kqueue() usage])
++fi
++
+ # ********************
+ # Internationalisation
+ # ********************
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit-grant_Makefile.am
@@ -0,0 +1,11 @@
+--- src/polkit-grant/Makefile.am.orig	2008-04-21 23:53:20.000000000 -0400
++++ src/polkit-grant/Makefile.am	2008-04-21 23:53:33.000000000 -0400
+@@ -60,7 +60,7 @@ polkit_grant_helper_LDADD = @GLIB_LIBS@ 
+ 
+ if POLKIT_AUTHFW_PAM
+ polkit_grant_helper_pam_SOURCES = polkit-grant-helper-pam.c
+-polkit_grant_helper_pam_LDADD = @AUTH_LIBS@
++polkit_grant_helper_pam_LDADD = @AUTH_LIBS@ $(top_builddir)/src/polkit/libpolkit.la
+ endif
+ 
+ if POLKIT_AUTHFW_SHADOW
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper.c
@@ -0,0 +1,28 @@
+--- src/polkit-grant/polkit-grant-helper.c.orig	2008-04-08 12:23:22.000000000 -0400
++++ src/polkit-grant/polkit-grant-helper.c	2008-04-21 23:58:24.000000000 -0400
+@@ -57,6 +57,8 @@
+ 
+ #include <glib.h>
+ 
++#include <kit/kit.h>
++
+ #include <polkit-dbus/polkit-dbus.h>
+ // #include <polkit/polkit-grant-database.h>
+ 
+@@ -564,15 +566,8 @@ main (int argc, char *argv[])
+         ret = 3;
+ 
+         /* clear the entire environment to avoid attacks using with libraries honoring environment variables */
+-#ifdef HAVE_SOLARIS
+-        extern char **environ;
+-
+-        if (environ != NULL)
+-                environ[0] = NULL;
+-#else
+-        if (clearenv () != 0)
++        if (kit_clearenv () != 0)
+                 goto out;
+-#endif
+         /* set a minimal environment */
+         setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+ 
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit-dbus_polkit-set-default-helper.c
@@ -0,0 +1,19 @@
+--- src/polkit-dbus/polkit-set-default-helper.c.orig	2008-04-08 16:36:47.000000000 -0400
++++ src/polkit-dbus/polkit-set-default-helper.c	2008-04-21 23:41:51.000000000 -0400
+@@ -128,15 +128,8 @@ main (int argc, char *argv[])
+ 
+         ret = 1;
+         /* clear the entire environment to avoid attacks using with libraries honoring environment variables */
+-#ifdef HAVE_SOLARIS
+-        extern char **environ;
+-
+-        if (environ != NULL)
+-                environ[0] = NULL;
+-#else
+-        if (clearenv () != 0)
++        if (kit_clearenv () != 0)
+                 goto out;
+-#endif
+         /* set a minimal environment */
+         setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+ 
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit_polkit-policy-cache.c
@@ -0,0 +1,26 @@
+--- src/polkit/polkit-policy-cache.c.orig	2007-11-29 01:14:09.000000000 -0500
++++ src/polkit/polkit-policy-cache.c	2007-12-24 14:51:04.000000000 -0500
+@@ -98,7 +98,11 @@ PolKitPolicyCache *
+ _polkit_policy_cache_new (const char *dirname, polkit_bool_t load_descriptions, PolKitError **error)
+ {
+         DIR *dir;
++#ifdef HAVE_READDIR64
+         struct dirent64 *d;
++#else
++	struct dirent *d;
++#endif
+         PolKitPolicyCache *pc;
+ 
+         dir = NULL;
+@@ -119,7 +123,11 @@ _polkit_policy_cache_new (const char *di
+                 goto out;
+         }
+ 
++#ifdef HAVE_READDIR64
+         while ((d = readdir64 (dir)) != NULL) {
++#else
++	while ((d = readdir (dir)) != NULL) {
++#endif
+                 char *path;
+                 PolKitPolicyFile *pf;
+                 PolKitError *pk_error;
--- /dev/null
+++ sysutils/policykit/files/patch-src_kit_kit-spawn.c
@@ -0,0 +1,10 @@
+--- src/kit/kit-spawn.c.orig	2007-12-23 00:22:49.000000000 -0500
++++ src/kit/kit-spawn.c	2007-12-23 00:22:58.000000000 -0500
+@@ -40,6 +40,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#include <signal.h>
+ 
+ #include <kit/kit.h>
+ #include "kit-test.h"
--- /dev/null
+++ sysutils/policykit/files/patch-src_kit_kit.h
@@ -0,0 +1,10 @@
+--- src/kit/kit.h.orig	2008-04-21 23:24:30.000000000 -0400
++++ src/kit/kit.h	2008-04-21 23:24:51.000000000 -0400
+@@ -148,6 +148,7 @@ do {                                    
+ #endif
+ #include <kit/kit-memory.h>
+ #include <kit/kit-string.h>
++#include <kit/kit-lib.h>
+ #include <kit/kit-list.h>
+ #include <kit/kit-hash.h>
+ #include <kit/kit-file.h>
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit-grant_polkit-explicit-grant-helper.c
@@ -0,0 +1,19 @@
+--- src/polkit-grant/polkit-explicit-grant-helper.c.orig	2008-04-08 12:23:22.000000000 -0400
++++ src/polkit-grant/polkit-explicit-grant-helper.c	2008-04-21 23:34:12.000000000 -0400
+@@ -70,15 +70,8 @@ main (int argc, char *argv[])
+         ret = 1;
+ 
+         /* clear the entire environment to avoid attacks using with libraries honoring environment variables */
+-#ifdef HAVE_SOLARIS
+-        extern char **environ;
+-
+-        if (environ != NULL)
+-                environ[0] = NULL;
+-#else
+-        if (clearenv () != 0)
++        if (kit_clearenv () != 0)
+                 goto out;
+-#endif
+         /* set a minimal environment */
+         setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+ 
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit-grant_polkit-revoke-helper.c
@@ -0,0 +1,19 @@
+--- src/polkit-grant/polkit-revoke-helper.c.orig	2008-04-08 12:23:22.000000000 -0400
++++ src/polkit-grant/polkit-revoke-helper.c	2008-04-21 23:38:11.000000000 -0400
+@@ -112,15 +112,8 @@ main (int argc, char *argv[])
+ 
+ #ifndef POLKIT_BUILD_TESTS
+         /* clear the entire environment to avoid attacks using with libraries honoring environment variables */
+-#ifdef HAVE_SOLARIS
+-        extern char **environ;
+-
+-        if (environ != NULL)
+-                environ[0] = NULL;
+-#else
+-        if (clearenv () != 0)
++        if (kit_clearenv () != 0)
+                 goto out;
+-#endif
+         /* set a minimal environment */
+         setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+ #endif
--- /dev/null
+++ sysutils/policykit/files/patch-configure
@@ -0,0 +1,802 @@
+--- configure.orig	2008-04-18 01:07:38.000000000 -0400
++++ configure	2008-04-18 01:07:47.000000000 -0400
+@@ -938,10 +938,16 @@ OS_TYPE_PARDUS_TRUE
+ OS_TYPE_PARDUS_FALSE
+ OS_TYPE_SALARIS_TRUE
+ OS_TYPE_SALARIS_FALSE
++OS_TYPE_FREEBSD_TRUE
++OS_TYPE_FREEBSD_FALSE
+ PAM_FILE_INCLUDE_AUTH
+ PAM_FILE_INCLUDE_ACCOUNT
+ PAM_FILE_INCLUDE_PASSWORD
+ PAM_FILE_INCLUDE_SESSION
++HAVE_INOTIFY_TRUE
++HAVE_INOTIFY_FALSE
++HAVE_KQUEUE_TRUE
++HAVE_KQUEUE_FALSE
+ INTLTOOL_DESKTOP_RULE
+ INTLTOOL_DIRECTORY_RULE
+ INTLTOOL_KEYS_RULE
+@@ -6555,7 +6561,7 @@ ia64-*-hpux*)
+   ;;
+ *-*-irix6*)
+   # Find out which ABI we are using.
+-  echo '#line 6558 "configure"' > conftest.$ac_ext
++  echo '#line 6564 "configure"' > conftest.$ac_ext
+   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+   (eval $ac_compile) 2>&5
+   ac_status=$?
+@@ -8893,11 +8899,11 @@ else
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:8896: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:8902: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>conftest.err)
+    ac_status=$?
+    cat conftest.err >&5
+-   echo "$as_me:8900: \$? = $ac_status" >&5
++   echo "$as_me:8906: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s "$ac_outfile"; then
+      # The compiler can only warn and ignore the option if not recognized
+      # So say no if there are warnings other than the usual output.
+@@ -9183,11 +9189,11 @@ else
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:9186: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:9192: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>conftest.err)
+    ac_status=$?
+    cat conftest.err >&5
+-   echo "$as_me:9190: \$? = $ac_status" >&5
++   echo "$as_me:9196: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s "$ac_outfile"; then
+      # The compiler can only warn and ignore the option if not recognized
+      # So say no if there are warnings other than the usual output.
+@@ -9287,11 +9293,11 @@ else
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:9290: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:9296: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>out/conftest.err)
+    ac_status=$?
+    cat out/conftest.err >&5
+-   echo "$as_me:9294: \$? = $ac_status" >&5
++   echo "$as_me:9300: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s out/conftest2.$ac_objext
+    then
+      # The compiler can only warn and ignore the option if not recognized
+@@ -11638,7 +11644,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<EOF
+-#line 11641 "configure"
++#line 11647 "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -11738,7 +11744,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<EOF
+-#line 11741 "configure"
++#line 11747 "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -14158,11 +14164,11 @@ else
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:14161: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:14167: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>conftest.err)
+    ac_status=$?
+    cat conftest.err >&5
+-   echo "$as_me:14165: \$? = $ac_status" >&5
++   echo "$as_me:14171: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s "$ac_outfile"; then
+      # The compiler can only warn and ignore the option if not recognized
+      # So say no if there are warnings other than the usual output.
+@@ -14262,11 +14268,11 @@ else
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:14265: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:14271: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>out/conftest.err)
+    ac_status=$?
+    cat out/conftest.err >&5
+-   echo "$as_me:14269: \$? = $ac_status" >&5
++   echo "$as_me:14275: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s out/conftest2.$ac_objext
+    then
+      # The compiler can only warn and ignore the option if not recognized
+@@ -15826,11 +15832,11 @@ else
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:15829: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:15835: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>conftest.err)
+    ac_status=$?
+    cat conftest.err >&5
+-   echo "$as_me:15833: \$? = $ac_status" >&5
++   echo "$as_me:15839: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s "$ac_outfile"; then
+      # The compiler can only warn and ignore the option if not recognized
+      # So say no if there are warnings other than the usual output.
+@@ -15930,11 +15936,11 @@ else
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:15933: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:15939: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>out/conftest.err)
+    ac_status=$?
+    cat out/conftest.err >&5
+-   echo "$as_me:15937: \$? = $ac_status" >&5
++   echo "$as_me:15943: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s out/conftest2.$ac_objext
+    then
+      # The compiler can only warn and ignore the option if not recognized
+@@ -18119,11 +18125,11 @@ else
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:18122: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:18128: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>conftest.err)
+    ac_status=$?
+    cat conftest.err >&5
+-   echo "$as_me:18126: \$? = $ac_status" >&5
++   echo "$as_me:18132: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s "$ac_outfile"; then
+      # The compiler can only warn and ignore the option if not recognized
+      # So say no if there are warnings other than the usual output.
+@@ -18409,11 +18415,11 @@ else
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:18412: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:18418: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>conftest.err)
+    ac_status=$?
+    cat conftest.err >&5
+-   echo "$as_me:18416: \$? = $ac_status" >&5
++   echo "$as_me:18422: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s "$ac_outfile"; then
+      # The compiler can only warn and ignore the option if not recognized
+      # So say no if there are warnings other than the usual output.
+@@ -18513,11 +18519,11 @@ else
+    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+    -e 's:$: $lt_compiler_flag:'`
+-   (eval echo "\"\$as_me:18516: $lt_compile\"" >&5)
++   (eval echo "\"\$as_me:18522: $lt_compile\"" >&5)
+    (eval "$lt_compile" 2>out/conftest.err)
+    ac_status=$?
+    cat out/conftest.err >&5
+-   echo "$as_me:18520: \$? = $ac_status" >&5
++   echo "$as_me:18526: \$? = $ac_status" >&5
+    if (exit $ac_status) && test -s out/conftest2.$ac_objext
+    then
+      # The compiler can only warn and ignore the option if not recognized
+@@ -22510,7 +22516,11 @@ fi
+ 
+ 
+ 
+-for ac_func in getgrouplist
++
++
++
++
++for ac_func in getgrouplist readdir64
+ do
+ as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ { echo "$as_me:$LINENO: checking for $ac_func" >&5
+@@ -23072,13 +23082,13 @@ echo "${ECHO_T}$ac_cv_func_pthread_creat
+ if test $ac_cv_func_pthread_create = yes; then
+   :
+ else
+-  { echo "$as_me:$LINENO: checking for pthread_create in -pthread" >&5
+-echo $ECHO_N "checking for pthread_create in -pthread... $ECHO_C" >&6; }
++  { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
++echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; }
+ if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-pthread  $LIBS"
++LIBS="-lpthread  $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+@@ -23134,7 +23144,7 @@ fi
+ { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
+ echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; }
+ if test $ac_cv_lib_pthread_pthread_create = yes; then
+-  SELINUX_THREAD_LIBS="-pthread"
++  SELINUX_THREAD_LIBS="-lpthread"
+ fi
+ 
+ fi
+@@ -24202,6 +24212,14 @@ else
+   OS_TYPE_SALARIS_FALSE=
+ fi
+ 
++ if test x$with_os_type = xfreebsd; then
++  OS_TYPE_FREEBSD_TRUE=
++  OS_TYPE_FREEBSD_FALSE='#'
++else
++  OS_TYPE_FREEBSD_TRUE='#'
++  OS_TYPE_FREEBSD_FALSE=
++fi
++
+ 
+ 
+ # Check whether --with-pam-include was given.
+@@ -24226,6 +24244,11 @@ elif test x$with_os_type = xsuse -o x$wi
+    PAM_FILE_INCLUDE_ACCOUNT=common-account
+    PAM_FILE_INCLUDE_PASSWORD=common-password
+    PAM_FILE_INCLUDE_SESSION=common-session
++elif test x$with_os_type = xfreebsd ; then
++    PAM_FILE_INCLUDE_AUTH=system
++    PAM_FILE_INCLUDE_ACCOUNT=system
++    PAM_FILE_INCLUDE_PASSWORD=system
++    PAM_FILE_INCLUDE_SESSION=system
+ else
+    PAM_FILE_INCLUDE_AUTH=system-auth
+    PAM_FILE_INCLUDE_ACCOUNT=system-auth
+@@ -24268,7 +24291,438 @@ cat >>confdefs.h <<\_ACEOF
+ _ACEOF
+ 
+ 	;;
++  *freebsd*)
++
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_FREEBSD 1
++_ACEOF
++
++	;;
++esac
++
++have_inotify=no
++
++for ac_header in linux/inotify.h
++do
++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++  { echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++ac_res=`eval echo '${'$as_ac_Header'}'`
++	       { echo "$as_me:$LINENO: result: $ac_res" >&5
++echo "${ECHO_T}$ac_res" >&6; }
++else
++  # Is the header compilable?
++{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++#include <$ac_header>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++  *) ac_try_echo=$ac_try;;
++esac
++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++  (eval "$ac_compile") 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } && {
++	 test -z "$ac_c_werror_flag" ||
++	 test ! -s conftest.err
++       } && test -s conftest.$ac_objext; then
++  ac_header_compiler=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++	ac_header_compiler=no
++fi
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6; }
++
++# Is the header present?
++{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <$ac_header>
++_ACEOF
++if { (ac_try="$ac_cpp conftest.$ac_ext"
++case "(($ac_try" in
++  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++  *) ac_try_echo=$ac_try;;
++esac
++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } >/dev/null && {
++	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
++	 test ! -s conftest.err
++       }; then
++  ac_header_preproc=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++  ac_header_preproc=no
++fi
++
++rm -f conftest.err conftest.$ac_ext
++{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6; }
++
++# So?  What about this header?
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
++    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
++    ;;
++  no:yes:* )
++    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
++    ( cat <<\_ASBOX
++## ----------------------------- ##
++## Report this to david at fubar.dk ##
++## ----------------------------- ##
++_ASBOX
++     ) | sed "s/^/$as_me: WARNING:     /" >&2
++    ;;
++esac
++{ echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  eval "$as_ac_Header=\$ac_header_preproc"
++fi
++ac_res=`eval echo '${'$as_ac_Header'}'`
++	       { echo "$as_me:$LINENO: result: $ac_res" >&5
++echo "${ECHO_T}$ac_res" >&6; }
++
++fi
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
++  cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++_ACEOF
++ have_inotify=yes
++fi
++
++done
++
++
++for ac_header in sys/inotify.h
++do
++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++  { echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++ac_res=`eval echo '${'$as_ac_Header'}'`
++	       { echo "$as_me:$LINENO: result: $ac_res" >&5
++echo "${ECHO_T}$ac_res" >&6; }
++else
++  # Is the header compilable?
++{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++#include <$ac_header>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (ac_try="$ac_compile"
++case "(($ac_try" in
++  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++  *) ac_try_echo=$ac_try;;
++esac
++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++  (eval "$ac_compile") 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } && {
++	 test -z "$ac_c_werror_flag" ||
++	 test ! -s conftest.err
++       } && test -s conftest.$ac_objext; then
++  ac_header_compiler=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++	ac_header_compiler=no
++fi
++
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6; }
++
++# Is the header present?
++{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <$ac_header>
++_ACEOF
++if { (ac_try="$ac_cpp conftest.$ac_ext"
++case "(($ac_try" in
++  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++  *) ac_try_echo=$ac_try;;
++esac
++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } >/dev/null && {
++	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
++	 test ! -s conftest.err
++       }; then
++  ac_header_preproc=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++  ac_header_preproc=no
++fi
++
++rm -f conftest.err conftest.$ac_ext
++{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6; }
++
++# So?  What about this header?
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
++    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
++    ;;
++  no:yes:* )
++    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
++    ( cat <<\_ASBOX
++## ----------------------------- ##
++## Report this to david at fubar.dk ##
++## ----------------------------- ##
++_ASBOX
++     ) | sed "s/^/$as_me: WARNING:     /" >&2
++    ;;
++esac
++{ echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  eval "$as_ac_Header=\$ac_header_preproc"
++fi
++ac_res=`eval echo '${'$as_ac_Header'}'`
++	       { echo "$as_me:$LINENO: result: $ac_res" >&5
++echo "${ECHO_T}$ac_res" >&6; }
++
++fi
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
++  cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++_ACEOF
++ have_inotify=yes
++fi
++
++done
++
++
++ if test "x$have_inotify" = "xyes"; then
++  HAVE_INOTIFY_TRUE=
++  HAVE_INOTIFY_FALSE='#'
++else
++  HAVE_INOTIFY_TRUE='#'
++  HAVE_INOTIFY_FALSE=
++fi
++
++
++if test "x$have_inotify" = "xyes" ; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_INOTIFY 1
++_ACEOF
++
++fi
++
++have_kqueue=yes
++
++for ac_func in kqueue
++do
++as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
++{ echo "$as_me:$LINENO: checking for $ac_func" >&5
++echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
++if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define $ac_func innocuous_$ac_func
++
++/* System header to define __stub macros and hopefully few prototypes,
++    which can conflict with char $ac_func (); below.
++    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
++    <limits.h> exists even on freestanding compilers.  */
++
++#ifdef __STDC__
++# include <limits.h>
++#else
++# include <assert.h>
++#endif
++
++#undef $ac_func
++
++/* Override any GCC internal prototype to avoid an error.
++   Use char because int might match the return type of a GCC
++   builtin and then its argument prototype would still apply.  */
++#ifdef __cplusplus
++extern "C"
++#endif
++char $ac_func ();
++/* The GNU C library defines this for functions which it implements
++    to always fail with ENOSYS.  Some functions are actually named
++    something starting with __ and the normal name is an alias.  */
++#if defined __stub_$ac_func || defined __stub___$ac_func
++choke me
++#endif
++
++int
++main ()
++{
++return $ac_func ();
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (ac_try="$ac_link"
++case "(($ac_try" in
++  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++  *) ac_try_echo=$ac_try;;
+ esac
++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++  (eval "$ac_link") 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } && {
++	 test -z "$ac_c_werror_flag" ||
++	 test ! -s conftest.err
++       } && test -s conftest$ac_exeext &&
++       $as_test_x conftest$ac_exeext; then
++  eval "$as_ac_var=yes"
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++	eval "$as_ac_var=no"
++fi
++
++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
++      conftest$ac_exeext conftest.$ac_ext
++fi
++ac_res=`eval echo '${'$as_ac_var'}'`
++	       { echo "$as_me:$LINENO: result: $ac_res" >&5
++echo "${ECHO_T}$ac_res" >&6; }
++if test `eval echo '${'$as_ac_var'}'` = yes; then
++  cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
++_ACEOF
++
++else
++  have_kqueue=no
++fi
++done
++
++
++ if test "x$have_kqueue" = "xyes"; then
++  HAVE_KQUEUE_TRUE=
++  HAVE_KQUEUE_FALSE='#'
++else
++  HAVE_KQUEUE_TRUE='#'
++  HAVE_KQUEUE_FALSE=
++fi
++
++
++if test "x$have_kqueue" = "xyes" ; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_KQUEUE 1
++_ACEOF
++
++fi
+ 
+ # ********************
+ # Internationalisation
+@@ -24678,12 +25132,12 @@ echo "${ECHO_T}$ac_cv_func_bind_textdoma
+ if test $ac_cv_func_bind_textdomain_codeset = yes; then
+   DATADIRNAME=share
+ else
+-  DATADIRNAME=share
++  DATADIRNAME=lib
+ fi
+ 
+     ;;
+     *)
+-    DATADIRNAME=share
++    DATADIRNAME=lib
+     ;;
+     esac
+ fi
+@@ -26102,13 +26556,13 @@ if test $ac_cv_func_bind_textdomain_code
+                DATADIRNAME=share
+ else
+   CATOBJEXT=.mo
+-               DATADIRNAME=share
++               DATADIRNAME=lib
+ fi
+ 
+ 	    ;;
+ 	    *)
+ 	    CATOBJEXT=.mo
+-            DATADIRNAME=share
++            DATADIRNAME=lib
+ 	    ;;
+ 	    esac
+ fi
+@@ -26522,6 +26976,27 @@ echo "$as_me: error: conditional \"OS_TY
+ Usually this means the macro was only invoked conditionally." >&2;}
+    { (exit 1); exit 1; }; }
+ fi
++if test -z "${OS_TYPE_FREEBSD_TRUE}" && test -z "${OS_TYPE_FREEBSD_FALSE}"; then
++  { { echo "$as_me:$LINENO: error: conditional \"OS_TYPE_FREEBSD\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"OS_TYPE_FREEBSD\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++   { (exit 1); exit 1; }; }
++fi
++if test -z "${HAVE_INOTIFY_TRUE}" && test -z "${HAVE_INOTIFY_FALSE}"; then
++  { { echo "$as_me:$LINENO: error: conditional \"HAVE_INOTIFY\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"HAVE_INOTIFY\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++   { (exit 1); exit 1; }; }
++fi
++if test -z "${HAVE_KQUEUE_TRUE}" && test -z "${HAVE_KQUEUE_FALSE}"; then
++  { { echo "$as_me:$LINENO: error: conditional \"HAVE_KQUEUE\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"HAVE_KQUEUE\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++   { (exit 1); exit 1; }; }
++fi
+ 
+   ac_config_commands="$ac_config_commands po/stamp-it"
+ 
+@@ -27294,10 +27769,16 @@ OS_TYPE_PARDUS_TRUE!$OS_TYPE_PARDUS_TRUE
+ OS_TYPE_PARDUS_FALSE!$OS_TYPE_PARDUS_FALSE$ac_delim
+ OS_TYPE_SALARIS_TRUE!$OS_TYPE_SALARIS_TRUE$ac_delim
+ OS_TYPE_SALARIS_FALSE!$OS_TYPE_SALARIS_FALSE$ac_delim
++OS_TYPE_FREEBSD_TRUE!$OS_TYPE_FREEBSD_TRUE$ac_delim
++OS_TYPE_FREEBSD_FALSE!$OS_TYPE_FREEBSD_FALSE$ac_delim
+ PAM_FILE_INCLUDE_AUTH!$PAM_FILE_INCLUDE_AUTH$ac_delim
+ PAM_FILE_INCLUDE_ACCOUNT!$PAM_FILE_INCLUDE_ACCOUNT$ac_delim
+ PAM_FILE_INCLUDE_PASSWORD!$PAM_FILE_INCLUDE_PASSWORD$ac_delim
+ PAM_FILE_INCLUDE_SESSION!$PAM_FILE_INCLUDE_SESSION$ac_delim
++HAVE_INOTIFY_TRUE!$HAVE_INOTIFY_TRUE$ac_delim
++HAVE_INOTIFY_FALSE!$HAVE_INOTIFY_FALSE$ac_delim
++HAVE_KQUEUE_TRUE!$HAVE_KQUEUE_TRUE$ac_delim
++HAVE_KQUEUE_FALSE!$HAVE_KQUEUE_FALSE$ac_delim
+ INTLTOOL_DESKTOP_RULE!$INTLTOOL_DESKTOP_RULE$ac_delim
+ INTLTOOL_DIRECTORY_RULE!$INTLTOOL_DIRECTORY_RULE$ac_delim
+ INTLTOOL_KEYS_RULE!$INTLTOOL_KEYS_RULE$ac_delim
+@@ -27312,12 +27793,6 @@ INTLTOOL_XAM_RULE!$INTLTOOL_XAM_RULE$ac_
+ INTLTOOL_KBD_RULE!$INTLTOOL_KBD_RULE$ac_delim
+ INTLTOOL_XML_RULE!$INTLTOOL_XML_RULE$ac_delim
+ INTLTOOL_XML_NOMERGE_RULE!$INTLTOOL_XML_NOMERGE_RULE$ac_delim
+-INTLTOOL_CAVES_RULE!$INTLTOOL_CAVES_RULE$ac_delim
+-INTLTOOL_SCHEMAS_RULE!$INTLTOOL_SCHEMAS_RULE$ac_delim
+-INTLTOOL_THEME_RULE!$INTLTOOL_THEME_RULE$ac_delim
+-INTLTOOL_SERVICE_RULE!$INTLTOOL_SERVICE_RULE$ac_delim
+-INTLTOOL_POLICY_RULE!$INTLTOOL_POLICY_RULE$ac_delim
+-XGETTEXT!$XGETTEXT$ac_delim
+ _ACEOF
+ 
+   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+@@ -27359,6 +27834,12 @@ _ACEOF
+ ac_delim='%!_!# '
+ for ac_last_try in false false false false false :; do
+   cat >conf$$subs.sed <<_ACEOF
++INTLTOOL_CAVES_RULE!$INTLTOOL_CAVES_RULE$ac_delim
++INTLTOOL_SCHEMAS_RULE!$INTLTOOL_SCHEMAS_RULE$ac_delim
++INTLTOOL_THEME_RULE!$INTLTOOL_THEME_RULE$ac_delim
++INTLTOOL_SERVICE_RULE!$INTLTOOL_SERVICE_RULE$ac_delim
++INTLTOOL_POLICY_RULE!$INTLTOOL_POLICY_RULE$ac_delim
++XGETTEXT!$XGETTEXT$ac_delim
+ MSGMERGE!$MSGMERGE$ac_delim
+ MSGFMT!$MSGFMT$ac_delim
+ INTLTOOL_EXTRACT!$INTLTOOL_EXTRACT$ac_delim
+@@ -27385,7 +27866,7 @@ LIBOBJS!$LIBOBJS$ac_delim
+ LTLIBOBJS!$LTLIBOBJS$ac_delim
+ _ACEOF
+ 
+-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 24; then
++  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 30; then
+     break
+   elif $ac_last_try; then
+     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit-dbus_polkit-resolve-exe-helper.c
@@ -0,0 +1,29 @@
+--- src/polkit-dbus/polkit-resolve-exe-helper.c.orig	2008-04-08 12:23:22.000000000 -0400
++++ src/polkit-dbus/polkit-resolve-exe-helper.c	2008-04-21 23:41:09.000000000 -0400
+@@ -40,6 +40,9 @@
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#ifdef HAVE_FREEBSD
++#include <sys/param.h>
++#endif
+ #include <security/pam_appl.h>
+ #include <grp.h>
+ #include <pwd.h>
+@@ -76,15 +79,8 @@ main (int argc, char *argv[])
+         ret = 1;
+ 
+         /* clear the entire environment to avoid attacks using with libraries honoring environment variables */
+-#ifdef HAVE_SOLARIS
+-	extern char **environ;
+-
+-	if (environ != NULL)
+-		environ[0] = NULL;
+-#else
+-        if (clearenv () != 0)
++        if (kit_clearenv () != 0)
+                 goto out;
+-#endif
+         /* set a minimal environment */
+         setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+ 
--- /dev/null
+++ sysutils/policykit/files/patch-src_polkit_polkit-policy-file.c
@@ -0,0 +1,30 @@
+--- src/polkit/polkit-policy-file.c.orig	2008-04-15 20:33:27.000000000 -0400
++++ src/polkit/polkit-policy-file.c	2008-04-21 23:39:16.000000000 -0400
+@@ -804,27 +804,6 @@ polkit_policy_file_entry_foreach (PolKit
+ 
+         return FALSE;
+ }
+-#ifdef HAVE_SOLARIS
+-char *strndup ( const char *s, size_t n)
+-{
+-        size_t nAvail;
+-        char *p;
+-
+-        if ( !s )
+-                return 0;
+-
+-        if ( strlen(s) > n )
+-                nAvail = n + 1;
+-        else
+-                nAvail = strlen(s) + 1;
+-        p = malloc ( nAvail );
+-        memcpy ( p, s, nAvail );
+-        p[nAvail - 1] = '\0';
+-
+-        return p;
+-}
+-#endif
+-
+ #ifdef POLKIT_BUILD_TESTS
+ 
+ /* this checks that the policy descriptions read from test-valid-3-lang.policy are correct */


More information about the Midnightbsd-cvs mailing list