From cace6d5cedcf9110a13bb185773d823b26ecb4ca Mon Sep 17 00:00:00 2001 From: ayhanyalcinsoy Date: Sat, 4 Jul 2015 15:12:27 +0300 Subject: [PATCH] moved into main for pisi 2.0 --- system/base/ConsoleKit/actions.py | 47 ++ .../base/ConsoleKit/files/25-consolekit.rules | 8 + system/base/ConsoleKit/files/ConsoleKit.conf | 1 + system/base/ConsoleKit/files/consolekit.pamd | 7 + .../ConsoleKit/files/pam-foreground-compat.ck | 17 + .../files/upstream_fix_issue_26.patch | 776 ++++++++++++++++++ system/base/ConsoleKit/pspec.xml | 154 ++++ system/base/ConsoleKit/translations.xml | 13 + 8 files changed, 1023 insertions(+) create mode 100644 system/base/ConsoleKit/actions.py create mode 100644 system/base/ConsoleKit/files/25-consolekit.rules create mode 100644 system/base/ConsoleKit/files/ConsoleKit.conf create mode 100644 system/base/ConsoleKit/files/consolekit.pamd create mode 100644 system/base/ConsoleKit/files/pam-foreground-compat.ck create mode 100644 system/base/ConsoleKit/files/upstream_fix_issue_26.patch create mode 100644 system/base/ConsoleKit/pspec.xml create mode 100644 system/base/ConsoleKit/translations.xml diff --git a/system/base/ConsoleKit/actions.py b/system/base/ConsoleKit/actions.py new file mode 100644 index 0000000000..4f5729a93b --- /dev/null +++ b/system/base/ConsoleKit/actions.py @@ -0,0 +1,47 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file http://www.gnu.org/licenses/gpl.txt + +from pisi.actionsapi import get +from pisi.actionsapi import autotools +from pisi.actionsapi import pisitools +from pisi.actionsapi import shelltools + +def setup(): + # /var/run => /run + #pisitools.dosed("configure.ac", "^(\s+CONSOLE_KIT_PID_FILE=)\$\{localstatedir\}(\/run\/ConsoleKit\/pid)", r"\1\2") + #pisitools.dosed("src/Makefile.am", "\$\(localstatedir\)(\/run\/ConsoleKit)", r"\1") + #shelltools.system("sed -i -e '/SystemdService/d' data/org.freedesktop.ConsoleKit.service.in") + + #autotools.autoreconf("-fi") + + autotools.configure("--prefix=/usr \ + --sysconfdir=/etc \ + --sbindir=/usr/sbin \ + --with-rundir=/run \ + --libexecdir=/usr/libexec/ConsoleKit \ + --localstatedir=/var \ + --enable-polkit \ + --enable-pam-module \ + --enable-udev-acl \ + --enable-docbook-docs \ + --disable-static \ + --with-dbus-services=/usr/share/dbus-1/services \ + --with-logrotate-dir=/etc/logrotate.d \ + --with-xinitrc-dir=/etc/X11/xinit/xinitrc.d \ + --with-pam-module-dir=/lib/security \ + --with-systemdsystemunitdir=no \ + XMLTO_FLAGS='--skip-validation' \ + ") + +def build(): + autotools.make() + +def install(): + autotools.rawInstall("DESTDIR=%s/" % get.installDIR()) + + pisitools.removeDir("/run") + + pisitools.dodoc("AUTHORS", "README", "COPYING", "HACKING", "NEWS", "TODO") diff --git a/system/base/ConsoleKit/files/25-consolekit.rules b/system/base/ConsoleKit/files/25-consolekit.rules new file mode 100644 index 0000000000..adddfb1bd7 --- /dev/null +++ b/system/base/ConsoleKit/files/25-consolekit.rules @@ -0,0 +1,8 @@ +polkit.addRule(function(action, subject) { + if (action.id == "org.freedesktop.consolekit.system.stop" || + action.id == "org.freedesktop.consolekit.system.restart" || + action.id == "org.freedesktop.consolekit.system.hibernate" || + action.id == "org.freedesktop.consolekit.system.suspend") { + return polkit.Result.YES; + } +}); diff --git a/system/base/ConsoleKit/files/ConsoleKit.conf b/system/base/ConsoleKit/files/ConsoleKit.conf new file mode 100644 index 0000000000..4ec125110a --- /dev/null +++ b/system/base/ConsoleKit/files/ConsoleKit.conf @@ -0,0 +1 @@ +d /run/ConsoleKit 0755 - - - diff --git a/system/base/ConsoleKit/files/consolekit.pamd b/system/base/ConsoleKit/files/consolekit.pamd new file mode 100644 index 0000000000..8ac033c74b --- /dev/null +++ b/system/base/ConsoleKit/files/consolekit.pamd @@ -0,0 +1,7 @@ +#%PAM-1.0 + +auth include system-login +account include system-login +session include system-login +password include system-login +session optional pam_ck_connector.so diff --git a/system/base/ConsoleKit/files/pam-foreground-compat.ck b/system/base/ConsoleKit/files/pam-foreground-compat.ck new file mode 100644 index 0000000000..3c1d0744d0 --- /dev/null +++ b/system/base/ConsoleKit/files/pam-foreground-compat.ck @@ -0,0 +1,17 @@ +#!/bin/sh +TAGDIR=/run/console + +[ -n "$CK_SESSION_USER_UID" ] || exit 1 +[ "$CK_SESSION_IS_LOCAL" = "true" ] || exit 0 + +TAGFILE="$TAGDIR/`getent passwd $CK_SESSION_USER_UID | cut -f 1 -d:`" + +if [ "$1" = "session_added" ]; then + mkdir -p "$TAGDIR" + echo "$CK_SESSION_ID" >> "$TAGFILE" +fi + +if [ "$1" = "session_removed" ] && [ -e "$TAGFILE" ]; then + sed -i "\%^$CK_SESSION_ID\$%d" "$TAGFILE" + [ -s "$TAGFILE" ] || rm -f "$TAGFILE" +fi diff --git a/system/base/ConsoleKit/files/upstream_fix_issue_26.patch b/system/base/ConsoleKit/files/upstream_fix_issue_26.patch new file mode 100644 index 0000000000..a6009d302c --- /dev/null +++ b/system/base/ConsoleKit/files/upstream_fix_issue_26.patch @@ -0,0 +1,776 @@ +diff -Nuar ConsoleKit2-0.9.3.orig/src/ck-manager.c ConsoleKit2-0.9.3/src/ck-manager.c +--- ConsoleKit2-0.9.3.orig/src/ck-manager.c 2015-06-09 19:04:19.000000000 +0300 ++++ ConsoleKit2-0.9.3/src/ck-manager.c 2015-06-14 21:30:51.943744599 +0300 +@@ -2851,6 +2851,11 @@ + pid_t calling_pid = 0; + char *cookie; + ++ if (pid <= 1) { ++ throw_error (context, CK_MANAGER_ERROR_INVALID_INPUT, _("pid must be > 1")); ++ return TRUE; ++ } ++ + manager = CK_MANAGER (ckmanager); + + sender = g_dbus_method_invocation_get_sender (context); +diff -Nuar ConsoleKit2-0.9.3.orig/src/ck-session.c ConsoleKit2-0.9.3/src/ck-session.c +--- ConsoleKit2-0.9.3.orig/src/ck-session.c 2015-05-18 06:43:04.000000000 +0300 ++++ ConsoleKit2-0.9.3/src/ck-session.c 2015-06-14 21:30:55.946744527 +0300 +@@ -55,7 +55,6 @@ + char *seat_id; + + char *login_session_id; +- guint uid; + + GTimeVal creation_time; + +@@ -331,6 +330,11 @@ + + g_return_val_if_fail (CK_IS_SESSION (cksession), FALSE); + ++ if (console_kit_session_get_idle_hint (cksession) == FALSE) { ++ throw_error (context, CK_SESSION_ERROR_GENERAL, "idle since hint not set"); ++ return TRUE; ++ } ++ + date_str = g_time_val_to_iso8601 (&session->priv->idle_since_hint); + + console_kit_session_complete_get_idle_since_hint (cksession, context, date_str); +@@ -386,7 +390,7 @@ + } + + /* only restrict this by UID for now */ +- if (session->priv->uid != calling_uid) { ++ if (console_kit_session_get_unix_user (cksession) != calling_uid) { + throw_error (context, CK_SESSION_ERROR_INSUFFICIENT_PERMISSION, _("Only session owner may set idle hint state")); + return TRUE; + } +@@ -836,7 +840,11 @@ + + g_return_val_if_fail (CK_IS_SESSION (cksession), FALSE); + +- console_kit_session_complete_get_login_session_id (cksession, context, session->priv->login_session_id); ++ if (session->priv->login_session_id == NULL) { ++ throw_error (context, CK_SESSION_ERROR_FAILED, "no login session id"); ++ } else { ++ console_kit_session_complete_get_login_session_id (cksession, context, session->priv->login_session_id); ++ } + return TRUE; + } + +@@ -1240,7 +1248,7 @@ + extra_env[n++] = g_strdup_printf ("CK_SESSION_TYPE=%s", console_kit_session_get_session_type (cksession)); + } + extra_env[n++] = g_strdup_printf ("CK_SESSION_SEAT_ID=%s", session->priv->seat_id); +- extra_env[n++] = g_strdup_printf ("CK_SESSION_USER_UID=%d", session->priv->uid); ++ extra_env[n++] = g_strdup_printf ("CK_SESSION_USER_UID=%d", console_kit_session_get_unix_user (cksession)); + if (console_kit_session_get_display_device (cksession) != NULL && strlen (console_kit_session_get_display_device (cksession)) > 0) { + extra_env[n++] = g_strdup_printf ("CK_SESSION_DISPLAY_DEVICE=%s", console_kit_session_get_display_device (cksession)); + } +@@ -1279,7 +1287,7 @@ + cksession = CONSOLE_KIT_SESSION (session); + + group_name = g_strdup_printf ("Session %s", session->priv->id); +- g_key_file_set_integer (key_file, group_name, "uid", session->priv->uid); ++ g_key_file_set_integer (key_file, group_name, "uid", console_kit_session_get_unix_user (cksession)); + g_key_file_set_string (key_file, + group_name, + "seat", +diff -Nuar ConsoleKit2-0.9.3.orig/src/test-fus ConsoleKit2-0.9.3/src/test-fus +--- ConsoleKit2-0.9.3.orig/src/test-fus 1970-01-01 02:00:00.000000000 +0200 ++++ ConsoleKit2-0.9.3/src/test-fus 2015-06-14 21:31:08.768744297 +0300 +@@ -0,0 +1,69 @@ ++#!/usr/bin/env python ++# ++# Test fast-user-switch functionality ++# ++ ++import os ++import sys ++import gobject ++import dbus ++import dbus.glib ++ ++def activate_reply (res): ++ print "session activated" ++ ++def activate_error (e): ++ print str (e) ++ ++def session_added_cb (ssid): ++ print "Session added: %s" % ssid ++ ++def session_removed_cb (ssid): ++ print "Session removed: %s" % ssid ++ ++def active_session_changed_cb (ssid): ++ print "Active session changed: %s" % ssid ++ ++bus = dbus.SystemBus () ++ ++manager_obj = bus.get_object ('org.freedesktop.ConsoleKit', '/org/freedesktop/ConsoleKit/Manager') ++ ++manager = dbus.Interface (manager_obj, 'org.freedesktop.ConsoleKit.Manager') ++ ++current_ssid = manager.GetCurrentSession () ++current_session_obj = bus.get_object ('org.freedesktop.ConsoleKit', current_ssid) ++current_session = dbus.Interface (current_session_obj, 'org.freedesktop.ConsoleKit.Session') ++ ++sid = current_session.GetSeatId () ++if not sid: ++ print "Current session is not attached to a seat, no switching possible" ++ sys.exit () ++ ++seat_obj = bus.get_object ('org.freedesktop.ConsoleKit', sid) ++seat = dbus.Interface (seat_obj, 'org.freedesktop.ConsoleKit.Seat') ++seat.connect_to_signal ('SessionAdded', session_added_cb) ++seat.connect_to_signal ('SessionRemoved', session_removed_cb) ++seat.connect_to_signal ('ActiveSessionChanged', active_session_changed_cb) ++ ++can_fus = seat.CanActivateSessions() ++if can_fus: ++ print "The current seat supports session switching" ++else: ++ print "The current seat does not support session switching" ++ ++# Show a list of sessions on the current seat ++sessions = seat.GetSessions () ++for ssid in sessions: ++ session_obj = bus.get_object ('org.freedesktop.ConsoleKit', ssid) ++ session = dbus.Interface (session_obj, 'org.freedesktop.ConsoleKit.Session') ++ uid = session.GetUser () ++ print "Session %s user=%u" % (ssid, uid) ++ ++# then pretend a session-ID is selected: ++ssid = current_ssid ++session_obj = bus.get_object ('org.freedesktop.ConsoleKit', ssid) ++session = dbus.Interface (session_obj, 'org.freedesktop.ConsoleKit.Session') ++session.Activate (reply_handler = activate_reply, error_handler = activate_error) ++ ++mainloop = gobject.MainLoop () ++mainloop.run() +diff -Nuar ConsoleKit2-0.9.3.orig/src/test-manager.c ConsoleKit2-0.9.3/src/test-manager.c +--- ConsoleKit2-0.9.3.orig/src/test-manager.c 2015-06-08 10:14:14.000000000 +0300 ++++ ConsoleKit2-0.9.3/src/test-manager.c 2015-06-14 21:31:10.021744275 +0300 +@@ -277,7 +277,10 @@ + static gboolean + validate_stuff () + { +- gint fd; ++ gint fd; ++ GVariant *session_var = NULL, *close_var = NULL; ++ gboolean is_session_closed; ++ GError *error = NULL; + + print_reply (manager, "CanRestart"); + +@@ -295,7 +298,7 @@ + + fd = print_inhibit_reply (manager, "Inhibit"); + +- print_reply (manager, "OpenSession"); ++ session_var = print_method (manager, "OpenSession", g_variant_new ("()")); + + print_reply (manager, "GetSeats"); + +@@ -317,8 +320,29 @@ + g_close (fd, NULL); + } + ++ /* test closing our session */ ++ if (session_var != NULL) { ++ g_print ("calling CloseSession\t"); ++ close_var = g_dbus_proxy_call_sync (manager, "CloseSession", ++ session_var, ++ G_DBUS_CALL_FLAGS_NONE, 3000, NULL, &error); ++ if (close_var == NULL) { ++ g_print ("returned NULL\t"); ++ if (error) ++ g_print ("error %s", error->message); ++ } ++ } ++ ++ g_variant_get (close_var, "(b)", &is_session_closed); ++ g_print ("session closed? %s", is_session_closed ? "Closed" : "Not Closed"); ++ + g_print ("done printing stuff\n\n"); + ++ if (session_var) ++ g_variant_unref (session_var); ++ if (close_var) ++ g_variant_unref (close_var); ++ + return TRUE; + } + +diff -Nuar ConsoleKit2-0.9.3.orig/src/test-method-access-policy ConsoleKit2-0.9.3/src/test-method-access-policy +--- ConsoleKit2-0.9.3.orig/src/test-method-access-policy 1970-01-01 02:00:00.000000000 +0200 ++++ ConsoleKit2-0.9.3/src/test-method-access-policy 2015-06-14 21:31:10.021744275 +0300 +@@ -0,0 +1,534 @@ ++#!/usr/bin/env python ++# ++# Test access to methods ++# ++ ++import os ++import sys ++import gobject ++import dbus ++import dbus.glib ++ ++bus = dbus.SystemBus () ++ ++privileged = (os.geteuid () == 0) ++if privileged: ++ print "Running privileged as uid=%d pid=%d" % (os.geteuid (), os.getpid ()) ++else: ++ print "Running unprivileged as uid=%d pid=%d" % (os.geteuid (), os.getpid ()) ++ ++print "Testing all public methods to check D-Bus policy" ++ ++manager_obj = bus.get_object ('org.freedesktop.ConsoleKit', '/org/freedesktop/ConsoleKit/Manager') ++manager = dbus.Interface (manager_obj, 'org.freedesktop.ConsoleKit.Manager') ++ ++print "Testing Manager" ++ ++print "Testing Manager.OpenSession:", ++res = "PASS" ++try: ++ cookie = manager.OpenSession () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++print "Testing Manager.CloseSession:", ++res = "PASS" ++try: ++ manager.CloseSession (cookie) ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++print "Testing Manager.OpenSessionWithParameters:", ++res = "PASS" ++try: ++ cookie = manager.OpenSessionWithParameters (dbus.Array([], signature = "sv")) ++ if not privileged: ++ res = "FAIL" ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ if privileged: ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t%s" % res ++ ++print "Testing Manager.GetSeats:", ++res = "PASS" ++try: ++ manager.GetSeats () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++print "Testing Manager.GetSessionForCookie:", ++res = "PASS" ++try: ++ manager.GetSessionForCookie (os.environ['XDG_SESSION_COOKIE']) ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t%s" % res ++ ++print "Testing Manager.GetSessionForUnixProcess:", ++res = "PASS" ++try: ++ manager.GetSessionForUnixProcess (os.getpid ()) ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t%s" % res ++ ++print "Testing Manager.GetCurrentSession:", ++res = "PASS" ++try: ++ manager.GetCurrentSession () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t%s" % res ++ ++print "Testing Manager.GetSessionsForUnixUser:", ++res = "PASS" ++try: ++ manager.GetSessionsForUnixUser (os.geteuid ()) ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t%s" % res ++ ++print "Testing Manager.GetSessionsForUser:", ++res = "PASS" ++try: ++ manager.GetSessionsForUser (os.geteuid ()) ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t%s" % res ++ ++print "Testing Manager.GetSystemIdleHint:", ++res = "PASS" ++try: ++ manager.GetSystemIdleHint () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t%s" % res ++ ++print "Testing Manager.GetSystemIdleSinceHint:", ++res = "PASS" ++try: ++ manager.GetSystemIdleSinceHint () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t%s" % res ++ ++# Test Seat Interface ++print "Testing Seat" ++ ++seat_obj = bus.get_object ('org.freedesktop.ConsoleKit', '/org/freedesktop/ConsoleKit/Seat1') ++seat = dbus.Interface (seat_obj, 'org.freedesktop.ConsoleKit.Seat') ++ ++print "Testing Seat.GetId:", ++res = "PASS" ++try: ++ seat.GetId () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t\t%s" % res ++ ++print "Testing Seat.GetSessions:", ++res = "PASS" ++try: ++ seat.GetSessions () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++print "Testing Seat.GetDevices:", ++res = "PASS" ++try: ++ seat.GetDevices () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++print "Testing Seat.GetActiveSession:", ++res = "PASS" ++try: ++ seat.GetActiveSession () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++print "Testing Seat.CanActivateSessions:", ++res = "PASS" ++try: ++ seat.CanActivateSessions () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t%s" % res ++ ++print "Testing Seat.ActivateSession:", ++res = "PASS" ++try: ++ seat.ActivateSession ('/org/freedesktop/ConsoleKit/SessionN') ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++# Test Session Interface ++print "Testing Session" ++ ++# create a new session so we can set props ++cookie = manager.OpenSession () ++ssid = manager.GetSessionForCookie (cookie) ++if not ssid: ++ print "Could not create a session to test" ++ sys.exit () ++ ++session_obj = bus.get_object ('org.freedesktop.ConsoleKit', ssid) ++session = dbus.Interface (session_obj, 'org.freedesktop.ConsoleKit.Session') ++ ++print "Testing Session.GetId:", ++res = "PASS" ++try: ++ session.GetId () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t\t%s" % res ++ ++print "Testing Session.GetSeatId:", ++res = "PASS" ++try: ++ session.GetSeatId () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++print "Testing Session.GetLoginSessionId:", ++res = "PASS" ++try: ++ session.GetLoginSessionId () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t%s" % res ++ ++print "Testing Session.GetSessionType:", ++res = "PASS" ++try: ++ session.GetSessionType () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t%s" % res ++ ++print "Testing Session.GetUser:", ++res = "PASS" ++try: ++ session.GetUser () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++print "Testing Session.GetUnixUser:", ++res = "PASS" ++try: ++ session.GetUnixUser () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++print "Testing Session.GetX11Display:", ++res = "PASS" ++try: ++ session.GetX11Display () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++print "Testing Session.GetX11DisplayDevice:", ++res = "PASS" ++try: ++ session.GetX11DisplayDevice () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t%s" % res ++ ++print "Testing Session.GetDisplayDevice:", ++res = "PASS" ++try: ++ session.GetDisplayDevice () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t%s" % res ++ ++print "Testing Session.GetRemoteHostName:", ++res = "PASS" ++try: ++ session.GetRemoteHostName () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t%s" % res ++ ++print "Testing Session.IsActive:", ++res = "PASS" ++try: ++ session.IsActive () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++print "Testing Session.IsLocal:", ++res = "PASS" ++try: ++ session.IsLocal () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++print "Testing Session.GetCreationTime:", ++res = "PASS" ++try: ++ session.GetCreationTime () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t%s" % res ++ ++print "Testing Session.Activate:", ++res = "PASS" ++try: ++ session.Activate () ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++print "Testing Session.Lock:", ++res = "PASS" ++try: ++ session.Lock () ++ if not privileged: ++ res = "FAIL" ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ if privileged: ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t\t%s" % res ++ ++print "Testing Session.Unlock:", ++res = "PASS" ++try: ++ session.Unlock () ++ if not privileged: ++ res = "FAIL" ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ if privileged: ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res ++ ++# Test session properties ++ ++session_props = dbus.Interface (session_obj, 'org.freedesktop.DBus.Properties') ++ ++print "Testing Properties.Get 'unix-user':", ++res = "PASS" ++try: ++ session_props.Get ('org.freedesktop.ConsoleKit.Session', "unix-user") ++ if not privileged: ++ res = "FAIL" ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ if privileged: ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t%s" % res ++ ++print "Testing Properties.Get 'cookie':", ++res = "PASS" ++try: ++ session_props.Get ('org.freedesktop.ConsoleKit.Session', "cookie") ++ if not privileged: ++ res = "FAIL" ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ if privileged: ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t%s" % res ++ ++print "Testing Properties.Set:", ++res = "PASS" ++try: ++ session_props.Set ('org.freedesktop.ConsoleKit.Session', "unix-user", 0) ++ if not privileged: ++ res = "FAIL" ++except dbus.exceptions.DBusException, e: ++ if e.get_dbus_name () == "org.freedesktop.DBus.Error.AccessDenied": ++ if privileged: ++ res = "FAIL" ++ elif e.get_dbus_name () == "org.freedesktop.DBus.Error.UnknownMethod": ++ res = "UKNOWN METHOD" ++except: ++ pass ++print "\t\t\t%s" % res +diff -Nuar ConsoleKit2-0.9.3.orig/src/test-session.c ConsoleKit2-0.9.3/src/test-session.c +--- ConsoleKit2-0.9.3.orig/src/test-session.c 2015-05-18 06:43:04.000000000 +0300 ++++ ConsoleKit2-0.9.3/src/test-session.c 2015-06-14 21:31:12.560744229 +0300 +@@ -176,7 +176,7 @@ + open_session (void) + { + GDBusProxy *session; +- GVariant *cookie_var, *session_var, *activate_var; ++ GVariant *cookie_var, *session_var, *activate_var, *close_var; + GError *error = NULL; + const gchar *path = NULL, *cookie = NULL; + +@@ -272,6 +272,20 @@ + } + if (activate_var) + g_variant_unref (activate_var); ++ ++ close_var = g_dbus_proxy_call_sync (manager, "CloseSession", g_variant_new ("(s)", cookie), G_DBUS_CALL_FLAGS_NONE, 3000, NULL, &error); ++ if (session_var == NULL) { ++ g_print ("returned NULL, is the daemon running?\t"); ++ ++ if (error) ++ g_print ("error %s", error->message); ++ ++ g_print ("\n"); ++ g_clear_error (&error); ++ return; ++ } ++ if (close_var) ++ g_variant_unref (close_var); + } + + int diff --git a/system/base/ConsoleKit/pspec.xml b/system/base/ConsoleKit/pspec.xml new file mode 100644 index 0000000000..86cfe98319 --- /dev/null +++ b/system/base/ConsoleKit/pspec.xml @@ -0,0 +1,154 @@ + + + + + ConsoleKit2 + http://freedesktop.org/Software/Hal + + PisiLinux Community + admins@pisilinux.org + + GPLv2 + library + A framework for defining and tracking users, login sessions, and seats + ConsoleKit is a system daemon for tracking what users are logged into the system and how they interact with the computer (e.g. which keyboard and mouse they use). + https://github.com/ConsoleKit2/ConsoleKit2/releases/download/0.9.4/ConsoleKit2-0.9.4.tar.bz2 + + acl-devel + pam-devel + dbus-devel + udev-devel + zlib-devel + glib2-devel + libX11-devel + polkit-devel + dbus-glib-devel + + + + + + ConsoleKit + + acl + pam + dbus + zlib + glib2 + libX11 + polkit + libudev + dbus-glib + + + /etc + /usr/lib/tmpfiles.d/ConsoleKit.conf + /usr/bin + /usr/sbin + /usr/libexec + /lib + /usr/lib + /usr/share/dbus-1 + /usr/share/polkit-1/actions + /usr/share/polkit-1/rules.d + /usr/share/man + /usr/share/locale + /usr/share/doc + /var + + + ConsoleKit.conf + 25-consolekit.rules + consolekit.pamd + + + + + ConsoleKit-devel + system.devel + Development files for ConsoleKit + + ConsoleKit + dbus-devel + + + /usr/include + /usr/lib/pkgconfig + + + + + + 2015-06-16 + 0.9.4 + Version bump. + Ertuğrul Erata + ertugrulerata@gmail.com + + + 2015-06-15 + 0.9.3 + Version bump. + Ertuğrul Erata + ertugrulerata@gmail.com + + + 2015-02-05 + 0.9.2 + Version bump. + Vedat Demir + vedat@pisilinux.org + + + 2014-08-01 + 0.4.6 + Rebuild. + Marcin Bojara + marcin@pisilinux.org + + + 2014-05-11 + 0.4.6 + Release bump. + Marcin Bojara + marcin@pisilinux.org + + + 2014-03-06 + 0.4.6 + Dep Fix + Varol Maksutoğlu + waroi@pisilinux.org + + + 2014-01-09 + 0.4.6 + Add gentoo patches and ConsoleKit.conf + Marcin Bojara + marcin@pisilinux.org + + + 2013-09-08 + 0.4.6 + /var/run => /run + Marcin Bojara + marcin@pisilinux.org + + + 2013-03-04 + 0.4.6 + Version bump + Yusuf Aydemir + yusuf.aydemir@pisilinux.org + + + 2012-08-23 + 0.4.5 + First release + PisiLinux Community + admins@pisilinux.org + + + diff --git a/system/base/ConsoleKit/translations.xml b/system/base/ConsoleKit/translations.xml new file mode 100644 index 0000000000..836acdaca0 --- /dev/null +++ b/system/base/ConsoleKit/translations.xml @@ -0,0 +1,13 @@ + + + + ConsoleKit + Kullanıcıları, giriş oturumlarını ve koltukları takip etmek ve tanımlamak için bir altyapı + ConsoleKit, sisteme giriş yapmış kullanıcıları ve bu kullanıcıların bilgisayar ile nasıl etkileştiğini izleyen bir sistem hizmetidir. + + + + ConsoleKit-devel + ConsoleKit için geliştirme dosyaları + +