aboutsummaryrefslogtreecommitdiff
path: root/sysutils/policykit
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/policykit')
-rw-r--r--sysutils/policykit/Makefile3
-rw-r--r--sysutils/policykit/distinfo6
-rw-r--r--sysutils/policykit/files/patch-config.h.in16
-rw-r--r--sysutils/policykit/files/patch-configure269
-rw-r--r--sysutils/policykit/files/patch-configure.in25
-rw-r--r--sysutils/policykit/files/patch-src_kit_Makefile.am10
-rw-r--r--sysutils/policykit/files/patch-src_kit_Makefile.in85
-rw-r--r--sysutils/policykit/files/patch-src_kit_kit-lib.c139
-rw-r--r--sysutils/policykit/files/patch-src_kit_kit-lib.h55
-rw-r--r--sysutils/policykit/files/patch-src_kit_kit-string.c67
-rw-r--r--sysutils/policykit/files/patch-src_kit_kit.h10
-rw-r--r--sysutils/policykit/files/patch-src_polkit-dbus_polkit-read-auth-helper.c22
-rw-r--r--sysutils/policykit/files/patch-src_polkit-dbus_polkit-resolve-exe-helper.c29
-rw-r--r--sysutils/policykit/files/patch-src_polkit-dbus_polkit-set-default-helper.c16
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_Makefile.am12
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_Makefile.in116
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_polkit-explicit-grant-helper.c16
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper-pam.c26
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper.c25
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c69
-rw-r--r--sysutils/policykit/files/patch-src_polkit-grant_polkit-revoke-helper.c16
-rw-r--r--sysutils/policykit/files/patch-src_polkit_polkit-config.c4
-rw-r--r--sysutils/policykit/files/patch-src_polkit_polkit-context.c80
-rw-r--r--sysutils/policykit/files/patch-src_polkit_polkit-policy-file.c30
-rw-r--r--sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.c156
-rw-r--r--sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.h20
-rw-r--r--sysutils/policykit/files/patch-tools_polkit-auth.c140
-rw-r--r--sysutils/policykit/pkg-plist1
28 files changed, 996 insertions, 467 deletions
diff --git a/sysutils/policykit/Makefile b/sysutils/policykit/Makefile
index 29e65832017a..71b8cc2eae6c 100644
--- a/sysutils/policykit/Makefile
+++ b/sysutils/policykit/Makefile
@@ -7,8 +7,7 @@
#
PORTNAME= policykit
-PORTVERSION= 0.7
-PORTREVISION= 5
+PORTVERSION= 0.8
CATEGORIES= sysutils gnome
MASTER_SITES= http://hal.freedesktop.org/releases/
DISTNAME= PolicyKit-${PORTVERSION}
diff --git a/sysutils/policykit/distinfo b/sysutils/policykit/distinfo
index 875461516bb4..a6170a387e74 100644
--- a/sysutils/policykit/distinfo
+++ b/sysutils/policykit/distinfo
@@ -1,3 +1,3 @@
-MD5 (PolicyKit-0.7.tar.gz) = 99e0cc588310656fa25f8f66a411c71f
-SHA256 (PolicyKit-0.7.tar.gz) = 87245f790142a245a5f5ba75d4a4e95612b391e82cf4d61659b3e50c4f6b9eeb
-SIZE (PolicyKit-0.7.tar.gz) = 1214032
+MD5 (PolicyKit-0.8.tar.gz) = 5c1a4445dbd5cb853132766c5d0ab336
+SHA256 (PolicyKit-0.8.tar.gz) = 92ddda8f5ffb0981c9ac50cf419f73796ccee8d94b4c935735f2f30f6ccd21ba
+SIZE (PolicyKit-0.8.tar.gz) = 1226699
diff --git a/sysutils/policykit/files/patch-config.h.in b/sysutils/policykit/files/patch-config.h.in
index b8cb8f384d74..bfe150f60d3a 100644
--- a/sysutils/policykit/files/patch-config.h.in
+++ b/sysutils/policykit/files/patch-config.h.in
@@ -1,5 +1,5 @@
---- config.h.in.orig 2007-11-30 20:43:35.000000000 -0500
-+++ config.h.in 2007-12-24 14:47:06.000000000 -0500
+--- 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
@@ -19,7 +19,17 @@
/* Define if the GNU gettext() function is already present or preinstalled. */
#undef HAVE_GETTEXT
-@@ -117,6 +129,12 @@
+@@ -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
diff --git a/sysutils/policykit/files/patch-configure b/sysutils/policykit/files/patch-configure
index 2e99765e746d..e5a1286b23ef 100644
--- a/sysutils/policykit/files/patch-configure
+++ b/sysutils/policykit/files/patch-configure
@@ -1,9 +1,9 @@
---- configure.bak 2007-11-30 20:42:54.000000000 -0500
-+++ configure 2007-12-23 00:35:53.000000000 -0500
-@@ -929,10 +929,16 @@ OS_TYPE_GENTOO_TRUE
- OS_TYPE_GENTOO_FALSE
- OS_TYPE_PARDUS_TRUE
+--- 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
@@ -17,186 +17,214 @@
INTLTOOL_DESKTOP_RULE
INTLTOOL_DIRECTORY_RULE
INTLTOOL_KEYS_RULE
-@@ -6544,7 +6550,7 @@ ia64-*-hpux*)
+@@ -6555,7 +6561,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
-- echo '#line 6547 "configure"' > conftest.$ac_ext
-+ echo '#line 6553 "configure"' > conftest.$ac_ext
+- 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=$?
-@@ -8882,11 +8888,11 @@ else
+@@ -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:8885: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:8891: $lt_compile\"" >&5)
+- (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:8889: \$? = $ac_status" >&5
-+ echo "$as_me:8895: \$? = $ac_status" >&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.
-@@ -9172,11 +9178,11 @@ else
+@@ -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:9175: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:9181: $lt_compile\"" >&5)
+- (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:9179: \$? = $ac_status" >&5
-+ echo "$as_me:9185: \$? = $ac_status" >&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.
-@@ -9276,11 +9282,11 @@ else
+@@ -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:9279: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:9285: $lt_compile\"" >&5)
+- (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:9283: \$? = $ac_status" >&5
-+ echo "$as_me:9289: \$? = $ac_status" >&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
-@@ -11627,7 +11633,7 @@ else
+@@ -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 11630 "configure"
-+#line 11636 "configure"
+-#line 11641 "configure"
++#line 11647 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
-@@ -11727,7 +11733,7 @@ else
+@@ -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 11730 "configure"
-+#line 11736 "configure"
+-#line 11741 "configure"
++#line 11747 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
-@@ -14147,11 +14153,11 @@ else
+@@ -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:14150: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:14156: $lt_compile\"" >&5)
+- (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:14154: \$? = $ac_status" >&5
-+ echo "$as_me:14160: \$? = $ac_status" >&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.
-@@ -14251,11 +14257,11 @@ else
+@@ -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:14254: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:14260: $lt_compile\"" >&5)
+- (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:14258: \$? = $ac_status" >&5
-+ echo "$as_me:14264: \$? = $ac_status" >&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
-@@ -15815,11 +15821,11 @@ else
+@@ -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:15818: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:15824: $lt_compile\"" >&5)
+- (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:15822: \$? = $ac_status" >&5
-+ echo "$as_me:15828: \$? = $ac_status" >&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.
-@@ -15919,11 +15925,11 @@ else
+@@ -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:15922: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:15928: $lt_compile\"" >&5)
+- (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:15926: \$? = $ac_status" >&5
-+ echo "$as_me:15932: \$? = $ac_status" >&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
-@@ -18108,11 +18114,11 @@ else
+@@ -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:18111: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:18117: $lt_compile\"" >&5)
+- (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:18115: \$? = $ac_status" >&5
-+ echo "$as_me:18121: \$? = $ac_status" >&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.
-@@ -18398,11 +18404,11 @@ else
+@@ -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:18401: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:18407: $lt_compile\"" >&5)
+- (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:18405: \$? = $ac_status" >&5
-+ echo "$as_me:18411: \$? = $ac_status" >&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.
-@@ -18502,11 +18508,11 @@ else
+@@ -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:18505: $lt_compile\"" >&5)
-+ (eval echo "\"\$as_me:18511: $lt_compile\"" >&5)
+- (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:18509: \$? = $ac_status" >&5
-+ echo "$as_me:18515: \$? = $ac_status" >&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
-@@ -22501,7 +22507,9 @@ fi
+@@ -22510,7 +22516,11 @@ fi
-for ac_func in getgrouplist
+
+
-+for ac_func in getgrouplist clearenv strndup getline readdir64
++
++
++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
-@@ -24087,6 +24095,14 @@ else
- OS_TYPE_PARDUS_FALSE=
+@@ -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
@@ -210,7 +238,7 @@
# Check whether --with-pam-include was given.
-@@ -24111,6 +24127,11 @@ elif test x$with_os_type = xsuse ; then
+@@ -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
@@ -222,10 +250,19 @@
else
PAM_FILE_INCLUDE_AUTH=system-auth
PAM_FILE_INCLUDE_ACCOUNT=system-auth
-@@ -24143,6 +24164,430 @@ cat >>confdefs.h <<_ACEOF
+@@ -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
@@ -595,7 +632,7 @@
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
-+esac
+ esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
@@ -649,11 +686,41 @@
+_ACEOF
+
+fi
-+
+
# ********************
# Internationalisation
- # ********************
-@@ -26232,6 +26677,27 @@ echo "$as_me: error: conditional \"OS_TY
+@@ -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
@@ -681,10 +748,10 @@
ac_config_commands="$ac_config_commands po/stamp-it"
-@@ -26995,10 +27461,16 @@ OS_TYPE_GENTOO_TRUE!$OS_TYPE_GENTOO_TRUE
- OS_TYPE_GENTOO_FALSE!$OS_TYPE_GENTOO_FALSE$ac_delim
- OS_TYPE_PARDUS_TRUE!$OS_TYPE_PARDUS_TRUE$ac_delim
+@@ -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
@@ -698,38 +765,38 @@
INTLTOOL_DESKTOP_RULE!$INTLTOOL_DESKTOP_RULE$ac_delim
INTLTOOL_DIRECTORY_RULE!$INTLTOOL_DIRECTORY_RULE$ac_delim
INTLTOOL_KEYS_RULE!$INTLTOOL_KEYS_RULE$ac_delim
-@@ -27022,12 +27494,6 @@ INTLTOOL_EXTRACT!$INTLTOOL_EXTRACT$ac_de
- INTLTOOL_MERGE!$INTLTOOL_MERGE$ac_delim
- INTLTOOL_UPDATE!$INTLTOOL_UPDATE$ac_delim
- INTLTOOL_PERL!$INTLTOOL_PERL$ac_delim
--ALL_LINGUAS!$ALL_LINGUAS$ac_delim
--DATADIRNAME!$DATADIRNAME$ac_delim
--GETTEXT_PACKAGE!$GETTEXT_PACKAGE$ac_delim
--USE_NLS!$USE_NLS$ac_delim
--MSGFMT!$MSGFMT$ac_delim
--MSGFMT_OPTS!$MSGFMT_OPTS$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
-@@ -27069,6 +27535,12 @@ _ACEOF
+@@ -27359,6 +27834,12 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
-+ALL_LINGUAS!$ALL_LINGUAS$ac_delim
-+DATADIRNAME!$DATADIRNAME$ac_delim
-+GETTEXT_PACKAGE!$GETTEXT_PACKAGE$ac_delim
-+USE_NLS!$USE_NLS$ac_delim
-+MSGFMT!$MSGFMT$ac_delim
-+MSGFMT_OPTS!$MSGFMT_OPTS$ac_delim
- GMSGFMT!$GMSGFMT$ac_delim
- XGETTEXT!$XGETTEXT$ac_delim
- CATALOGS!$CATALOGS$ac_delim
-@@ -27085,7 +27557,7 @@ LIBOBJS!$LIBOBJS$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
+ 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` = 14; then
-+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 20; then
+- 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
diff --git a/sysutils/policykit/files/patch-configure.in b/sysutils/policykit/files/patch-configure.in
index d54068c952b8..051789d413f1 100644
--- a/sysutils/policykit/files/patch-configure.in
+++ b/sysutils/policykit/files/patch-configure.in
@@ -1,23 +1,25 @@
---- configure.in.orig 2007-11-25 15:43:40.000000000 -0500
-+++ configure.in 2007-12-23 00:34:37.000000000 -0500
-@@ -169,7 +169,7 @@ PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-
+--- 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 clearenv strndup getline readdir64)
++AC_CHECK_FUNCS(getgrouplist readdir64 getline strndup clearenv)
EXPAT_LIB=""
AC_ARG_WITH(expat, [ --with-expat=<dir> Use expat from here],
-@@ -406,6 +406,7 @@ AM_CONDITIONAL(OS_TYPE_RED_HAT, test x$w
+@@ -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])
-@@ -425,6 +426,11 @@ elif test x$with_os_type = xsuse ; then
+@@ -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
@@ -29,9 +31,14 @@
else
PAM_FILE_INCLUDE_AUTH=system-auth
PAM_FILE_INCLUDE_ACCOUNT=system-auth
-@@ -441,6 +447,25 @@ AC_DEFINE_UNQUOTED(PAM_FILE_INCLUDE_ACCO
- AC_DEFINE_UNQUOTED(PAM_FILE_INCLUDE_PASSWORD, "$PAM_FILE_INCLUDE_PASSWORD", [pam file password])
- AC_DEFINE_UNQUOTED(PAM_FILE_INCLUDE_SESSION, "$PAM_FILE_INCLUDE_SESSION", [pam file session])
+@@ -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])
diff --git a/sysutils/policykit/files/patch-src_kit_Makefile.am b/sysutils/policykit/files/patch-src_kit_Makefile.am
new file mode 100644
index 000000000000..e404ef15289f
--- /dev/null
+++ b/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 \
diff --git a/sysutils/policykit/files/patch-src_kit_Makefile.in b/sysutils/policykit/files/patch-src_kit_Makefile.in
new file mode 100644
index 000000000000..9ac342e14038
--- /dev/null
+++ b/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@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.@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@./$(DEPDIR)/kit-entity.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kit-file.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kit-hash.Plo@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kit-lib.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kit-list.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kit-memory.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kit-message.Plo@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
diff --git a/sysutils/policykit/files/patch-src_kit_kit-lib.c b/sysutils/policykit/files/patch-src_kit_kit-lib.c
new file mode 100644
index 000000000000..0e7789881a91
--- /dev/null
+++ b/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@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
diff --git a/sysutils/policykit/files/patch-src_kit_kit-lib.h b/sysutils/policykit/files/patch-src_kit_kit-lib.h
new file mode 100644
index 000000000000..0dbe31ab6e3e
--- /dev/null
+++ b/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@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 */
++
++
diff --git a/sysutils/policykit/files/patch-src_kit_kit-string.c b/sysutils/policykit/files/patch-src_kit_kit-string.c
index e7b375e05bdd..2c554e5c89b8 100644
--- a/sysutils/policykit/files/patch-src_kit_kit-string.c
+++ b/sysutils/policykit/files/patch-src_kit_kit-string.c
@@ -1,42 +1,31 @@
---- src/kit/kit-string.c.orig 2007-12-23 00:42:03.000000000 -0500
-+++ src/kit/kit-string.c 2007-12-23 00:41:26.000000000 -0500
-@@ -77,7 +77,15 @@ kit_strdup (const char *s)
- out:
- return p;
- }
-+#else /* !KIT_BUILD_TESTS */
-+char *
-+kit_strdup (const char *s)
-+{
-+ return strdup (s);
-+}
-+#endif /* KIT_BUILD_TESTS */
+--- 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:
-+#if defined(KIT_BUILD_TESTS) || !defined(HAVE_STRNDUP)
- /**
- * kit_strndup:
- * @s: string
-@@ -111,13 +119,7 @@ out:
- return p;
- }
-
--#else
--
--char *
--kit_strdup (const char *s)
--{
-- return strdup (s);
--}
-+#else /* !KIT_BUILD_TESTS || HAVE_STRNDUP */
+ #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_strndup (const char *s, size_t n)
-@@ -125,7 +127,7 @@ kit_strndup (const char *s, size_t n)
- return strndup (s, n);
- }
-
--#endif /* KIT_BUILD_TESTS */
-+#endif /* KIT_BUILD_TESTS || !HAVE_STRNDUP */
-
- /**
- * kit_strdup_printf:
+ kit_strdup (const char *s)
+ {
diff --git a/sysutils/policykit/files/patch-src_kit_kit.h b/sysutils/policykit/files/patch-src_kit_kit.h
new file mode 100644
index 000000000000..f2a104379cb7
--- /dev/null
+++ b/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>
diff --git a/sysutils/policykit/files/patch-src_polkit-dbus_polkit-read-auth-helper.c b/sysutils/policykit/files/patch-src_polkit-dbus_polkit-read-auth-helper.c
index d9351cea6771..1b15d60a5ccb 100644
--- a/sysutils/policykit/files/patch-src_polkit-dbus_polkit-read-auth-helper.c
+++ b/sysutils/policykit/files/patch-src_polkit-dbus_polkit-read-auth-helper.c
@@ -1,14 +1,14 @@
---- src/polkit-dbus/polkit-read-auth-helper.c.orig 2007-11-28 23:33:10.000000000 -0500
-+++ src/polkit-dbus/polkit-read-auth-helper.c 2007-12-24 14:53:38.000000000 -0500
+--- 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 <security/pam_appl.h>
#include <grp.h>
-@@ -156,7 +157,11 @@ dump_auths_all (const char *root)
+ #include <pwd.h>
+@@ -159,7 +160,11 @@ dump_auths_all (const char *root)
{
DIR *dir;
int dfd;
@@ -20,7 +20,7 @@
polkit_bool_t ret;
ret = FALSE;
-@@ -173,7 +178,11 @@ dump_auths_all (const char *root)
+@@ -176,7 +181,11 @@ dump_auths_all (const char *root)
goto out;
}
@@ -32,12 +32,20 @@
unsigned int n, m;
uid_t uid;
size_t name_len;
-@@ -282,7 +291,7 @@ main (int argc, char *argv[])
+@@ -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 (polkit_sysdeps_clearenv () != 0)
++ if (kit_clearenv () != 0)
goto out;
+-#endif
/* set a minimal environment */
setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+ #endif
diff --git a/sysutils/policykit/files/patch-src_polkit-dbus_polkit-resolve-exe-helper.c b/sysutils/policykit/files/patch-src_polkit-dbus_polkit-resolve-exe-helper.c
new file mode 100644
index 000000000000..917122572388
--- /dev/null
+++ b/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);
+
diff --git a/sysutils/policykit/files/patch-src_polkit-dbus_polkit-set-default-helper.c b/sysutils/policykit/files/patch-src_polkit-dbus_polkit-set-default-helper.c
index 8361f7c0bef2..681c58dab9bb 100644
--- a/sysutils/policykit/files/patch-src_polkit-dbus_polkit-set-default-helper.c
+++ b/sysutils/policykit/files/patch-src_polkit-dbus_polkit-set-default-helper.c
@@ -1,11 +1,19 @@
---- src/polkit-dbus/polkit-set-default-helper.c.orig 2007-12-23 01:21:04.000000000 -0500
-+++ src/polkit-dbus/polkit-set-default-helper.c 2007-12-23 01:21:11.000000000 -0500
-@@ -127,7 +127,7 @@ main (int argc, char *argv[])
+--- 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 (polkit_sysdeps_clearenv () != 0)
++ if (kit_clearenv () != 0)
goto out;
+-#endif
/* set a minimal environment */
setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_Makefile.am b/sysutils/policykit/files/patch-src_polkit-grant_Makefile.am
index 73f38d381015..a56ba665e44f 100644
--- a/sysutils/policykit/files/patch-src_polkit-grant_Makefile.am
+++ b/sysutils/policykit/files/patch-src_polkit-grant_Makefile.am
@@ -1,11 +1,11 @@
---- src/polkit-grant/Makefile.am.orig 2007-12-23 01:40:02.000000000 -0500
-+++ src/polkit-grant/Makefile.am 2007-12-23 01:40:27.000000000 -0500
-@@ -47,7 +47,7 @@ polkit_grant_helper_SOURCES = polkit-gra
- 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
+--- 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
- polkit_explicit_grant_helper_SOURCES = polkit-explicit-grant-helper.c
- polkit_explicit_grant_helper_CFLAGS = @DBUS_CFLAGS@
+ if POLKIT_AUTHFW_SHADOW
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_Makefile.in b/sysutils/policykit/files/patch-src_polkit-grant_Makefile.in
index 6723a3a127ad..237e077a5afb 100644
--- a/sysutils/policykit/files/patch-src_polkit-grant_Makefile.in
+++ b/sysutils/policykit/files/patch-src_polkit-grant_Makefile.in
@@ -1,11 +1,111 @@
---- src/polkit-grant/Makefile.in.orig 2007-12-23 01:40:49.000000000 -0500
-+++ src/polkit-grant/Makefile.in 2007-12-23 01:41:16.000000000 -0500
-@@ -351,7 +351,7 @@ libpolkit_grant_la_LDFLAGS = -version-in
+--- 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@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 =
++@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE@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@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.@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@polkit_grant_helper_SOURCES = polkit-grant-helper.c
@POLKIT_AUTHDB_DEFAULT_TRUE@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_grant_helper_pam_SOURCES = polkit-grant-helper-pam.c
--@POLKIT_AUTHDB_DEFAULT_TRUE@polkit_grant_helper_pam_LDADD = @AUTH_LIBS@
-+@POLKIT_AUTHDB_DEFAULT_TRUE@polkit_grant_helper_pam_LDADD = @AUTH_LIBS@ $(top_builddir)/src/polkit/libpolkit.la
+ @POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE@polkit_grant_helper_pam_SOURCES = polkit-grant-helper-pam.c
+-@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE@polkit_grant_helper_pam_LDADD = @AUTH_LIBS@
++@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE@polkit_grant_helper_pam_LDADD = @AUTH_LIBS@ $(top_builddir)/src/polkit/libpolkit.la
+ @POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_SHADOW_TRUE@polkit_grant_helper_shadow_SOURCES = polkit-grant-helper-shadow.c
+ @POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_SHADOW_TRUE@polkit_grant_helper_shadow_LDADD = @AUTH_LIBS@
@POLKIT_AUTHDB_DEFAULT_TRUE@polkit_explicit_grant_helper_SOURCES = polkit-explicit-grant-helper.c
- @POLKIT_AUTHDB_DEFAULT_TRUE@polkit_explicit_grant_helper_CFLAGS = @DBUS_CFLAGS@
- @POLKIT_AUTHDB_DEFAULT_TRUE@polkit_explicit_grant_helper_LDADD = $(top_builddir)/src/polkit/libpolkit.la $(top_builddir)/src/polkit-dbus/libpolkit-dbus.la libpolkit-grant.la
+@@ -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
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_polkit-explicit-grant-helper.c b/sysutils/policykit/files/patch-src_polkit-grant_polkit-explicit-grant-helper.c
index cf9689c67396..c88bba833422 100644
--- a/sysutils/policykit/files/patch-src_polkit-grant_polkit-explicit-grant-helper.c
+++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-explicit-grant-helper.c
@@ -1,11 +1,19 @@
---- src/polkit-grant/polkit-explicit-grant-helper.c.orig 2007-12-23 01:24:19.000000000 -0500
-+++ src/polkit-grant/polkit-explicit-grant-helper.c 2007-12-23 01:24:24.000000000 -0500
-@@ -67,7 +67,7 @@ main (int argc, char *argv[])
+--- 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 (polkit_sysdeps_clearenv () != 0)
++ if (kit_clearenv () != 0)
goto out;
+-#endif
/* set a minimal environment */
setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper-pam.c b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper-pam.c
index bb957f167e69..b438c680faf9 100644
--- a/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper-pam.c
+++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper-pam.c
@@ -1,20 +1,28 @@
---- src/polkit-grant/polkit-grant-helper-pam.c.orig 2007-11-28 16:28:31.000000000 -0500
-+++ src/polkit-grant/polkit-grant-helper-pam.c 2007-12-23 02:01:46.000000000 -0500
-@@ -38,6 +38,8 @@
+--- 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 <polkit/polkit.h>
++#include <kit/kit.h>
+
- /* Development aid: define PGH_DEBUG to get debugging output. Do _NOT_
- * enable this in production builds; it may leak passwords and other
- * sensitive information.
-@@ -60,7 +62,7 @@ main (int argc, char *argv[])
+ #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 (polkit_sysdeps_clearenv () != 0)
++ if (kit_clearenv () != 0)
goto error;
+-#endif
/* set a minimal environment */
setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper.c b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper.c
index 0cab8899cf02..ab5d0fbfe184 100644
--- a/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper.c
+++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper.c
@@ -1,11 +1,28 @@
---- src/polkit-grant/polkit-grant-helper.c.orig 2007-12-23 01:23:13.000000000 -0500
-+++ src/polkit-grant/polkit-grant-helper.c 2007-12-23 01:23:19.000000000 -0500
-@@ -546,7 +546,7 @@ main (int argc, char *argv[])
+--- 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 (polkit_sysdeps_clearenv () != 0)
++ if (kit_clearenv () != 0)
goto out;
+-#endif
/* set a minimal environment */
setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c
index c377b9614635..c303dc780704 100644
--- a/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c
+++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c
@@ -1,6 +1,6 @@
---- src/polkit-grant/polkit-grant.c.orig 2007-11-28 16:29:25.000000000 -0500
-+++ src/polkit-grant/polkit-grant.c 2007-12-23 01:25:08.000000000 -0500
-@@ -38,6 +38,7 @@
+--- 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>
@@ -8,12 +8,71 @@
#include <glib.h>
#include "polkit-grant.h"
-@@ -301,7 +302,7 @@ polkit_grant_io_func (PolKitGrant *polki
+@@ -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 (polkit_sysdeps_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
diff --git a/sysutils/policykit/files/patch-src_polkit-grant_polkit-revoke-helper.c b/sysutils/policykit/files/patch-src_polkit-grant_polkit-revoke-helper.c
index c0ff4b64aaa7..8337a1e767d4 100644
--- a/sysutils/policykit/files/patch-src_polkit-grant_polkit-revoke-helper.c
+++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-revoke-helper.c
@@ -1,11 +1,19 @@
---- src/polkit-grant/polkit-revoke-helper.c.orig 2007-12-23 01:22:38.000000000 -0500
-+++ src/polkit-grant/polkit-revoke-helper.c 2007-12-23 01:22:47.000000000 -0500
-@@ -109,7 +109,7 @@ main (int argc, char *argv[])
+--- 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 (polkit_sysdeps_clearenv () != 0)
++ if (kit_clearenv () != 0)
goto out;
+-#endif
/* set a minimal environment */
setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+ #endif
diff --git a/sysutils/policykit/files/patch-src_polkit_polkit-config.c b/sysutils/policykit/files/patch-src_polkit_polkit-config.c
index f5b2e008222a..17201dd1eb1d 100644
--- a/sysutils/policykit/files/patch-src_polkit_polkit-config.c
+++ b/sysutils/policykit/files/patch-src_polkit_polkit-config.c
@@ -1,5 +1,5 @@
---- src/polkit/polkit-config.c.orig 2007-12-23 00:25:46.000000000 -0500
-+++ src/polkit/polkit-config.c 2007-12-23 00:25:51.000000000 -0500
+--- 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>
diff --git a/sysutils/policykit/files/patch-src_polkit_polkit-context.c b/sysutils/policykit/files/patch-src_polkit_polkit-context.c
index b27cd8edd727..dd23504b8eee 100644
--- a/sysutils/policykit/files/patch-src_polkit_polkit-context.c
+++ b/sysutils/policykit/files/patch-src_polkit_polkit-context.c
@@ -1,9 +1,9 @@
---- src/polkit/polkit-context.c.orig 2007-12-04 20:22:41.000000000 -0500
-+++ src/polkit/polkit-context.c 2007-12-23 00:24:45.000000000 -0500
-@@ -39,7 +39,13 @@
- #include <grp.h>
- #include <unistd.h>
- #include <errno.h>
+--- 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
@@ -11,10 +11,10 @@
+#include <sys/time.h>
+#include <fcntl.h>
+#endif
+ #endif
#include <syslog.h>
- #include "polkit-config.h"
-@@ -106,11 +112,19 @@ struct _PolKitContext
+@@ -111,11 +117,19 @@ struct _PolKitContext
polkit_bool_t load_descriptions;
@@ -34,7 +34,7 @@
};
/**
-@@ -144,6 +158,10 @@ polkit_context_new (void)
+@@ -149,6 +163,10 @@ polkit_context_new (void)
polkit_bool_t
polkit_context_init (PolKitContext *pk_context, PolKitError **error)
{
@@ -45,15 +45,7 @@
kit_return_val_if_fail (pk_context != NULL, FALSE);
pk_context->policy_dir = kit_strdup (PACKAGE_DATA_DIR "/PolicyKit/policy");
-@@ -153,6 +171,7 @@ polkit_context_init (PolKitContext *pk_c
-
- /* NOTE: we don't load the configuration file until it's needed */
-
-+#ifdef HAVE_INOTIFY
- if (pk_context->io_add_watch_func != NULL) {
- pk_context->inotify_fd = inotify_init ();
- if (pk_context->inotify_fd < 0) {
-@@ -203,6 +222,88 @@ polkit_context_init (PolKitContext *pk_c
+@@ -209,7 +227,87 @@ polkit_context_init (PolKitContext *pk_c
goto error;
}
}
@@ -61,7 +53,7 @@
+ if (pk_context->io_add_watch_func != NULL) {
+ pk_context->kqueue_fd = kqueue ();
+ if (pk_context->kqueue_fd < 0) {
-+ _pk_debug ("failed to initialize kqueue: %s", strerror (errno));
++ polkit_debug ("failed to initialize kqueue: %s", strerror (errno));
+ /* TODO: set error */
+ goto error;
+ }
@@ -69,7 +61,7 @@
+ /* 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) {
-+ _pk_debug ("failed '" PACKAGE_SYSCONF_DIR "/PolicyKit/PolicyKit.conf' for reading: %s",
++ polkit_debug ("failed '" PACKAGE_SYSCONF_DIR "/PolicyKit/PolicyKit.conf' for reading: %s",
+ strerror (errno));
+ /* TODO: set error */
+ goto error;
@@ -80,7 +72,7 @@
+ NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_RENAME,
+ 0, 0);
+ if (kevent (pk_context->kqueue_fd, &ev, 1, NULL, 0, NULL) == -1) {
-+ _pk_debug ("failed to add watch on file '" PACKAGE_SYSCONF_DIR "/PolicyKit/PolicyKit.conf': %s",
++ 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 */
@@ -90,7 +82,7 @@
+ /* 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) {
-+ _pk_debug ("failed to open '" PACKAGE_DATA_DIR "/PolicyKit/policy for reading: %s",
++ polkit_debug ("failed to open '" PACKAGE_DATA_DIR "/PolicyKit/policy for reading: %s",
+ strerror (errno));
+ /* TODO: set error */
+ goto error;
@@ -101,7 +93,7 @@
+ NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_RENAME,
+ 0, 0);
+ if (kevent (pk_context->kqueue_fd, &ev, 1, NULL, 0, NULL) == -1) {
-+ _pk_debug ("failed to add watch on directory '" PACKAGE_DATA_DIR "/PolicyKit/policy': %s",
++ 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 */
@@ -112,7 +104,7 @@
+ /* 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) {
-+ _pk_debug ("failed to open '" PACKAGE_LOCALSTATE_DIR "/lib/misc/PolicyKit.reload' for reading: %s",
++ polkit_debug ("failed to open '" PACKAGE_LOCALSTATE_DIR "/lib/misc/PolicyKit.reload' for reading: %s",
+ strerror (errno));
+ /* TODO: set error */
+ goto error;
@@ -120,40 +112,31 @@
+
+ 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_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_RENAME | NOTE_ATTRIB,
+ 0, 0);
+ if (kevent (pk_context->kqueue_fd, &ev, 1, NULL, 0, NULL) == -1) {
-+ _pk_debug ("failed to add watch on file '" PACKAGE_LOCALSTATE_DIR "/lib/misc/PolicyKit.reload': %s",
++ 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) {
-+ _pk_debug ("failed to add io watch");
++ polkit_debug ("failed to add io watch");
+ /* TODO: set error */
+ goto error;
+ }
+ }
-+#endif
-
- return TRUE;
- error:
-@@ -296,6 +397,7 @@ polkit_context_io_func (PolKitContext *p
-
- config_changed = FALSE;
-
-+#ifdef HAVE_INOTIFY
- if (fd == pk_context->inotify_fd) {
- /* size of the event structure, not counting name */
- #define EVENT_SIZE (sizeof (struct inotify_event))
-@@ -327,6 +429,36 @@ again:
- i += EVENT_SIZE + event->len;
+ #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];
@@ -172,18 +155,17 @@
+ struct kevent *evptr;
+
+ evptr = &ev[i];
-+ _pk_debug ("ident=%d filter=%d flags=%u fflags=%u",
++ polkit_debug ("ident=%d filter=%d flags=%u fflags=%u",
+ evptr->ident, evptr->filter, evptr->flags, evptr->fflags);
-+ _pk_debug ("config changed!");
++ polkit_debug ("config changed!");
+ config_changed = TRUE;
+
+ i++;
+ }
+ } else {
-+ _pk_debug ("failed to read kqueue event: %s", strerror (errno));
++ polkit_debug ("failed to read kqueue event: %s", strerror (errno));
+ }
+ }
-+#endif
-
- if (config_changed) {
- polkit_context_force_reload (pk_context);
+ #else
+ if (fd == pk_context->inotify_fd) {
+ /* size of the event structure, not counting name */
diff --git a/sysutils/policykit/files/patch-src_polkit_polkit-policy-file.c b/sysutils/policykit/files/patch-src_polkit_polkit-policy-file.c
new file mode 100644
index 000000000000..97450275445f
--- /dev/null
+++ b/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 */
diff --git a/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.c b/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.c
index 147cca500c46..38398eaba15a 100644
--- a/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.c
+++ b/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.c
@@ -1,26 +1,27 @@
---- src/polkit/polkit-sysdeps.c.orig 2007-11-28 16:26:14.000000000 -0500
-+++ src/polkit/polkit-sysdeps.c 2008-03-28 14:36:50.000000000 -0400
-@@ -39,7 +39,6 @@
- #include <grp.h>
- #include <unistd.h>
- #include <errno.h>
--#include <sys/inotify.h>
+--- 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>
-
- #include "polkit-sysdeps.h"
-@@ -82,7 +81,11 @@ polkit_sysdeps_get_start_time_for_pid (p
- start_time = 0;
- contents = NULL;
-
+@@ -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);
++ 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;
-@@ -93,6 +96,36 @@ polkit_sysdeps_get_start_time_for_pid (p
+@@ -117,6 +121,36 @@ polkit_sysdeps_get_start_time_for_pid (p
goto out;
}
@@ -57,132 +58,23 @@
/* start time is the 19th token after the '(process name)' entry */
p = strchr (contents, ')');
-@@ -118,6 +151,7 @@ polkit_sysdeps_get_start_time_for_pid (p
- }
+@@ -143,6 +177,7 @@ polkit_sysdeps_get_start_time_for_pid (p
kit_strfreev (tokens);
+ #endif
+#endif
out:
- kit_free (filename);
-@@ -153,7 +187,11 @@ polkit_sysdeps_get_exe_for_pid (pid_t pi
-
- ret = 0;
-
+ #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);
++ 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);
-@@ -166,6 +204,108 @@ out:
- return ret;
- }
-
-+#ifndef HAVE_GETLINE
-+/* Taken from GNU sed. */
-+/* Read up to (and including) a '\n' from STREAM into *LINEPTR
-+ (and null-terminate it). *LINEPTR is a pointer returned from malloc (or
-+ NULL), pointing to *N characters of space. It is realloc'd as
-+ necessary. Returns the number of characters read (not including the
-+ null terminator), or -1 on error or EOF. */
-+
-+ssize_t
-+polkit_sysdeps_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
-+polkit_sysdeps_getline (char **lineptr, size_t *n, FILE *stream)
-+{
-+ return getline (lineptr, n, stream);
-+}
-+#endif
-+
-+#ifndef HAVE_CLEARENV
-+extern char **environ;
-+int
-+polkit_sysdeps_clearenv (void)
-+{
-+ if (environ != NULL) {
-+ environ[0] = NULL;
-+ }
-+ return 0;
-+}
-+#else
-+int
-+polkit_sysdeps_clearenv (void)
-+{
-+ return clearenv ();
-+}
-+#endif
-+
- #ifdef POLKIT_BUILD_TESTS
-
- static polkit_bool_t
diff --git a/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.h b/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.h
deleted file mode 100644
index da4be3497c55..000000000000
--- a/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.h
+++ /dev/null
@@ -1,20 +0,0 @@
---- src/polkit/polkit-sysdeps.h.orig 2007-12-23 01:46:49.000000000 -0500
-+++ src/polkit/polkit-sysdeps.h 2007-12-23 01:48:22.000000000 -0500
-@@ -35,6 +35,7 @@
- #define POLKIT_SYSDEPS_H
-
- #include <sys/types.h>
-+#include <stdio.h>
- #include <polkit/polkit-types.h>
-
- POLKIT_BEGIN_DECLS
-@@ -43,6 +44,9 @@ polkit_uint64_t polkit_sysdeps_get_start
-
- int polkit_sysdeps_get_exe_for_pid (pid_t pid, char *out_buf, size_t buf_size);
-
-+ssize_t polkit_sysdeps_getline (char **lineptr, size_t *n, FILE *stream);
-+
-+int polkit_sysdeps_clearenv (void);
-
- POLKIT_END_DECLS
-
diff --git a/sysutils/policykit/files/patch-tools_polkit-auth.c b/sysutils/policykit/files/patch-tools_polkit-auth.c
index f3ee42d1f55d..3f8ad0402631 100644
--- a/sysutils/policykit/files/patch-tools_polkit-auth.c
+++ b/sysutils/policykit/files/patch-tools_polkit-auth.c
@@ -1,61 +1,89 @@
---- tools/polkit-auth.c.orig 2007-12-05 22:30:18.000000000 -0500
-+++ tools/polkit-auth.c 2007-12-23 01:43:36.000000000 -0500
-@@ -37,12 +37,13 @@
+--- 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>
-+#include <sys/wait.h>
+-#ifdef HAVE_SOLARIS
++#if defined(HAVE_SOLARIS) || defined(HAVE_FREEBSD)
+ #include <sys/wait.h>
+ #endif
#include <pwd.h>
- #include <grp.h>
- #include <unistd.h>
- #include <errno.h>
- #include <termios.h>
+@@ -72,6 +72,77 @@ typedef struct {
+ GMainLoop *loop;
+ } UserData;
- #include <polkit-dbus/polkit-dbus.h>
- #include <polkit-grant/polkit-grant.h>
-
-@@ -107,7 +109,7 @@ conversation_select_admin_user (PolKitGr
- }
- printf ("\n");
- printf ("Select user: ");
-- getline (&lineptr, &linelen, stdin);
-+ polkit_sysdeps_getline (&lineptr, &linelen, stdin);
- user = strdup (lineptr);
- free (lineptr);
- return user;
-@@ -133,7 +135,7 @@ conversation_pam_prompt_echo_off (PolKit
- exit (1);
- }
-
-- getline (&lineptr, &linelen, stdin);
-+ polkit_sysdeps_getline (&lineptr, &linelen, stdin);
-
- /* Restore terminal. */
- tcsetattr (fileno (stdout), TCSAFLUSH, &old);
-@@ -151,7 +153,7 @@ conversation_pam_prompt_echo_on (PolKitG
- size_t linelen = 0;
- char *result;
- printf ("%s", request);
-- getline (&lineptr, &linelen, stdin);
-+ polkit_sysdeps_getline (&lineptr, &linelen, stdin);
- result = strdup (lineptr);
- free (lineptr);
- printf ("\n");
-@@ -189,7 +191,7 @@ conversation_override_grant_type (PolKit
- case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_SESSION:
- printf ("Keep this privilege for the session? [no/session]?\n");
- again:
-- getline (&lineptr, &linelen, stdin);
-+ polkit_sysdeps_getline (&lineptr, &linelen, stdin);
- if (g_str_has_prefix (lineptr, "no")) {
- ;
- } else if (g_str_has_prefix (lineptr, "session")) {
-@@ -204,7 +206,7 @@ conversation_override_grant_type (PolKit
- case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_ALWAYS:
- printf ("Keep this privilege for the session or always? [no/session/always]?\n");
- again2:
-- getline (&lineptr, &linelen, stdin);
-+ polkit_sysdeps_getline (&lineptr, &linelen, stdin);
- if (g_str_has_prefix (lineptr, "no")) {
- ;
- } else if (g_str_has_prefix (lineptr, "session")) {
++#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)
+ {
diff --git a/sysutils/policykit/pkg-plist b/sysutils/policykit/pkg-plist
index ac34e84b4327..bdce110677de 100644
--- a/sysutils/policykit/pkg-plist
+++ b/sysutils/policykit/pkg-plist
@@ -48,6 +48,7 @@ libexec/polkit-explicit-grant-helper
libexec/polkit-grant-helper
libexec/polkit-grant-helper-pam
libexec/polkit-read-auth-helper
+libexec/polkit-resolve-exe-helper
libexec/polkit-revoke-helper
libexec/polkit-set-default-helper
libexec/polkitd