summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2014-04-23 17:48:34 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2014-04-23 17:48:34 +0200
commitea7c8b878c4a38e4807901155fdf6efd8e4f632e (patch)
tree46a5592d7062e960ca84cff5cdefe166402a4d68
parenta363431da71c7de6bd4392866ebefbb2329c1b77 (diff)
downloadconsolekit-ea7c8b878c4a38e4807901155fdf6efd8e4f632e.tar.gz
add missing misc_kfreebsd_fixes.diff
-rw-r--r--debian/patches/misc_kfreebsd_fixes.diff71
1 files changed, 71 insertions, 0 deletions
diff --git a/debian/patches/misc_kfreebsd_fixes.diff b/debian/patches/misc_kfreebsd_fixes.diff
new file mode 100644
index 0000000..dfe8844
--- /dev/null
+++ b/debian/patches/misc_kfreebsd_fixes.diff
@@ -0,0 +1,71 @@
+--- a/src/ck-sysdeps-unix.c
++++ b/src/ck-sysdeps-unix.c
+@@ -100,6 +100,15 @@
+ if (ucred != NULL) {
+ ucred_free (ucred);
+ }
++#elif defined(HAVE_GETPEEREID)
++ gid_t dummy;
++
++ if (getpeereid (socket_fd, &uid_read, &dummy) == 0) {
++ ret = TRUE;
++ } else {
++ g_warning ("Failed to getpeereid() credentials: %s\n",
++ g_strerror (errno));
++ }
+ #else /* !SO_PEERCRED && !HAVE_GETPEERUCRED */
+ g_warning ("Socket credentials not supported on this OS\n");
+ #endif
+@@ -129,7 +138,7 @@
+ {
+ #ifdef __linux__
+ struct vt_stat vts;
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ int vers;
+ #endif
+ int kb_ok;
+@@ -137,7 +146,7 @@
+ errno = 0;
+ #ifdef __linux__
+ kb_ok = (ioctl (fd, VT_GETSTATE, &vts) == 0);
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ kb_ok = (ioctl (fd, CONS_GETVERS, &vers) == 0);
+ #else
+ kb_ok = 1;
+--- a/tools/Makefile.am
++++ b/tools/Makefile.am
+@@ -11,7 +11,7 @@
+ endif
+
+ if CK_COMPILE_FREEBSD
+-SUBDIRS += freebsd
++SUBDIRS += linux
+ endif
+
+ if CK_COMPILE_SOLARIS
+--- a/configure.ac
++++ b/configure.ac
+@@ -83,10 +83,19 @@
+ EXTRA_COMPILE_WARNINGS(yes)
+
+ # Solaris requires libresolv for daemon()
+-case "$host" in
+- *-*-solaris*)
++case "$host_os" in
++ solaris*)
+ AC_CHECK_LIB(resolv, daemon, [CONSOLE_KIT_LIBS="$CONSOLE_KIT_LIBS -lresolv"])
+ ;;
++ kfreebsd*-gnu)
++ have_getpeereid=no
++ AC_CHECK_LIB(bsd, getpeereid, have_getpeereid=yes)
++ if test "x$have_getpeereid" = "xyes"; then
++ CONSOLE_KIT_LIBS="${CONSOLE_KIT_LIBS} -lbsd"
++ TOOLS_LIBS="${TOOLS_LIBS} -lbsd"
++ AC_DEFINE(HAVE_GETPEEREID, [], [Define if we have getpeereid])
++ fi
++ ;;
+ esac
+
+