Update to consolekit-0.4.4.

Make sure we don't try and use /proc.
s/KERN_PROC2/KERN_PROC

ok jasper@
This commit is contained in:
ajacoutot 2011-04-28 13:08:33 +00:00
parent 8c8429a47c
commit 03b8f5bd01
17 changed files with 311 additions and 173 deletions

View File

@ -1,17 +1,15 @@
# $OpenBSD: Makefile,v 1.15 2011/03/02 06:50:23 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.16 2011/04/28 13:08:33 ajacoutot Exp $
COMMENT= framework for defining and tracking users
DISTNAME= ConsoleKit-0.4.1
DISTNAME= ConsoleKit-0.4.4
PKGNAME= ${DISTNAME:L}
REVISION= 3
CATEGORIES= sysutils
EXTRACT_SUFX= .tar.bz2
SHARED_LIBS+= ck-connector 0.0
SHARED_LIBS+= ck-connector 1.0
HOMEPAGE= http://www.freedesktop.org/wiki/Software/ConsoleKit
@ -23,7 +21,7 @@ PERMIT_DISTFILES_FTP= Yes
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
WANTLIB += X11 Xau Xdmcp c dbus-1 dbus-glib-1 eggdbus-1 gio-2.0
WANTLIB += X11 Xau Xdmcp c dbus-1 dbus-glib-1 gio-2.0
WANTLIB += glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0 kvm pcre
WANTLIB += pthread pthread-stubs xcb z polkit-gobject-1
@ -31,13 +29,16 @@ MASTER_SITES= http://www.freedesktop.org/software/ConsoleKit/dist/
MODULES= devel/gettext
LIB_DEPENDS= sysutils/polkit
LIB_DEPENDS= sysutils/polkit>=0.101 \
x11/dbus-glib
AUTOCONF_VERSION= 2.63
AUTOCONF_VERSION= 2.64
CONFIGURE_STYLE= autoconf
CONFIGURE_ENV= CFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include"
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_ARGS= ${CONFIGURE_SHARED} \
--localstatedir=/var \
--disable-silent-rules \
--with-pid-file=/var/run/ConsoleKit/pid \
--enable-pam-module=no
@ -52,12 +53,8 @@ pre-patch:
cp -R freebsd openbsd && \
perl -pi -e "s,freebsd,openbsd,g" openbsd/Makefile.in
# from FreeBSD ports and Slackware Linux
# from Slackware Linux
post-install:
${INSTALL_SCRIPT} ${FILESDIR}/ck-get-x11-display-device \
${PREFIX}/libexec/ck-get-x11-display-device
${INSTALL_SCRIPT} ${FILESDIR}/ck-get-x11-server-pid \
${PREFIX}/libexec/ck-get-x11-server-pid
${INSTALL_SCRIPT} ${FILESDIR}/pam-foreground-compat.ck \
${PREFIX}/lib/ConsoleKit/run-session.d/pam-foreground-compat.ck

View File

@ -1,5 +1,5 @@
MD5 (ConsoleKit-0.4.1.tar.bz2) = SO2kSDzJeEHV+I6OAD621w==
RMD160 (ConsoleKit-0.4.1.tar.bz2) = gAB2ZFE0rWPVguqf+zraAROjLbE=
SHA1 (ConsoleKit-0.4.1.tar.bz2) = qyuGQ8Hmlt9Nx52e4DI73JWqpqE=
SHA256 (ConsoleKit-0.4.1.tar.bz2) = 8DKtxhRtdFA0MVBUxYIqegnzDiCkDW6AIiH6l3NUQD4=
SIZE (ConsoleKit-0.4.1.tar.bz2) = 398080
MD5 (ConsoleKit-0.4.4.tar.bz2) = tX6xjq6MTTYx1fTwMCGKKQ==
RMD160 (ConsoleKit-0.4.4.tar.bz2) = 6aN9jHGpyNCWRr5dEF7Z7PRem1o=
SHA1 (ConsoleKit-0.4.4.tar.bz2) = Fj7g5jCLlN1HEsxk1aNOjJAH1dQ=
SHA256 (ConsoleKit-0.4.4.tar.bz2) = 8MAJaftv59YoBx8PQ6wNQRmCpeeY19wxdHyqdyyXFq4=
SIZE (ConsoleKit-0.4.4.tar.bz2) = 424699

View File

@ -1,35 +0,0 @@
#!/bin/sh
FSTAT="/usr/bin/fstat"
GREP="/usr/bin/grep"
AWK="/usr/bin/awk"
SED="/usr/bin/sed"
CAT="/bin/cat"
HEAD="/usr/bin/head"
dispnum=0
if [ x"$1" = x"--display" ]; then
if [ $# != 2 ]; then
echo "usage: $0 [--display DISPLAY]"
exit 1
fi
DISPLAY=$2
fi
if [ ! -z "${DISPLAY}" ]; then
dispnum=$(echo ${DISPLAY} | ${SED} -E -e 's|:([0-9]+).*|\1|')
fi
if [ ! -f "/tmp/.X${dispnum}-lock" ]; then
echo "ERROR: Failed to find X lock file for display ${dispnum}"
exit 1
fi
pid=$(${CAT} "/tmp/.X${dispnum}-lock")
device=$(${FSTAT} -p ${pid} | ${GREP} ttyC | ${HEAD} -1 | ${AWK} '{print $9}')
if [ -z "${device}" ]; then
echo "ERROR: Failed to find TTY device for X server on display ${dispnum}"
exit 1
fi
echo "/dev/${device}"

View File

@ -1,17 +0,0 @@
#!/bin/sh
SED="/usr/bin/sed"
CAT="/bin/cat"
dispnum=0
if [ ! -z "${DISPLAY}" ]; then
dispnum=$(echo ${DISPLAY} | ${SED} -E -e 's|:([0-9]+).*|\1|')
fi
if [ ! -f "/tmp/.X${dispnum}-lock" ]; then
echo "ERROR: Failed to find X lock file for display ${dispnum}"
exit 1
fi
pid=$(${CAT} "/tmp/.X${dispnum}-lock")
echo ${pid}

View File

@ -1,19 +1,19 @@
$OpenBSD: patch-configure_ac,v 1.4 2010/06/27 22:15:38 ajacoutot Exp $
--- configure.ac.orig Thu Sep 24 08:22:12 2009
+++ configure.ac Sun Jun 27 20:50:10 2010
$OpenBSD: patch-configure_ac,v 1.5 2011/04/28 13:08:33 ajacoutot Exp $
--- configure.ac.orig Tue Oct 26 16:34:03 2010
+++ configure.ac Tue Nov 30 15:34:31 2010
@@ -176,6 +176,14 @@ dnl --------------------------------------------------
CK_BACKEND=""
KVM_LIBS=""
case "$host" in
+ *-*-openbsd*)
+ CK_BACKEND="openbsd"
+ *-*-openbsd*)
+ CK_BACKEND="openbsd"
+ AC_CHECK_LIB(kvm, kvm_openfiles, have_kvm=yes,
+ AC_MSG_ERROR([Unable to find libkvm which is needed on OpenBSD]))
+ if test "x$have_kvm" = "xyes"; then
+ KVM_LIBS="-lkvm"
+ fi
+ ;;
*-*-freebsd*)
*-*-freebsd* | *-*-kfreebsd*-gnu)
CK_BACKEND="freebsd"
AC_CHECK_LIB(kvm, kvm_openfiles, have_kvm=yes,
@@ -199,6 +207,7 @@ AC_SUBST(KVM_LIBS)
@ -24,7 +24,7 @@ $OpenBSD: patch-configure_ac,v 1.4 2010/06/27 22:15:38 ajacoutot Exp $
AM_CONDITIONAL(CK_COMPILE_SOLARIS, test x$CK_BACKEND = xsolaris, [Compiling for Solaris])
AC_SUBST(CK_BACKEND)
@@ -399,6 +408,7 @@ src/Makefile
@@ -408,6 +417,7 @@ src/Makefile
tools/Makefile
tools/linux/Makefile
tools/freebsd/Makefile

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-data_org_freedesktop_ConsoleKit_service_in,v 1.1 2010/06/27 22:15:38 ajacoutot Exp $
http://bugs.freedesktop.org/show_bug.cgi?id=25642
--- data/org.freedesktop.ConsoleKit.service.in.orig Wed Apr 29 21:07:29 2009
+++ data/org.freedesktop.ConsoleKit.service.in Sun Jun 27 23:15:50 2010
@@ -1,4 +1,4 @@
[D-BUS Service]
Name=org.freedesktop.ConsoleKit
-Exec=@sbindir@/console-kit-daemon
+Exec=@sbindir@/console-kit-daemon --no-daemon
User=root

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_Makefile_in,v 1.3 2010/06/27 22:15:38 ajacoutot Exp $
--- src/Makefile.in.orig Thu Sep 24 08:26:34 2009
+++ src/Makefile.in Sun Jun 27 20:52:19 2010
@@ -46,6 +46,10 @@ host_triplet = @host@
$OpenBSD: patch-src_Makefile_in,v 1.4 2011/04/28 13:08:33 ajacoutot Exp $
--- src/Makefile.in.orig Thu Feb 17 00:44:31 2011
+++ src/Makefile.in Wed Apr 27 15:40:59 2011
@@ -48,6 +48,10 @@ host_triplet = @host@
@CK_COMPILE_FREEBSD_TRUE@ ck-sysdeps-freebsd.c \
@CK_COMPILE_FREEBSD_TRUE@ $(NULL)
@ -12,7 +12,7 @@ $OpenBSD: patch-src_Makefile_in,v 1.3 2010/06/27 22:15:38 ajacoutot Exp $
sbin_PROGRAMS = console-kit-daemon$(EXEEXT) $(am__EXEEXT_1)
noinst_PROGRAMS = test-event-logger$(EXEEXT) \
test-tty-idle-monitor$(EXEEXT) test-vt-monitor$(EXEEXT) \
@@ -69,13 +73,17 @@ am__DEPENDENCIES_1 =
@@ -75,13 +79,17 @@ am__DEPENDENCIES_1 =
@CK_COMPILE_FREEBSD_TRUE@libck_la_DEPENDENCIES = \
@CK_COMPILE_FREEBSD_TRUE@ $(am__DEPENDENCIES_1)
am__libck_la_SOURCES_DIST = ck-sysdeps.h ck-sysdeps-unix.c \
@ -31,11 +31,13 @@ $OpenBSD: patch-src_Makefile_in,v 1.3 2010/06/27 22:15:38 ajacoutot Exp $
am_libck_la_OBJECTS = ck-sysdeps-unix.lo $(am__objects_1) \
$(am__objects_2) $(am__objects_3) $(am__objects_4)
libck_la_OBJECTS = $(am_libck_la_OBJECTS)
@@ -365,10 +373,12 @@ libck_event_log_la_SOURCES = \
@@ -432,12 +440,13 @@ libck_event_log_la_SOURCES = \
libck_la_SOURCES = ck-sysdeps.h ck-sysdeps-unix.c $(NULL) \
$(am__append_1) $(am__append_2) $(am__append_3)
@CK_COMPILE_FREEBSD_TRUE@libck_la_LIBADD = $(KVM_LIBS)
-@CK_COMPILE_FREEBSD_TRUE@libck_la_LIBADD = $(KVM_LIBS)
+@CK_COMPILE_OPENBSD_TRUE@libck_la_LIBADD = $(KVM_LIBS)
@CK_COMPILE_SOLARIS_TRUE@libck_la_LIBADD = -lscf
EXTRA_libck_la_SOURCES = \
ck-sysdeps-linux.c \
ck-sysdeps-solaris.c \
@ -44,7 +46,7 @@ $OpenBSD: patch-src_Makefile_in,v 1.3 2010/06/27 22:15:38 ajacoutot Exp $
$(NULL)
BUILT_SOURCES = \
@@ -574,6 +584,7 @@ distclean-compile:
@@ -661,6 +670,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-session-leader.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-session.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-sysdeps-freebsd.Plo@am__quote@
@ -52,12 +54,12 @@ $OpenBSD: patch-src_Makefile_in,v 1.3 2010/06/27 22:15:38 ajacoutot Exp $
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-sysdeps-linux.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-sysdeps-solaris.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-sysdeps-unix.Plo@am__quote@
@@ -938,8 +949,6 @@ install-data-local:
@@ -1065,8 +1075,6 @@ install-data-local:
-mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-session.d
-mkdir -p $(DESTDIR)$(sysconfdir)/ConsoleKit/run-seat.d
-mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d
- -mkdir -p $(DESTDIR)$(localstatedir)/run/ConsoleKit
- -mkdir -p $(DESTDIR)$(localstatedir)/log/ConsoleKit
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,18 +1,186 @@
$OpenBSD: patch-src_ck-manager_c,v 1.2 2010/06/27 22:15:38 ajacoutot Exp $
$OpenBSD: patch-src_ck-manager_c,v 1.3 2011/04/28 13:08:33 ajacoutot Exp $
Don't segfault if the seats file is invalid.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561106
XXX revert 4f88228f31a63c026c424a92827f26ad7535275c
The Kit people assume the world runs Linux and PAM, see
https://bugs.freedesktop.org/show_bug.cgi?id=28377
--- src/ck-manager.c.orig Thu Sep 24 07:10:07 2009
+++ src/ck-manager.c Sun Jun 27 23:11:30 2010
@@ -2434,6 +2434,10 @@ add_seat_for_file (CkManager *manager,
--- src/ck-manager.c.orig Tue Oct 26 16:34:03 2010
+++ src/ck-manager.c Sat Dec 4 12:18:29 2010
@@ -1659,175 +1659,13 @@ open_session_for_leader (CkManager *manage
dbus_g_method_return (context, cookie);
}
seat = ck_seat_new_from_file (sid, filename);
+ if (seat == NULL) {
+ return;
+ }
+
connect_seat_signals (manager, seat);
if (!ck_seat_register (seat)) {
/* returns false if connection to bus fails */
-enum {
- PROP_STRING,
- PROP_BOOLEAN,
-};
-
-#define CK_TYPE_PARAMETER_STRUCT (dbus_g_type_get_struct ("GValueArray", \
- G_TYPE_STRING, \
- G_TYPE_VALUE, \
- G_TYPE_INVALID))
-
-static gboolean
-_get_parameter (GPtrArray *parameters,
- const char *name,
- int prop_type,
- gpointer *value)
-{
- gboolean ret;
- int i;
-
- if (parameters == NULL) {
- return FALSE;
- }
-
- ret = FALSE;
-
- for (i = 0; i < parameters->len && ret == FALSE; i++) {
- gboolean res;
- GValue val_struct = { 0, };
- char *prop_name;
- GValue *prop_val;
-
- g_value_init (&val_struct, CK_TYPE_PARAMETER_STRUCT);
- g_value_set_static_boxed (&val_struct, g_ptr_array_index (parameters, i));
-
- res = dbus_g_type_struct_get (&val_struct,
- 0, &prop_name,
- 1, &prop_val,
- G_MAXUINT);
- if (! res) {
- g_debug ("Unable to extract parameter input");
- goto cont;
- }
-
- if (prop_name == NULL) {
- g_debug ("Skipping NULL parameter");
- goto cont;
- }
-
- if (strcmp (prop_name, name) != 0) {
- goto cont;
- }
-
- switch (prop_type) {
- case PROP_STRING:
- if (value != NULL) {
- *value = g_value_dup_string (prop_val);
- }
- break;
- case PROP_BOOLEAN:
- if (value != NULL) {
- *(gboolean *)value = g_value_get_boolean (prop_val);
- }
- break;
- default:
- g_assert_not_reached ();
- break;
- }
-
- ret = TRUE;
-
- cont:
- g_free (prop_name);
- if (prop_val != NULL) {
- g_value_unset (prop_val);
- g_free (prop_val);
- }
- }
-
- return ret;
-}
-
-static gboolean
-_verify_login_session_id_is_local (CkManager *manager,
- const char *login_session_id)
-{
- GHashTableIter iter;
- const char *id;
- CkSession *session;
-
- g_return_val_if_fail (CK_IS_MANAGER (manager), FALSE);
-
- /* If any local session exists for the given login session id
- then that means a trusted party has vouched for the
- original login */
-
- g_debug ("Looking for local sessions for login-session-id=%s", login_session_id);
-
- session = NULL;
- g_hash_table_iter_init (&iter, manager->priv->sessions);
- while (g_hash_table_iter_next (&iter, (gpointer *)&id, (gpointer *)&session)) {
- if (session != NULL) {
- gboolean is_local;
- char *sessid;
-
- sessid = NULL;
- g_object_get (session,
- "login-session-id", &sessid,
- "is-local", &is_local,
- NULL);
- if (g_strcmp0 (sessid, login_session_id) == 0 && is_local) {
- g_debug ("CkManager: found is-local=true on %s", id);
- return TRUE;
- }
- }
- }
-
- return FALSE;
-}
-
static void
-add_param_boolean (GPtrArray *parameters,
- const char *key,
- gboolean value)
-{
- GValue val = { 0, };
- GValue param_val = { 0, };
-
- g_value_init (&val, G_TYPE_BOOLEAN);
- g_value_set_boolean (&val, value);
- g_value_init (&param_val, CK_TYPE_PARAMETER_STRUCT);
- g_value_take_boxed (&param_val,
- dbus_g_type_specialized_construct (CK_TYPE_PARAMETER_STRUCT));
- dbus_g_type_struct_set (&param_val,
- 0, key,
- 1, &val,
- G_MAXUINT);
- g_value_unset (&val);
-
- g_ptr_array_add (parameters, g_value_get_boxed (&param_val));
-}
-
-static void
verify_and_open_session_for_leader (CkManager *manager,
CkSessionLeader *leader,
- GPtrArray *parameters,
+ const GPtrArray *parameters,
DBusGMethodInvocation *context)
{
- /* Only allow a local session if originating from an existing
- local session. Effectively this means that only trusted
- parties can create local sessions. */
-
- g_debug ("CkManager: verifying session for leader");
-
- if (parameters != NULL && ! _get_parameter (parameters, "is-local", PROP_BOOLEAN, NULL)) {
- gboolean is_local;
- char *login_session_id;
-
- g_debug ("CkManager: is-local has not been set, will inherit from existing login-session-id if available");
-
- is_local = FALSE;
-
- if (_get_parameter (parameters, "login-session-id", PROP_STRING, (gpointer *) &login_session_id)) {
- is_local = _verify_login_session_id_is_local (manager, login_session_id);
- g_debug ("CkManager: found is-local=%s", is_local ? "true" : "false");
- }
-
- add_param_boolean (parameters, "is-local", is_local);
- }
-
+ /* for now don't bother verifying since we protect OpenSessionWithParameters */
open_session_for_leader (manager,
leader,
parameters,

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-src_ck-sysdeps-openbsd_c,v 1.7 2010/09/17 13:37:57 ajacoutot Exp $
$OpenBSD: patch-src_ck-sysdeps-openbsd_c,v 1.8 2011/04/28 13:08:33 ajacoutot Exp $
--- src/ck-sysdeps-openbsd.c.orig Fri Sep 17 15:18:27 2010
+++ src/ck-sysdeps-openbsd.c Fri Sep 17 15:20:56 2010
@@ -0,0 +1,430 @@
@ -128,7 +128,7 @@ $OpenBSD: patch-src_ck-sysdeps-openbsd_c,v 1.7 2010/09/17 13:37:57 ajacoutot Exp
+
+static gboolean
+get_kinfo_proc (pid_t pid,
+ struct kinfo_proc2 *p)
+ struct kinfo_proc *p)
+{
+ int name[6];
+ u_int namelen;
@ -137,14 +137,14 @@ $OpenBSD: patch-src_ck-sysdeps-openbsd_c,v 1.7 2010/09/17 13:37:57 ajacoutot Exp
+ sz = sizeof(*p);
+ namelen = 0;
+ name[namelen++] = CTL_KERN;
+ name[namelen++] = KERN_PROC2;
+ name[namelen++] = KERN_PROC;
+ name[namelen++] = KERN_PROC_PID;
+ name[namelen++] = pid;
+ name[namelen++] = sz;
+ name[namelen++] = 1;
+
+ if (sysctl (name, namelen, p, &sz, NULL, 0) == -1) {
+ perror("sysctl kern.proc2.pid");
+ perror("sysctl kern.proc.pid");
+ return FALSE;
+ }
+
@ -156,7 +156,7 @@ $OpenBSD: patch-src_ck-sysdeps-openbsd_c,v 1.7 2010/09/17 13:37:57 ajacoutot Exp
+stat2proc (pid_t pid,
+ CkProcessStat *P)
+{
+ struct kinfo_proc2 p;
+ struct kinfo_proc p;
+ char *ttname;
+ int num;
+ int tty_maj;
@ -253,7 +253,7 @@ $OpenBSD: patch-src_ck-sysdeps-openbsd_c,v 1.7 2010/09/17 13:37:57 ajacoutot Exp
+ GHashTable *hash;
+ char **penv;
+ kvm_t *kd;
+ struct kinfo_proc2 p;
+ struct kinfo_proc p;
+ int i;
+
+ kd = kvm_openfiles (NULL, NULL, NULL, O_RDONLY, NULL);
@ -316,7 +316,7 @@ $OpenBSD: patch-src_ck-sysdeps-openbsd_c,v 1.7 2010/09/17 13:37:57 ajacoutot Exp
+{
+ uid_t uid;
+ gboolean res;
+ struct kinfo_proc2 p;
+ struct kinfo_proc p;
+
+ g_return_val_if_fail (pid > 1, 0);
+

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-src_ck-sysdeps-unix_c,v 1.7 2010/07/03 04:02:53 ajacoutot Exp $
$OpenBSD: patch-src_ck-sysdeps-unix_c,v 1.8 2011/04/28 13:08:33 ajacoutot Exp $
--- src/ck-sysdeps-unix.c.orig Wed Apr 29 21:07:29 2009
+++ src/ck-sysdeps-unix.c Sat Jul 3 05:57:40 2010
@@ -35,6 +35,10 @@
@ -20,7 +20,7 @@ $OpenBSD: patch-src_ck-sysdeps-unix_c,v 1.7 2010/07/03 04:02:53 ajacoutot Exp $
+#ifndef __OpenBSD__
+ struct uncred cr;
+#else
+ struct sockpeercred cr;
+ struct sockpeercred cr;
+#endif
socklen_t cr_len;

View File

@ -1,12 +1,12 @@
$OpenBSD: patch-src_ck-vt-monitor_c,v 1.2 2010/07/05 06:51:40 ajacoutot Exp $
$OpenBSD: patch-src_ck-vt-monitor_c,v 1.3 2011/04/28 13:08:33 ajacoutot Exp $
VT_WAITACTIVE started in a g_thread with our userland pthreads(3) makes
the main console-kit-daemon process waits forever on VT1, so are forced
to disable monitoring for console activation.
--- src/ck-vt-monitor.c.orig Sat Jul 3 05:56:14 2010
+++ src/ck-vt-monitor.c Sat Jul 3 05:56:58 2010
@@ -381,7 +381,7 @@ vt_add_watches (CkVtMonitor *vt_monitor)
--- src/ck-vt-monitor.c.orig Wed Nov 17 01:50:46 2010
+++ src/ck-vt-monitor.c Tue Nov 30 15:30:22 2010
@@ -380,7 +380,7 @@ vt_add_watches (CkVtMonitor *vt_monitor)
int i;
gint32 current_num;

View File

@ -1,13 +1,13 @@
$OpenBSD: patch-src_main_c,v 1.2 2010/06/28 15:55:21 ajacoutot Exp $
$OpenBSD: patch-src_main_c,v 1.3 2011/04/28 13:08:33 ajacoutot Exp $
From Debian:
Cleanup console tag files on application startup and shutdown.
https://bugs.freedesktop.org/show_bug.cgi?id=25744
--- src/main.c.orig Wed Apr 29 21:07:29 2009
+++ src/main.c Sun Jun 27 23:14:52 2010
@@ -149,6 +149,43 @@ delete_pid (void)
--- src/main.c.orig Tue Oct 26 16:34:03 2010
+++ src/main.c Sun Dec 5 09:01:12 2010
@@ -148,6 +148,43 @@ delete_pid (void)
unlink (CONSOLE_KIT_PID_FILE);
}
@ -51,7 +51,7 @@ https://bugs.freedesktop.org/show_bug.cgi?id=25744
/* copied from nautilus */
static int debug_log_pipes[2];
@@ -229,7 +266,7 @@ create_pid_file (void)
@@ -228,7 +265,7 @@ create_pid_file (void)
snprintf (pid, sizeof (pid), "%lu\n", (long unsigned) getpid ());
written = write (pf, pid, strlen (pid));
close (pf);
@ -60,40 +60,12 @@ https://bugs.freedesktop.org/show_bug.cgi?id=25744
} else {
g_warning ("Unable to write pid file %s: %s",
CONSOLE_KIT_PID_FILE,
@@ -294,11 +331,19 @@ main (int argc,
setup_debug_log (debug);
+ g_debug ("initializing console-kit-daemon %s", VERSION);
+
connection = get_system_bus ();
if (connection == NULL) {
@@ -316,6 +353,8 @@ main (int argc,
g_warning ("Could not acquire name; bailing out");
goto out;
}
+ manager = ck_manager_new ();
+
+ if (manager == NULL) {
+ goto out;
+ }
+
bus_proxy = get_bus_proxy (connection);
if (bus_proxy == NULL) {
g_warning ("Could not construct bus_proxy object; bailing out");
@@ -310,15 +355,9 @@ main (int argc,
goto out;
}
- g_debug ("initializing console-kit-daemon %s", VERSION);
+ delete_console_tags ();
+ delete_console_tags ();
create_pid_file ();
-
- manager = ck_manager_new ();
-
- if (manager == NULL) {
- goto out;
- }
loop = g_main_loop_new (NULL, FALSE);

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-tools_Makefile_in,v 1.2 2010/06/27 22:15:38 ajacoutot Exp $
--- tools/Makefile.in.orig Thu Sep 24 08:26:34 2009
+++ tools/Makefile.in Sun Jun 27 20:50:10 2010
@@ -35,6 +35,7 @@ host_triplet = @host@
$OpenBSD: patch-tools_Makefile_in,v 1.3 2011/04/28 13:08:33 ajacoutot Exp $
--- tools/Makefile.in.orig Thu Feb 17 00:44:31 2011
+++ tools/Makefile.in Wed Apr 27 15:40:59 2011
@@ -37,6 +37,7 @@ host_triplet = @host@
@CK_COMPILE_LINUX_TRUE@am__append_1 = linux
@CK_COMPILE_FREEBSD_TRUE@am__append_2 = freebsd
@CK_COMPILE_SOLARIS_TRUE@am__append_3 = solaris
@ -9,7 +9,7 @@ $OpenBSD: patch-tools_Makefile_in,v 1.2 2010/06/27 22:15:38 ajacoutot Exp $
bin_PROGRAMS = ck-launch-session$(EXEEXT) ck-list-sessions$(EXEEXT) \
ck-history$(EXEEXT) $(am__EXEEXT_1)
sbin_PROGRAMS = ck-log-system-start$(EXEEXT) \
@@ -307,6 +308,7 @@ DIST_SUBDIRS = \
@@ -359,6 +360,7 @@ DIST_SUBDIRS = \
linux \
freebsd \
solaris \

View File

@ -0,0 +1,32 @@
$OpenBSD: patch-tools_ck-collect-session-info_c,v 1.1 2011/04/28 13:08:33 ajacoutot Exp $
XXX revert 4f88228f31a63c026c424a92827f26ad7535275c
The Kit people assume the world runs Linux and PAM, see
https://bugs.freedesktop.org/show_bug.cgi?id=28377
--- tools/ck-collect-session-info.c.orig Fri Sep 3 15:54:31 2010
+++ tools/ck-collect-session-info.c Sat Dec 4 12:18:34 2010
@@ -274,7 +274,8 @@ fill_x11_info (SessionInfo *si)
si->x11_display_device = ck_process_stat_get_tty (xorg_stat);
ck_process_stat_free (xorg_stat);
- /* don't set is-local here - let the daemon do that */
+ si->is_local = TRUE;
+ si->is_local_is_set = TRUE;
g_free (si->remote_host_name);
si->remote_host_name = NULL;
@@ -302,6 +303,13 @@ fill_session_info (SessionInfo *si)
ck_process_stat_free (stat);
fill_x11_info (si);
+
+ if (! si->is_local_is_set) {
+ /* FIXME: how should we set this? */
+ /* non x11 sessions must be local I guess */
+ si->is_local = TRUE;
+ si->is_local_is_set = TRUE;
+ }
res = ck_unix_pid_get_login_session_id (si->pid, &si->login_session_id);
if (! res) {

View File

@ -0,0 +1,31 @@
$OpenBSD: patch-tools_ck-log-system-start_c,v 1.1 2011/04/28 13:08:33 ajacoutot Exp $
--- tools/ck-log-system-start.c.orig Fri Sep 3 15:54:31 2010
+++ tools/ck-log-system-start.c Wed Apr 27 20:01:29 2011
@@ -41,7 +41,9 @@
#define DEFAULT_LOG_FILENAME LOCALSTATEDIR "/log/ConsoleKit/history"
+#ifdef __linux__
#define LINUX_KERNEL_CMDLINE "/proc/cmdline"
+#endif
/* Adapted from auditd auditd-event.c */
static gboolean
@@ -163,6 +165,7 @@ static char *
get_boot_arguments (void)
{
char *contents;
+#ifdef __linux__
gboolean res;
contents = NULL;
@@ -176,6 +179,9 @@ get_boot_arguments (void)
} else {
g_strchomp (contents);
}
+#else
+ contents = NULL;
+#endif
return contents;
}

View File

@ -2,6 +2,6 @@ To enable ConsoleKit in a graphical session, prepend ck-launch-session
to the session script (note: gdm(1) does this automatically). e.g.
${PREFIX}/bin/ck-launch-session ${PREFIX}/bin/bin/openbox-session
Note that you need a system-wide D-BUS daemon running.
Note that you need a system-wide DBus daemon running.
The /var/log/ConsoleKit/history logfile can grow very large after some
time. It is advised to use newsyslog(8) to rotate it.

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.4 2010/06/27 22:15:39 ajacoutot Exp $
@comment $OpenBSD: PLIST,v 1.5 2011/04/28 13:08:33 ajacoutot Exp $
%%SHARED%%
@bin bin/ck-history
@bin bin/ck-launch-session
@ -18,8 +18,8 @@ lib/libck-connector.la
lib/pkgconfig/
lib/pkgconfig/ck-connector.pc
@bin libexec/ck-collect-session-info
libexec/ck-get-x11-display-device
libexec/ck-get-x11-server-pid
@bin libexec/ck-get-x11-display-device
@bin libexec/ck-get-x11-server-pid
@bin sbin/ck-log-system-restart
@bin sbin/ck-log-system-start
@bin sbin/ck-log-system-stop