diff options
author | Nirbheek Chauhan <nirbheek@gentoo.org> | 2011-08-18 05:11:39 +0000 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@gentoo.org> | 2011-08-18 05:11:39 +0000 |
commit | c2a1cf651c6e6c92fafc279a28eb2910f1f54d4a (patch) | |
tree | fc9de8518e43e400b2a6c3e800f1cd11efd2fd18 /sys-apps/accountsservice | |
parent | Move from gnome overlay for GNOME 3 (diff) | |
download | gentoo-2-c2a1cf651c6e6c92fafc279a28eb2910f1f54d4a.tar.gz gentoo-2-c2a1cf651c6e6c92fafc279a28eb2910f1f54d4a.tar.bz2 gentoo-2-c2a1cf651c6e6c92fafc279a28eb2910f1f54d4a.zip |
Move from gnome overlay for GNOME 3
(Portage version: 2.2.0_alpha51/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/accountsservice')
7 files changed, 356 insertions, 0 deletions
diff --git a/sys-apps/accountsservice/ChangeLog b/sys-apps/accountsservice/ChangeLog new file mode 100644 index 000000000000..6332faa0c0f0 --- /dev/null +++ b/sys-apps/accountsservice/ChangeLog @@ -0,0 +1,15 @@ +# ChangeLog for sys-apps/accountsservice +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/accountsservice/ChangeLog,v 1.1 2011/08/18 05:11:39 nirbheek Exp $ + +*accountsservice-0.6.13 (18 Aug 2011) + + 18 Aug 2011; Nirbheek Chauhan <nirbheek@gentoo.org> + +accountsservice-0.6.13.ebuild, + +files/accountsservice-0.6.13-PATH_GDM_CUSTOM.patch, + +files/accountsservice-0.6.13-SetAutomaticLogin-false.patch, + +files/accountsservice-0.6.13-etc-passwd-timeout.patch, + +files/accountsservice-0.6.13-monitor-etc-gdm-custom.conf.patch, + +metadata.xml: + Move from gnome overlay for GNOME 3 + diff --git a/sys-apps/accountsservice/accountsservice-0.6.13.ebuild b/sys-apps/accountsservice/accountsservice-0.6.13.ebuild new file mode 100644 index 000000000000..34f35ce92363 --- /dev/null +++ b/sys-apps/accountsservice/accountsservice-0.6.13.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/accountsservice/accountsservice-0.6.13.ebuild,v 1.1 2011/08/18 05:11:39 nirbheek Exp $ + +EAPI="3" +GCONF_DEBUG="no" +GNOME2_LA_PUNT="yes" + +inherit eutils gnome2 systemd + +DESCRIPTION="D-Bus interfaces for querying and manipulating user account information" +HOMEPAGE="http://www.fedoraproject.org/wiki/Features/UserAccountDialog" +SRC_URI="http://www.freedesktop.org/software/${PN}/${P}.tar.xz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+introspection" + +RDEPEND=" + dev-libs/glib:2 + dev-libs/dbus-glib + sys-auth/polkit + + introspection? ( >=dev-libs/gobject-introspection-0.9.12 )" +DEPEND="${RDEPEND} + dev-libs/libxslt + dev-util/pkgconfig + sys-devel/gettext + >=dev-util/intltool-0.40" + +# Documentaton doesn't validate +RESTRICT="test" + +pkg_setup() { + # docbook docs don't validate, disable doc rebuild + G2CONF="${G2CONF} + --disable-static + --localstatedir=/var + --disable-docbook-docs + --disable-maintainer-mode + --disable-more-warnings + $(systemd_with_unitdir) + $(use_enable introspection)" + DOCS="AUTHORS NEWS README TODO" +} + +src_prepare() { + # Useful patches from upstream git, will be in next release + epatch "${FILESDIR}/${P}-SetAutomaticLogin-false.patch" \ + "${FILESDIR}/${P}-PATH_GDM_CUSTOM.patch" \ + "${FILESDIR}/${P}-monitor-etc-gdm-custom.conf.patch" \ + "${FILESDIR}/${P}-etc-passwd-timeout.patch" + + gnome2_src_prepare +} diff --git a/sys-apps/accountsservice/files/accountsservice-0.6.13-PATH_GDM_CUSTOM.patch b/sys-apps/accountsservice/files/accountsservice-0.6.13-PATH_GDM_CUSTOM.patch new file mode 100644 index 000000000000..8f57cf15b82b --- /dev/null +++ b/sys-apps/accountsservice/files/accountsservice-0.6.13-PATH_GDM_CUSTOM.patch @@ -0,0 +1,69 @@ +From 0c32736980a4f02d4eacf90d145bf937bf29dea6 Mon Sep 17 00:00:00 2001 +From: Vincent Untz <vuntz@gnome.org> +Date: Thu, 21 Jul 2011 16:04:13 -0400 +Subject: [PATCH 2/4] daemon: use PATH_GDM_CUSTOM instead of string literal + +It's better to consolidate references to file path in one +place up top. +--- + src/daemon.c | 13 ++++--------- + 1 files changed, 4 insertions(+), 9 deletions(-) + +diff --git a/src/daemon.c b/src/daemon.c +index f8753d6..eb9aa61 100644 +--- a/src/daemon.c ++++ b/src/daemon.c +@@ -50,6 +50,7 @@ + #define PATH_PASSWD "/etc/passwd" + #define PATH_SHADOW "/etc/shadow" + #define PATH_LOGIN_DEFS "/etc/login.defs" ++#define PATH_GDM_CUSTOM "/etc/gdm/custom.conf" + + #ifndef FALLBACK_MINIMAL_UID + #define FALLBACK_MINIMAL_UID 500 +@@ -1207,15 +1208,12 @@ load_autologin (Daemon *daemon, + GError **error) + { + GKeyFile *keyfile; +- const gchar *filename; + GError *local_error; + gchar *string; + +- filename = "/etc/gdm/custom.conf"; +- + keyfile = g_key_file_new (); + if (!g_key_file_load_from_file (keyfile, +- filename, ++ PATH_GDM_CUSTOM, + G_KEY_FILE_KEEP_COMMENTS, + error)) { + g_key_file_free (keyfile); +@@ -1257,15 +1255,12 @@ save_autologin (Daemon *daemon, + GError **error) + { + GKeyFile *keyfile; +- const gchar *filename; + gchar *data; + gboolean result; + +- filename = "/etc/gdm/custom.conf"; +- + keyfile = g_key_file_new (); + if (!g_key_file_load_from_file (keyfile, +- filename, ++ PATH_GDM_CUSTOM, + G_KEY_FILE_KEEP_COMMENTS, + error)) { + g_key_file_free (keyfile); +@@ -1276,7 +1271,7 @@ save_autologin (Daemon *daemon, + g_key_file_set_string (keyfile, "daemon", "AutomaticLogin", name); + + data = g_key_file_to_data (keyfile, NULL, NULL); +- result = g_file_set_contents (filename, data, -1, error); ++ result = g_file_set_contents (PATH_GDM_CUSTOM, data, -1, error); + + g_key_file_free (keyfile); + g_free (data); +-- +1.7.6 + diff --git a/sys-apps/accountsservice/files/accountsservice-0.6.13-SetAutomaticLogin-false.patch b/sys-apps/accountsservice/files/accountsservice-0.6.13-SetAutomaticLogin-false.patch new file mode 100644 index 000000000000..9afafc27410f --- /dev/null +++ b/sys-apps/accountsservice/files/accountsservice-0.6.13-SetAutomaticLogin-false.patch @@ -0,0 +1,40 @@ +From df8e8831131663efc7ca42c4016e445362bee843 Mon Sep 17 00:00:00 2001 +From: Ray Strode <rstrode@redhat.com> +Date: Wed, 20 Jul 2011 10:54:35 -0400 +Subject: [PATCH 1/4] daemon: ignore extraneous SetAutomaticLogin(false) calls + for a user + +Right now, if a user is not configured for automatic login, and +SetAutomaticLogin(false) is called for that user then we disable +automatic login system wide even if someone else is configured +for automatic login. + +This commit changes the semantics of the call such that +SetAutomaticLogin(false) is a no op for users where automatic login +isn't already enabled. + +Spotted by Vincent Untz <vuntz@gnome.org> + +https://bugs.freedesktop.org/show_bug.cgi?id=39402 +--- + src/daemon.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/src/daemon.c b/src/daemon.c +index ec319a9..f8753d6 100644 +--- a/src/daemon.c ++++ b/src/daemon.c +@@ -1294,6 +1294,10 @@ daemon_local_set_automatic_login (Daemon *daemon, + return TRUE; + } + ++ if (daemon->priv->autologin != user && !enabled) { ++ return TRUE; ++ } ++ + if (!save_autologin (daemon, user_local_get_user_name (user), enabled, error)) { + return FALSE; + } +-- +1.7.6 + diff --git a/sys-apps/accountsservice/files/accountsservice-0.6.13-etc-passwd-timeout.patch b/sys-apps/accountsservice/files/accountsservice-0.6.13-etc-passwd-timeout.patch new file mode 100644 index 000000000000..36e3f5afbadd --- /dev/null +++ b/sys-apps/accountsservice/files/accountsservice-0.6.13-etc-passwd-timeout.patch @@ -0,0 +1,52 @@ +From 4e3fad33442dfd908561960921aad335fad6b5a8 Mon Sep 17 00:00:00 2001 +From: Ray Strode <rstrode@redhat.com> +Date: Thu, 21 Jul 2011 16:09:13 -0400 +Subject: [PATCH 4/4] daemon: call reload_users after timeout on passwd/shadow + changes + +Often the two files are changed in concert, so it makes sense to +wait a bit before doing a heavy reload operation. + +Suggested by Vincent. + +https://bugs.freedesktop.org/show_bug.cgi?id=39413 +--- + src/daemon.c | 15 ++++++++++++++- + 1 files changed, 14 insertions(+), 1 deletions(-) + +diff --git a/src/daemon.c b/src/daemon.c +index 882fb2f..79915a7 100644 +--- a/src/daemon.c ++++ b/src/daemon.c +@@ -492,6 +492,19 @@ reload_autologin_timeout (Daemon *daemon) + } + + static void ++queue_reload_users_soon (Daemon *daemon) ++{ ++ if (daemon->priv->reload_id > 0) { ++ return; ++ } ++ ++ /* we wait half a second or so in case /etc/passwd and ++ * /etc/shadow are changed at the same time, or repeatedly. ++ */ ++ daemon->priv->reload_id = g_timeout_add (500, (GSourceFunc)reload_users_timeout, daemon); ++} ++ ++static void + queue_reload_users (Daemon *daemon) + { + if (daemon->priv->reload_id > 0) { +@@ -523,7 +536,7 @@ on_passwd_monitor_changed (GFileMonitor *monitor, + return; + } + +- reload_users (daemon); ++ queue_reload_users_soon (daemon); + } + + static void +-- +1.7.6 + diff --git a/sys-apps/accountsservice/files/accountsservice-0.6.13-monitor-etc-gdm-custom.conf.patch b/sys-apps/accountsservice/files/accountsservice-0.6.13-monitor-etc-gdm-custom.conf.patch new file mode 100644 index 000000000000..0389c7e2c5d5 --- /dev/null +++ b/sys-apps/accountsservice/files/accountsservice-0.6.13-monitor-etc-gdm-custom.conf.patch @@ -0,0 +1,115 @@ +From 07ea415a5ea0fc5039c947f967c5683ef0e31201 Mon Sep 17 00:00:00 2001 +From: Vincent Untz <vuntz@gnome.org> +Date: Thu, 21 Jul 2011 08:20:08 +0200 +Subject: [PATCH 3/4] daemon: Monitor /etc/gdm/custom.conf for changes in + autologin config + +We also emit relevant signals when loading the file. + +https://bugs.freedesktop.org/show_bug.cgi?id=39413 +--- + src/daemon.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- + 1 files changed, 47 insertions(+), 4 deletions(-) + +diff --git a/src/daemon.c b/src/daemon.c +index eb9aa61..882fb2f 100644 +--- a/src/daemon.c ++++ b/src/daemon.c +@@ -107,6 +107,7 @@ struct DaemonPrivate { + + GFileMonitor *passwd_monitor; + GFileMonitor *shadow_monitor; ++ GFileMonitor *gdm_monitor; + + guint reload_id; + guint autologin_id; +@@ -451,7 +452,7 @@ reload_autologin_timeout (Daemon *daemon) + gboolean enabled; + gchar *name = NULL; + GError *error = NULL; +- User *user; ++ User *user = NULL; + + daemon->priv->autologin_id = 0; + +@@ -463,11 +464,23 @@ reload_autologin_timeout (Daemon *daemon) + return FALSE; + } + ++ if (enabled && name) ++ user = daemon_local_find_user_by_name (daemon, name); ++ ++ if (daemon->priv->autologin != NULL && daemon->priv->autologin != user) { ++ g_object_set (daemon->priv->autologin, "automatic-login", FALSE, NULL); ++ g_signal_emit_by_name (daemon->priv->autologin, "changed", 0); ++ g_object_unref (daemon->priv->autologin); ++ daemon->priv->autologin = NULL; ++ } ++ + if (enabled) { + g_debug ("automatic login is enabled for '%s'\n", name); +- user = daemon_local_find_user_by_name (daemon, name); +- g_object_set (user, "automatic-login", TRUE, NULL); +- daemon->priv->autologin = g_object_ref (user); ++ if (daemon->priv->autologin != user) { ++ g_object_set (user, "automatic-login", TRUE, NULL); ++ daemon->priv->autologin = g_object_ref (user); ++ g_signal_emit_by_name (daemon->priv->autologin, "changed", 0); ++ } + } + else { + g_debug ("automatic login is disabled\n"); +@@ -513,6 +526,21 @@ on_passwd_monitor_changed (GFileMonitor *monitor, + reload_users (daemon); + } + ++static void ++on_gdm_monitor_changed (GFileMonitor *monitor, ++ GFile *file, ++ GFile *other_file, ++ GFileMonitorEvent event_type, ++ Daemon *daemon) ++{ ++ if (event_type != G_FILE_MONITOR_EVENT_CHANGED && ++ event_type != G_FILE_MONITOR_EVENT_CREATED) { ++ return; ++ } ++ ++ queue_reload_autologin (daemon); ++} ++ + static uid_t + get_minimal_uid (void) + { +@@ -603,6 +631,12 @@ daemon_init (Daemon *daemon) + NULL, + &error); + g_object_unref (file); ++ file = g_file_new_for_path (PATH_GDM_CUSTOM); ++ daemon->priv->gdm_monitor = g_file_monitor_file (file, ++ G_FILE_MONITOR_NONE, ++ NULL, ++ &error); ++ g_object_unref (file); + + if (daemon->priv->passwd_monitor != NULL) { + g_signal_connect (daemon->priv->passwd_monitor, +@@ -622,6 +656,15 @@ daemon_init (Daemon *daemon) + g_warning ("Unable to monitor %s: %s", PATH_SHADOW, error->message); + g_error_free (error); + } ++ if (daemon->priv->gdm_monitor != NULL) { ++ g_signal_connect (daemon->priv->gdm_monitor, ++ "changed", ++ G_CALLBACK (on_gdm_monitor_changed), ++ daemon); ++ } else { ++ g_warning ("Unable to monitor %s: %s", PATH_GDM_CUSTOM, error->message); ++ g_error_free (error); ++ } + + queue_reload_users (daemon); + queue_reload_autologin (daemon); +-- +1.7.6 + diff --git a/sys-apps/accountsservice/metadata.xml b/sys-apps/accountsservice/metadata.xml new file mode 100644 index 000000000000..44825d13c084 --- /dev/null +++ b/sys-apps/accountsservice/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>gnome</herd> + <use> + <flag name="introspection">Use <pkg>dev-libs/gobject-introspection</pkg> + for introspection</flag> + </use> +</pkgmetadata> |