From b46659935d722d1ef74aa8c8417f49c19d553b89 Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Thu, 8 Sep 2011 13:56:53 +0000 Subject: [PATCH] For now, revert upstream commit: 'daemon: get login frequency from wtmp instead of ConsoleKit' It makes use of utmpx so we'll have to port it over. --- sysutils/accountsservice/Makefile | 18 ++++++- sysutils/accountsservice/distinfo | 5 ++ .../patches/patch-src_daemon_c | 52 +++++-------------- 3 files changed, 34 insertions(+), 41 deletions(-) diff --git a/sysutils/accountsservice/Makefile b/sysutils/accountsservice/Makefile index 4e1ecc499f6..426c7fdc8ac 100644 --- a/sysutils/accountsservice/Makefile +++ b/sysutils/accountsservice/Makefile @@ -1,10 +1,26 @@ -# $OpenBSD: Makefile,v 1.13 2011/09/08 13:15:52 ajacoutot Exp $ +# $OpenBSD: Makefile,v 1.14 2011/09/08 13:56:53 ajacoutot Exp $ + +# XXX revert the following commits for now (OpenBSD doesn't have utmpx) +# +# From a4e478b9fef287698a3369d4b0d779c8ab949ff3 Mon Sep 17 00:00:00 2001 +# From: Ray Strode +# Date: Tue, 19 Jul 2011 19:18:11 +0000 +# Subject: daemon: fix up some problems in last commit +# +# From 281ac4126636a7a701b95c465ab9de7762e17fdf Mon Sep 17 00:00:00 2001 +# From: Lennart Poettering +# Date: Sun, 17 Jul 2011 01:36:57 +0000 +# Subject: daemon: get login frequency from wtmp instead of ConsoleKit +PATCHFILES= accountsservice-daemon_c.patch:0 +MASTER_SITES0= http://distfiles.bsdfrog.org/ COMMENT= D-Bus interface for user account query and manipulation DISTNAME= accountsservice-0.6.14 EXTRACT_SUFX= .tar.xz +REVISION= 0 + SHARED_LIBS += accountsservice 0.0 # 0.0 CATEGORIES= sysutils diff --git a/sysutils/accountsservice/distinfo b/sysutils/accountsservice/distinfo index 933fc74805f..2eb55576e38 100644 --- a/sysutils/accountsservice/distinfo +++ b/sysutils/accountsservice/distinfo @@ -1,5 +1,10 @@ MD5 (accountsservice-0.6.14.tar.xz) = NCL/FY7ig0NExTRRbl6KnQ== +MD5 (accountsservice-daemon_c.patch) = 2fDKv2flRlwA4EbH/GqyNw== RMD160 (accountsservice-0.6.14.tar.xz) = rQPmGM4SN4V0asfjcxHvLsVl9Jo= +RMD160 (accountsservice-daemon_c.patch) = TlLSCOo8VeaDGaFAZypT7hPSfOg= SHA1 (accountsservice-0.6.14.tar.xz) = p0gVAyJrB52TplzBA4ELyuMm6Hc= +SHA1 (accountsservice-daemon_c.patch) = qJPnhz7lXZdR0DyGXX5/kG7WWTY= SHA256 (accountsservice-0.6.14.tar.xz) = /PJvUZhSE5LxEHipF35DDgygm9a8SBsQb8DLvFhr/WQ= +SHA256 (accountsservice-daemon_c.patch) = /bCesCKkKwqCLiHzkBs5HVP3TAsPLEotsuBs21bBBFo= SIZE (accountsservice-0.6.14.tar.xz) = 286220 +SIZE (accountsservice-daemon_c.patch) = 12784 diff --git a/sysutils/accountsservice/patches/patch-src_daemon_c b/sysutils/accountsservice/patches/patch-src_daemon_c index 18bb12b2d2f..e6aaef8624d 100644 --- a/sysutils/accountsservice/patches/patch-src_daemon_c +++ b/sysutils/accountsservice/patches/patch-src_daemon_c @@ -1,17 +1,7 @@ -$OpenBSD: patch-src_daemon_c,v 1.7 2011/09/08 13:15:52 ajacoutot Exp $ ---- src/daemon.c.orig Tue Aug 16 14:53:31 2011 -+++ src/daemon.c Thu Sep 8 15:09:16 2011 -@@ -32,7 +32,9 @@ - #include - #include - #include -+#ifndef __OpenBSD__ - #include -+#endif - - #include - #include -@@ -50,13 +52,17 @@ +$OpenBSD: patch-src_daemon_c,v 1.8 2011/09/08 13:56:53 ajacoutot Exp $ +--- src/daemon.c.orig Thu Sep 8 15:52:39 2011 ++++ src/daemon.c Thu Sep 8 15:52:39 2011 +@@ -49,13 +49,17 @@ #define PATH_PASSWD "/etc/passwd" #define PATH_SHADOW "/etc/shadow" #define PATH_LOGIN_DEFS "/etc/login.defs" @@ -31,25 +21,7 @@ $OpenBSD: patch-src_daemon_c,v 1.7 2011/09/08 13:15:52 ajacoutot Exp $ static const char *default_excludes[] = { "bin", -@@ -238,6 +244,9 @@ daemon_local_user_is_excluded (Daemon *daemon, const g - static void - reload_wtmp_history (Daemon *daemon) - { -+#ifdef __OpenBSD__ -+ return; -+#else - struct utmpx *wtmp_entry; - GHashTable *login_frequency_hash; - GHashTableIter iter; -@@ -298,6 +307,7 @@ reload_wtmp_history (Daemon *daemon) - - g_hash_table_foreach (login_frequency_hash, (GHFunc) g_free, NULL); - g_hash_table_unref (login_frequency_hash); -+#endif - } - - static void -@@ -326,22 +336,32 @@ reload_passwd (Daemon *daemon) +@@ -490,22 +494,32 @@ reload_passwd (Daemon *daemon) GSList *old_users; GSList *new_users; GSList *list; @@ -82,7 +54,7 @@ $OpenBSD: patch-src_daemon_c,v 1.7 2011/09/08 13:15:52 ajacoutot Exp $ /* Skip users below MINIMAL_UID... */ if (daemon_local_user_is_excluded (daemon, pwent->pw_name, pwent->pw_uid)) { g_debug ("skipping user: %s", pwent->pw_name); -@@ -391,10 +411,14 @@ reload_passwd (Daemon *daemon) +@@ -555,10 +569,14 @@ reload_passwd (Daemon *daemon) } } @@ -97,7 +69,7 @@ $OpenBSD: patch-src_daemon_c,v 1.7 2011/09/08 13:15:52 ajacoutot Exp $ g_slist_foreach (new_users, (GFunc) g_object_thaw_notify, NULL); g_slist_foreach (new_users, (GFunc) g_object_unref, NULL); -@@ -554,9 +578,16 @@ on_gdm_monitor_changed (GFileMonitor *monitor, +@@ -718,9 +736,16 @@ on_gdm_monitor_changed (GFileMonitor *monitor, queue_reload_autologin (daemon); } @@ -114,7 +86,7 @@ $OpenBSD: patch-src_daemon_c,v 1.7 2011/09/08 13:15:52 ajacoutot Exp $ GError *error; char *contents; gboolean contents_loaded; -@@ -606,6 +637,7 @@ out: +@@ -770,6 +795,7 @@ out: g_free (contents); return uid; } @@ -122,7 +94,7 @@ $OpenBSD: patch-src_daemon_c,v 1.7 2011/09/08 13:15:52 ajacoutot Exp $ static void daemon_init (Daemon *daemon) -@@ -1002,7 +1034,12 @@ daemon_create_user_authorized_cb (Daemon +@@ -1183,7 +1209,12 @@ daemon_create_user_authorized_cb (Daemon CreateUserData *cd = data; User *user; GError *error; @@ -135,7 +107,7 @@ $OpenBSD: patch-src_daemon_c,v 1.7 2011/09/08 13:15:52 ajacoutot Exp $ if (getpwnam (cd->user_name) != NULL) { throw_error (context, ERROR_USER_EXISTS, "A user with name '%s' already exists", cd->user_name); -@@ -1010,6 +1047,22 @@ daemon_create_user_authorized_cb (Daemon +@@ -1191,6 +1222,22 @@ daemon_create_user_authorized_cb (Daemon return; } @@ -158,7 +130,7 @@ $OpenBSD: patch-src_daemon_c,v 1.7 2011/09/08 13:15:52 ajacoutot Exp $ sys_log (context, "create user '%s'", cd->user_name); argv[0] = "/usr/sbin/useradd"; -@@ -1018,15 +1071,34 @@ daemon_create_user_authorized_cb (Daemon +@@ -1199,15 +1246,34 @@ daemon_create_user_authorized_cb (Daemon argv[3] = cd->real_name; if (cd->account_type == ACCOUNT_TYPE_ADMINISTRATOR) { argv[4] = "-G"; @@ -193,7 +165,7 @@ $OpenBSD: patch-src_daemon_c,v 1.7 2011/09/08 13:15:52 ajacoutot Exp $ } else { throw_error (context, ERROR_FAILED, "Don't know how to add user of type %d", cd->account_type); -@@ -1096,6 +1168,23 @@ daemon_delete_user_authorized_cb (Daemon +@@ -1277,6 +1343,23 @@ daemon_delete_user_authorized_cb (Daemon return; }