diff options
author | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2008-01-08 14:44:09 +0800 |
---|---|---|
committer | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2008-01-08 14:44:09 +0800 |
commit | cf2086594a8ee7a5b1d54ec1ffbca691ce6b4908 (patch) | |
tree | dd0533f5e8616b8152af21c534f00e18fcd0f349 /sysutils/policykit/files | |
parent | 213ce9409fd4c2c0e0a59565137e80eb0529a7d8 (diff) | |
download | marcuscom-ports-cf2086594a8ee7a5b1d54ec1ffbca691ce6b4908.tar marcuscom-ports-cf2086594a8ee7a5b1d54ec1ffbca691ce6b4908.tar.gz marcuscom-ports-cf2086594a8ee7a5b1d54ec1ffbca691ce6b4908.tar.bz2 marcuscom-ports-cf2086594a8ee7a5b1d54ec1ffbca691ce6b4908.tar.lz marcuscom-ports-cf2086594a8ee7a5b1d54ec1ffbca691ce6b4908.tar.xz marcuscom-ports-cf2086594a8ee7a5b1d54ec1ffbca691ce6b4908.tar.zst marcuscom-ports-cf2086594a8ee7a5b1d54ec1ffbca691ce6b4908.zip |
Update to 0.7.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@10021 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'sysutils/policykit/files')
24 files changed, 1591 insertions, 0 deletions
diff --git a/sysutils/policykit/files/patch-Makefile.in b/sysutils/policykit/files/patch-Makefile.in new file mode 100644 index 000000000..29a907e44 --- /dev/null +++ b/sysutils/policykit/files/patch-Makefile.in @@ -0,0 +1,11 @@ +--- Makefile.in.orig 2007-12-22 19:11:03.000000000 -0500 ++++ Makefile.in 2007-12-22 19:11:13.000000000 -0500 +@@ -246,7 +246,7 @@ sysconfdir = @sysconfdir@ + target_alias = @target_alias@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ +-SUBDIRS = data src polkitd doc tools policy po test ++SUBDIRS = data src polkitd doc tools policy po + EXTRA_DIST = \ + HACKING \ + mkinstalldirs \ diff --git a/sysutils/policykit/files/patch-config.h.in b/sysutils/policykit/files/patch-config.h.in new file mode 100644 index 000000000..b8cb8f384 --- /dev/null +++ b/sysutils/policykit/files/patch-config.h.in @@ -0,0 +1,34 @@ +--- config.h.in.orig 2007-11-30 20:43:35.000000000 -0500 ++++ config.h.in 2007-12-24 14:47:06.000000000 -0500 +@@ -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 + +@@ -117,6 +129,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 + diff --git a/sysutils/policykit/files/patch-configure b/sysutils/policykit/files/patch-configure new file mode 100644 index 000000000..2e99765e7 --- /dev/null +++ b/sysutils/policykit/files/patch-configure @@ -0,0 +1,735 @@ +--- 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 + OS_TYPE_PARDUS_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 +@@ -6544,7 +6550,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 + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +@@ -8882,11 +8888,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 "$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 + 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 + -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 "$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 + 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 + -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 "$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 + 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 + 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" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -11727,7 +11733,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" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -14147,11 +14153,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 "$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 + 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 + -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 "$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 + 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 + -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 "$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 + 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 + -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 "$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 + 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 + -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 "$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 + 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 + -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 "$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 + 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 + -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 "$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 + 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 + + + +-for ac_func in getgrouplist ++ ++ ++for ac_func in getgrouplist clearenv strndup getline 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= + 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. +@@ -24111,6 +24127,11 @@ elif test x$with_os_type = xsuse ; then + 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 +@@ -24143,6 +24164,430 @@ cat >>confdefs.h <<_ACEOF + _ACEOF + + ++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@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@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 + # ******************** +@@ -26232,6 +26677,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" + +@@ -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 + OS_TYPE_PARDUS_FALSE!$OS_TYPE_PARDUS_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 +@@ -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 + _ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then +@@ -27069,6 +27535,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 + 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 + 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 new file mode 100644 index 000000000..d54068c95 --- /dev/null +++ b/sysutils/policykit/files/patch-configure.in @@ -0,0 +1,57 @@ +--- 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- + AC_SUBST(DBUS_GLIB_CFLAGS) + AC_SUBST(DBUS_GLIB_LIBS) + +-AC_CHECK_FUNCS(getgrouplist) ++AC_CHECK_FUNCS(getgrouplist clearenv strndup getline readdir64) + + 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 + 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_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 + 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 +@@ -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]) + ++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 + # ******************** diff --git a/sysutils/policykit/files/patch-data_Makefile.in b/sysutils/policykit/files/patch-data_Makefile.in new file mode 100644 index 000000000..f32ab19c0 --- /dev/null +++ b/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) diff --git a/sysutils/policykit/files/patch-src_kit_kit-file.c b/sysutils/policykit/files/patch-src_kit_kit-file.c new file mode 100644 index 000000000..af3ffe0f4 --- /dev/null +++ b/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++; diff --git a/sysutils/policykit/files/patch-src_kit_kit-file.h b/sysutils/policykit/files/patch-src_kit_kit-file.h new file mode 100644 index 000000000..ae2a2ac71 --- /dev/null +++ b/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 diff --git a/sysutils/policykit/files/patch-src_kit_kit-spawn.c b/sysutils/policykit/files/patch-src_kit_kit-spawn.c new file mode 100644 index 000000000..7fbee5ec7 --- /dev/null +++ b/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" diff --git a/sysutils/policykit/files/patch-src_kit_kit-string.c b/sysutils/policykit/files/patch-src_kit_kit-string.c new file mode 100644 index 000000000..e7b375e05 --- /dev/null +++ b/sysutils/policykit/files/patch-src_kit_kit-string.c @@ -0,0 +1,42 @@ +--- 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 */ + ++#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 */ + + 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: 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 new file mode 100644 index 000000000..d9351cea6 --- /dev/null +++ b/sysutils/policykit/files/patch-src_polkit-dbus_polkit-read-auth-helper.c @@ -0,0 +1,43 @@ +--- 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 +@@ -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) + { + DIR *dir; + int dfd; ++#ifdef HAVE_READDIR64 + struct dirent64 *d; ++#else ++ struct dirent *d; ++#endif + polkit_bool_t ret; + + ret = FALSE; +@@ -173,7 +178,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; +@@ -282,7 +291,7 @@ main (int argc, char *argv[]) + + #ifndef POLKIT_BUILD_TESTS + /* clear the entire environment to avoid attacks using with libraries honoring environment variables */ +- if (clearenv () != 0) ++ if (polkit_sysdeps_clearenv () != 0) + goto out; + /* 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 new file mode 100644 index 000000000..8361f7c0b --- /dev/null +++ b/sysutils/policykit/files/patch-src_polkit-dbus_polkit-set-default-helper.c @@ -0,0 +1,11 @@ +--- 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[]) + + ret = 1; + /* clear the entire environment to avoid attacks using with libraries honoring environment variables */ +- if (clearenv () != 0) ++ if (polkit_sysdeps_clearenv () != 0) + goto out; + /* 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 new file mode 100644 index 000000000..73f38d381 --- /dev/null +++ b/sysutils/policykit/files/patch-src_polkit-grant_Makefile.am @@ -0,0 +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 + + 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 + + polkit_explicit_grant_helper_SOURCES = polkit-explicit-grant-helper.c + polkit_explicit_grant_helper_CFLAGS = @DBUS_CFLAGS@ diff --git a/sysutils/policykit/files/patch-src_polkit-grant_Makefile.in b/sysutils/policykit/files/patch-src_polkit-grant_Makefile.in new file mode 100644 index 000000000..6723a3a12 --- /dev/null +++ b/sysutils/policykit/files/patch-src_polkit-grant_Makefile.in @@ -0,0 +1,11 @@ +--- 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 + @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_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 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 new file mode 100644 index 000000000..cf9689c67 --- /dev/null +++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-explicit-grant-helper.c @@ -0,0 +1,11 @@ +--- 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[]) + ret = 1; + + /* clear the entire environment to avoid attacks using with libraries honoring environment variables */ +- if (clearenv () != 0) ++ if (polkit_sysdeps_clearenv () != 0) + goto out; + /* 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 new file mode 100644 index 000000000..bb957f167 --- /dev/null +++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper-pam.c @@ -0,0 +1,20 @@ +--- 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 @@ + #include <syslog.h> + #include <security/pam_appl.h> + ++#include <polkit/polkit.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[]) + pam_h = NULL; + + /* clear the entire environment to avoid attacks using with libraries honoring environment variables */ +- if (clearenv () != 0) ++ if (polkit_sysdeps_clearenv () != 0) + goto error; + /* 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 new file mode 100644 index 000000000..0cab8899c --- /dev/null +++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant-helper.c @@ -0,0 +1,11 @@ +--- 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[]) + ret = 3; + + /* clear the entire environment to avoid attacks using with libraries honoring environment variables */ +- if (clearenv () != 0) ++ if (polkit_sysdeps_clearenv () != 0) + goto out; + /* 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 new file mode 100644 index 000000000..c377b9614 --- /dev/null +++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-grant.c @@ -0,0 +1,19 @@ +--- 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 @@ + #include <sys/types.h> + #include <unistd.h> + #include <sys/wait.h> ++#include <signal.h> + + #include <glib.h> + #include "polkit-grant.h" +@@ -301,7 +302,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) { + if (strlen (line) > 0 && + line[strlen (line) - 1] == '\n') + line[strlen (line) - 1] = '\0'; 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 new file mode 100644 index 000000000..c0ff4b64a --- /dev/null +++ b/sysutils/policykit/files/patch-src_polkit-grant_polkit-revoke-helper.c @@ -0,0 +1,11 @@ +--- 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[]) + + #ifndef POLKIT_BUILD_TESTS + /* clear the entire environment to avoid attacks using with libraries honoring environment variables */ +- if (clearenv () != 0) ++ if (polkit_sysdeps_clearenv () != 0) + goto out; + /* set a minimal environment */ + setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1); diff --git a/sysutils/policykit/files/patch-src_polkit_polkit-config.c b/sysutils/policykit/files/patch-src_polkit_polkit-config.c new file mode 100644 index 000000000..f5b2e0082 --- /dev/null +++ b/sysutils/policykit/files/patch-src_polkit_polkit-config.c @@ -0,0 +1,10 @@ +--- 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 +@@ -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> diff --git a/sysutils/policykit/files/patch-src_polkit_polkit-context.c b/sysutils/policykit/files/patch-src_polkit_polkit-context.c new file mode 100644 index 000000000..b27cd8edd --- /dev/null +++ b/sysutils/policykit/files/patch-src_polkit_polkit-context.c @@ -0,0 +1,189 @@ +--- 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> ++#ifdef HAVE_INOTIFY + #include <sys/inotify.h> ++#elif HAVE_KQUEUE ++#include <sys/event.h> ++#include <sys/time.h> ++#include <fcntl.h> ++#endif + #include <syslog.h> + + #include "polkit-config.h" +@@ -106,11 +112,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 + }; + + /** +@@ -144,6 +158,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"); +@@ -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 + goto error; + } + } ++#elif HAVE_KQUEUE ++ 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)); ++ /* 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) { ++ _pk_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) { ++ _pk_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) { ++ _pk_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) { ++ _pk_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) { ++ _pk_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, ++ 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", ++ 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"); ++ /* 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; + } + } ++#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]; ++ _pk_debug ("ident=%d filter=%d flags=%u fflags=%u", ++ evptr->ident, evptr->filter, evptr->flags, evptr->fflags); ++ _pk_debug ("config changed!"); ++ config_changed = TRUE; ++ ++ i++; ++ } ++ } else { ++ _pk_debug ("failed to read kqueue event: %s", strerror (errno)); ++ } ++ } ++#endif + + if (config_changed) { + polkit_context_force_reload (pk_context); diff --git a/sysutils/policykit/files/patch-src_polkit_polkit-policy-cache.c b/sysutils/policykit/files/patch-src_polkit_polkit-policy-cache.c new file mode 100644 index 000000000..793b53110 --- /dev/null +++ b/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; diff --git a/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.c b/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.c new file mode 100644 index 000000000..c8e4935f1 --- /dev/null +++ b/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.c @@ -0,0 +1,187 @@ +--- src/polkit/polkit-sysdeps.c.orig 2007-11-28 16:26:14.000000000 -0500 ++++ src/polkit/polkit-sysdeps.c 2008-01-02 00:42:47.000000000 -0500 +@@ -39,7 +39,6 @@ + #include <grp.h> + #include <unistd.h> + #include <errno.h> +-#include <sys/inotify.h> + #include <syslog.h> + + #include "polkit-sysdeps.h" +@@ -82,7 +81,11 @@ polkit_sysdeps_get_start_time_for_pid (p + start_time = 0; + contents = NULL; + ++#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; +@@ -93,6 +96,35 @@ 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); ++ 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, ')'); +@@ -118,6 +150,7 @@ polkit_sysdeps_get_start_time_for_pid (p + } + + kit_strfreev (tokens); ++#endif + + out: + kit_free (filename); +@@ -153,7 +186,11 @@ polkit_sysdeps_get_exe_for_pid (pid_t pi + + ret = 0; + ++#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); +@@ -166,6 +203,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 new file mode 100644 index 000000000..da4be3497 --- /dev/null +++ b/sysutils/policykit/files/patch-src_polkit_polkit-sysdeps.h @@ -0,0 +1,20 @@ +--- 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 new file mode 100644 index 000000000..f3ee42d1f --- /dev/null +++ b/sysutils/policykit/files/patch-tools_polkit-auth.c @@ -0,0 +1,61 @@ +--- 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 @@ + #include <stdlib.h> + #include <string.h> + #include <sys/types.h> ++#include <sys/wait.h> + #include <pwd.h> + #include <grp.h> + #include <unistd.h> + #include <errno.h> + #include <termios.h> + + #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")) { |