update to 22.08.8
This commit is contained in:
parent
d3f858577f
commit
536ef06080
|
@ -3,9 +3,8 @@
|
|||
COMMENT= D-Bus interface for user account query and manipulation
|
||||
|
||||
# XXX 0.6.43: https://bugs.freedesktop.org/show_bug.cgi?id=48177
|
||||
DISTNAME= accountsservice-0.6.55
|
||||
DISTNAME= accountsservice-22.08.8
|
||||
EXTRACT_SUFX= .tar.xz
|
||||
REVISION= 1
|
||||
|
||||
SHARED_LIBS += accountsservice 0.1 # 0.0.0
|
||||
|
||||
|
@ -19,15 +18,19 @@ MAINTAINER= Antoine Jacoutot <ajacoutot@openbsd.org>
|
|||
PERMIT_PACKAGE= Yes
|
||||
|
||||
WANTLIB += c gio-2.0 glib-2.0 gobject-2.0 intl polkit-gobject-1
|
||||
WANTLIB += consolekit crypt
|
||||
|
||||
MASTER_SITES= http://www.freedesktop.org/software/accountsservice/
|
||||
|
||||
MODULES= devel/meson
|
||||
|
||||
BUILD_DEPENDS= devel/gettext,-tools \
|
||||
devel/gobject-introspection
|
||||
devel/gobject-introspection \
|
||||
lang/vala
|
||||
|
||||
LIB_DEPENDS= sysutils/polkit
|
||||
LIB_DEPENDS= security/libxcrypt \
|
||||
sysutils/consolekit \
|
||||
sysutils/polkit
|
||||
|
||||
# polkit(8) almost always needs to know the "active" session
|
||||
RUN_DEPENDS += sysutils/consolekit
|
||||
|
@ -37,14 +40,11 @@ RUN_DEPENDS += x11/dbus,-suid
|
|||
|
||||
CONFIGURE_ARGS= -Dsystemdsystemunitdir=no \
|
||||
-Dadmin_group=wheel \
|
||||
-Duser_heuristics=false \
|
||||
-Dminimum_uid=1000
|
||||
|
||||
DEBUG_PACKAGES= ${BUILD_PACKAGES}
|
||||
|
||||
post-install:
|
||||
rm -r ${WRKINST}/var/lib
|
||||
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/accountsservice
|
||||
mv ${WRKINST}/etc/dbus-1 ${PREFIX}/share/examples/accountsservice/
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
SHA256 (accountsservice-0.6.55.tar.xz) = /yskGafga9nLM1/+ORx0CbSaDwEwuJC9VGkqOYZpnJs=
|
||||
SIZE (accountsservice-0.6.55.tar.xz) = 97972
|
||||
SHA256 (accountsservice-22.08.8.tar.xz) = kJmXp2kZ/n3BOKmgHOpwvWItWpMtvJ+xMBARMCOno5E=
|
||||
SIZE (accountsservice-22.08.8.tar.xz) = 102672
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
Fix build with meson >= 0.60.0
|
||||
|
||||
Index: data/meson.build
|
||||
--- data/meson.build.orig
|
||||
+++ data/meson.build
|
||||
@@ -29,7 +29,6 @@ configure_file(
|
||||
policy = act_namespace.to_lower() + '.policy'
|
||||
|
||||
i18n.merge_file(
|
||||
- policy,
|
||||
input: policy + '.in',
|
||||
output: policy,
|
||||
po_dir: po_dir,
|
|
@ -1,27 +1,33 @@
|
|||
Index: meson.build
|
||||
--- meson.build.orig
|
||||
+++ meson.build
|
||||
@@ -82,8 +82,8 @@ if cc.has_header_symbol('utmpx.h', 'WTMPX_FILENAME', p
|
||||
elif cc.has_header_symbol('paths.h', '_PATH_WTMPX')
|
||||
@@ -101,7 +101,7 @@ elif cc.has_header_symbol('paths.h', '_PATH_WTMPX')
|
||||
|
||||
config_h.set('PATH_WTMP', '_PATH_WTMPX')
|
||||
else
|
||||
- assert(run_command('test', '-e', '/var/log/utx.log').returncode() == 0, 'Do not know which filename to watch for wtmp changes')
|
||||
- config_h.set_quoted('PATH_WTMP', '/var/log/utx.log')
|
||||
+ assert(run_command('test', '-e', '/var/log/wtmp').returncode() == 0, 'Do not know which filename to watch for wtmp changes')
|
||||
+ config_h.set_quoted('PATH_WTMP', '/var/log/wtmp')
|
||||
- path_wtmp = '/var/log/utx.log'
|
||||
+ path_wtmp = '/var/log/wtmp'
|
||||
assert(run_command('test', '-e', path_wtmp).returncode() == 0, 'Do not know which filename to watch for wtmp changes')
|
||||
config_h.set_quoted('PATH_WTMP', path_wtmp)
|
||||
endif
|
||||
|
||||
# compiler flags
|
||||
@@ -123,7 +123,11 @@ gio_unix_dep = dependency('gio-unix-2.0')
|
||||
glib_dep = dependency('glib-2.0', version: '>= 2.44')
|
||||
@@ -145,6 +145,7 @@ gio_dep = dependency('gio-2.0', version: '>= ' + glib_
|
||||
gio_unix_dep = dependency('gio-unix-2.0')
|
||||
glib_dep = dependency('glib-2.0', version: '>= ' + glib_min_version)
|
||||
polkit_gobject_dep = dependency('polkit-gobject-1')
|
||||
+libconsolekit_dep = dependency('libconsolekit')
|
||||
|
||||
-crypt_dep = cc.find_library('crypt')
|
||||
+if host_machine.system() == 'linux'
|
||||
+ crypt_dep = cc.find_library('crypt')
|
||||
+else
|
||||
+ crypt_dep = declare_dependency()
|
||||
+endif
|
||||
# Using libxcrypt >= 4 we can be sure `crypt_gensalt (NULL, 0, NULL, 0)`
|
||||
# always returns a setting that is valid to use with `crypt (pw, setting)`.
|
||||
@@ -207,11 +208,7 @@ config_h.set('MINIMUM_UID', get_option('minimum_uid'))
|
||||
gdm_conf_file = get_option('gdmconffile')
|
||||
config_h.set_quoted('PATH_GDM_CUSTOM', gdm_conf_file)
|
||||
|
||||
dbus_dep = dependency('dbus-1')
|
||||
dbus_conf_dir = join_paths(dbus_dep.get_pkgconfig_variable('sysconfdir', define_variable: ['sysconfdir', act_sysconfdir]), 'dbus-1', 'system.d')
|
||||
-if get_option('elogind')
|
||||
- logind_dep = dependency('libelogind', version: '>= 229.4')
|
||||
-else
|
||||
- logind_dep = dependency('libsystemd', version: '>= 186')
|
||||
-endif
|
||||
+logind_dep = []
|
||||
|
||||
subdir('data')
|
||||
subdir('src')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Index: src/daemon.c
|
||||
--- src/daemon.c.orig
|
||||
+++ src/daemon.c
|
||||
@@ -36,6 +36,10 @@
|
||||
@@ -37,6 +37,10 @@
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
@ -12,19 +12,19 @@ Index: src/daemon.c
|
|||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <glib-object.h>
|
||||
@@ -81,7 +85,11 @@ typedef struct {
|
||||
@@ -84,7 +88,11 @@ typedef struct {
|
||||
GHashTable *extension_ifaces;
|
||||
} DaemonPrivate;
|
||||
|
||||
+#ifdef HAVE_SHADOW_H
|
||||
typedef struct passwd * (* EntryGeneratorFunc) (Daemon *, GHashTable *, gpointer *, struct spwd **shadow_entry);
|
||||
+#else
|
||||
+#else
|
||||
+typedef struct passwd * (* EntryGeneratorFunc) (Daemon *, GHashTable *, gpointer *);
|
||||
+#endif
|
||||
|
||||
typedef struct {
|
||||
Daemon *daemon;
|
||||
@@ -165,17 +173,25 @@ remove_cache_files (const gchar *user_name)
|
||||
@@ -168,17 +176,25 @@ remove_cache_files (const gchar *user_name)
|
||||
}
|
||||
|
||||
static struct passwd *
|
||||
|
@ -50,7 +50,7 @@ Index: src/daemon.c
|
|||
|
||||
struct {
|
||||
FILE *fp;
|
||||
@@ -184,8 +200,11 @@ entry_generator_fgetpwent (Daemon *daemon,
|
||||
@@ -187,8 +203,11 @@ entry_generator_fgetpwent (Daemon *daemon,
|
||||
|
||||
/* First iteration */
|
||||
if (*state == NULL) {
|
||||
|
@ -62,7 +62,7 @@ Index: src/daemon.c
|
|||
struct spwd *shadow_entry;
|
||||
|
||||
fp = fopen (PATH_SHADOW, "r");
|
||||
@@ -219,17 +238,22 @@ entry_generator_fgetpwent (Daemon *daemon,
|
||||
@@ -222,17 +241,22 @@ entry_generator_fgetpwent (Daemon *daemon,
|
||||
g_clear_pointer (&shadow_users, g_hash_table_unref);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ Index: src/daemon.c
|
|||
|
||||
*state = generator_state;
|
||||
}
|
||||
@@ -240,18 +264,22 @@ entry_generator_fgetpwent (Daemon *daemon,
|
||||
@@ -243,17 +267,27 @@ entry_generator_fgetpwent (Daemon *daemon,
|
||||
if (g_hash_table_size (users) < MAX_LOCAL_USERS) {
|
||||
pwent = fgetpwent (generator_state->fp);
|
||||
if (pwent != NULL) {
|
||||
|
@ -96,9 +96,24 @@ Index: src/daemon.c
|
|||
*spent = &shadow_entry_buffers->spbuf;
|
||||
}
|
||||
+#endif
|
||||
|
||||
/* Skip system users... */
|
||||
+#ifdef HAVE_SHADOW_H
|
||||
if (!user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, (*spent)? (*spent)->sp_pwdp : NULL)) {
|
||||
+#else
|
||||
+ if (!user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, NULL)) {
|
||||
+#endif
|
||||
g_debug ("skipping user: %s", pwent->pw_name);
|
||||
|
||||
+#ifdef HAVE_SHADOW_H
|
||||
return entry_generator_fgetpwent (daemon, users, state, spent);
|
||||
+#else
|
||||
+ return entry_generator_fgetpwent (daemon, users, state);
|
||||
+#endif
|
||||
}
|
||||
|
||||
return pwent;
|
||||
}
|
||||
}
|
||||
@@ -262,7 +296,9 @@ entry_generator_fgetpwent (Daemon *daemon,
|
||||
|
||||
/* Last iteration */
|
||||
fclose (generator_state->fp);
|
||||
|
@ -108,7 +123,7 @@ Index: src/daemon.c
|
|||
g_free (generator_state);
|
||||
*state = NULL;
|
||||
|
||||
@@ -259,10 +287,16 @@ entry_generator_fgetpwent (Daemon *daemon,
|
||||
@@ -270,10 +306,16 @@ entry_generator_fgetpwent (Daemon *daemon,
|
||||
}
|
||||
|
||||
static struct passwd *
|
||||
|
@ -125,7 +140,7 @@ Index: src/daemon.c
|
|||
{
|
||||
struct passwd *pwent;
|
||||
g_autoptr(GError) error = NULL;
|
||||
@@ -304,7 +338,9 @@ entry_generator_cachedir (Daemon *daemon,
|
||||
@@ -315,7 +357,9 @@ entry_generator_cachedir (Daemon *daemon,
|
||||
errno = 0;
|
||||
pwent = getpwnam (name);
|
||||
if (pwent != NULL) {
|
||||
|
@ -135,7 +150,7 @@ Index: src/daemon.c
|
|||
|
||||
return pwent;
|
||||
} else if (errno == 0) {
|
||||
@@ -340,10 +376,16 @@ entry_generator_cachedir (Daemon *daemon,
|
||||
@@ -345,10 +389,16 @@ entry_generator_cachedir (Daemon *daemon,
|
||||
}
|
||||
|
||||
static struct passwd *
|
||||
|
@ -152,7 +167,7 @@ Index: src/daemon.c
|
|||
{
|
||||
DaemonPrivate *priv = daemon_get_instance_private (daemon);
|
||||
struct passwd *pwent;
|
||||
@@ -371,7 +413,9 @@ entry_generator_requested_users (Daemon *daemon,
|
||||
@@ -376,7 +426,9 @@ entry_generator_requested_users (Daemon *daemon,
|
||||
if (pwent == NULL) {
|
||||
g_debug ("user '%s' requested previously but not present on system", name);
|
||||
} else {
|
||||
|
@ -162,7 +177,7 @@ Index: src/daemon.c
|
|||
|
||||
return pwent;
|
||||
}
|
||||
@@ -394,19 +438,29 @@ load_entries (Daemon *daemon,
|
||||
@@ -399,14 +451,20 @@ load_entries (Daemon *daemon,
|
||||
DaemonPrivate *priv = daemon_get_instance_private (daemon);
|
||||
gpointer generator_state = NULL;
|
||||
struct passwd *pwent;
|
||||
|
@ -183,16 +198,7 @@ Index: src/daemon.c
|
|||
if (pwent == NULL)
|
||||
break;
|
||||
|
||||
/* Skip system users... */
|
||||
+#ifdef HAVE_SHADOW_H
|
||||
if (!explicitly_requested && !user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, spent? spent->sp_pwdp : NULL)) {
|
||||
+#else
|
||||
+ if (!explicitly_requested && !user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, NULL)) {
|
||||
+#endif
|
||||
g_debug ("skipping user: %s", pwent->pw_name);
|
||||
continue;
|
||||
}
|
||||
@@ -428,7 +482,11 @@ load_entries (Daemon *daemon,
|
||||
@@ -427,7 +485,11 @@ load_entries (Daemon *daemon,
|
||||
|
||||
/* freeze & update users not already in the new list */
|
||||
g_object_freeze_notify (G_OBJECT (user));
|
||||
|
@ -204,7 +210,7 @@ Index: src/daemon.c
|
|||
|
||||
g_hash_table_insert (users, g_strdup (user_get_user_name (user)), user);
|
||||
g_debug ("loaded user: %s", user_get_user_name (user));
|
||||
@@ -843,15 +901,24 @@ throw_error (GDBusMethodInvocation *context,
|
||||
@@ -841,15 +903,24 @@ throw_error (GDBusMethodInvocation *context,
|
||||
}
|
||||
|
||||
static User *
|
||||
|
@ -229,7 +235,7 @@ Index: src/daemon.c
|
|||
user_register (user);
|
||||
|
||||
g_hash_table_insert (priv->users,
|
||||
@@ -880,9 +947,13 @@ daemon_local_find_user_by_id (Daemon *daemon,
|
||||
@@ -878,9 +949,13 @@ daemon_local_find_user_by_id (Daemon *daemon,
|
||||
user = g_hash_table_lookup (priv->users, pwent->pw_name);
|
||||
|
||||
if (user == NULL) {
|
||||
|
@ -243,7 +249,7 @@ Index: src/daemon.c
|
|||
|
||||
priv->explicitly_requested_users = g_list_append (priv->explicitly_requested_users,
|
||||
g_strdup (pwent->pw_name));
|
||||
@@ -908,9 +979,13 @@ daemon_local_find_user_by_name (Daemon *daemon,
|
||||
@@ -906,9 +981,13 @@ daemon_local_find_user_by_name (Daemon *daemon,
|
||||
user = g_hash_table_lookup (priv->users, pwent->pw_name);
|
||||
|
||||
if (user == NULL) {
|
||||
|
@ -257,7 +263,7 @@ Index: src/daemon.c
|
|||
|
||||
priv->explicitly_requested_users = g_list_append (priv->explicitly_requested_users,
|
||||
g_strdup (pwent->pw_name));
|
||||
@@ -1096,7 +1171,11 @@ daemon_create_user_authorized_cb (Daemon
|
||||
@@ -1092,7 +1171,11 @@ daemon_create_user_authorized_cb (Daemon
|
||||
CreateUserData *cd = data;
|
||||
User *user;
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
@ -269,7 +275,7 @@ Index: src/daemon.c
|
|||
g_autofree gchar *admin_groups = NULL;
|
||||
|
||||
if (getpwnam (cd->user_name) != NULL) {
|
||||
@@ -1119,9 +1198,17 @@ daemon_create_user_authorized_cb (Daemon
|
||||
@@ -1128,9 +1211,17 @@ daemon_create_user_authorized_cb (Daemon
|
||||
|
||||
argv[4] = "-G";
|
||||
argv[5] = admin_groups;
|
||||
|
@ -287,7 +293,7 @@ Index: src/daemon.c
|
|||
}
|
||||
else if (cd->account_type == ACCOUNT_TYPE_STANDARD) {
|
||||
argv[4] = "--";
|
||||
@@ -1302,6 +1389,34 @@ daemon_delete_user_authorized_cb (Daemon
|
||||
@@ -1310,6 +1401,34 @@ daemon_delete_user_authorized_cb (Daemon
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -322,7 +328,7 @@ Index: src/daemon.c
|
|||
sys_log (context, "delete user '%s' (%d)", pwent->pw_name, ud->uid);
|
||||
|
||||
user = daemon_local_find_user_by_id (daemon, ud->uid);
|
||||
@@ -1320,11 +1435,18 @@ daemon_delete_user_authorized_cb (Daemon
|
||||
@@ -1337,11 +1456,18 @@ daemon_delete_user_authorized_cb (Daemon
|
||||
|
||||
argv[0] = "/usr/sbin/userdel";
|
||||
if (ud->remove_files) {
|
||||
|
|
|
@ -7,7 +7,157 @@ Subject: [PATCH] lib: don't set loaded state until seat is fetched
|
|||
Index: src/libaccountsservice/act-user-manager.c
|
||||
--- src/libaccountsservice/act-user-manager.c.orig
|
||||
+++ src/libaccountsservice/act-user-manager.c
|
||||
@@ -2547,7 +2547,7 @@ maybe_set_is_loaded (ActUserManager *manager)
|
||||
@@ -40,7 +40,11 @@
|
||||
#include <glib-object.h>
|
||||
#include <gio/gio.h>
|
||||
#include <gio/gunixinputstream.h>
|
||||
+#ifdef __linux__
|
||||
#include <systemd/sd-login.h>
|
||||
+#else
|
||||
+#include <ConsoleKit/sd-login.h>
|
||||
+#endif
|
||||
|
||||
#include "act-user-manager.h"
|
||||
#include "act-user-private.h"
|
||||
@@ -99,9 +103,11 @@ typedef struct
|
||||
char *id;
|
||||
char *session_id;
|
||||
guint load_idle_id;
|
||||
+#ifdef __linux__
|
||||
sd_login_monitor *session_monitor;
|
||||
GInputStream *session_monitor_stream;
|
||||
guint session_monitor_source_id;
|
||||
+#endif
|
||||
} ActUserManagerSeat;
|
||||
|
||||
typedef enum {
|
||||
@@ -261,6 +267,7 @@ activate_systemd_session_id (ActUserManager *manager,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+#ifdef __linux__
|
||||
reply = g_dbus_connection_call_sync (connection,
|
||||
"org.freedesktop.login1",
|
||||
"/org/freedesktop/login1",
|
||||
@@ -274,6 +281,21 @@ activate_systemd_session_id (ActUserManager *manager,
|
||||
-1,
|
||||
NULL,
|
||||
&error);
|
||||
+#else
|
||||
+ reply = g_dbus_connection_call_sync (connection,
|
||||
+ "org.freedesktop.ConsoleKit",
|
||||
+ "/org/freedesktop/ConsoleKit/Manager",
|
||||
+ "org.freedesktop.ConsoleKit.Manager",
|
||||
+ "ActivateSessionOnSeat",
|
||||
+ g_variant_new ("(ss)",
|
||||
+ seat_id,
|
||||
+ session_id),
|
||||
+ NULL,
|
||||
+ G_DBUS_CALL_FLAGS_NONE,
|
||||
+ -1,
|
||||
+ NULL,
|
||||
+ &error);
|
||||
+#endif
|
||||
if (reply == NULL) {
|
||||
g_warning ("Unable to activate session: %s", error->message);
|
||||
return FALSE;
|
||||
@@ -309,9 +331,7 @@ session_is_on_our_seat (ActUserManager *manager,
|
||||
g_autofree gchar *session_seat = NULL;
|
||||
|
||||
res = sd_session_get_seat (session_id, &session_seat);
|
||||
- if (res == -ENODATA) {
|
||||
- return FALSE;
|
||||
- } else if (res < 0) {
|
||||
+ if (res < 0) {
|
||||
g_debug ("failed to determine seat of session %s: %s",
|
||||
session_id,
|
||||
strerror (-res));
|
||||
@@ -355,6 +375,8 @@ act_user_manager_goto_login_session (ActUserManager *m
|
||||
static gboolean
|
||||
_can_activate_systemd_sessions (ActUserManager *manager)
|
||||
{
|
||||
+printf("%s:%d\n", __FUNCTION__, __LINE__);
|
||||
+#ifdef __linux__
|
||||
ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager);
|
||||
int res;
|
||||
|
||||
@@ -366,6 +388,9 @@ _can_activate_systemd_sessions (ActUserManager *manage
|
||||
}
|
||||
|
||||
return res > 0;
|
||||
+#else
|
||||
+ return TRUE;
|
||||
+#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -627,9 +652,7 @@ get_seat_id_for_current_session (ActUserManager *manag
|
||||
|
||||
res = sd_session_get_seat (priv->seat.session_id, &seat_id);
|
||||
|
||||
- if (res == -ENODATA) {
|
||||
- seat_id = NULL;
|
||||
- } else if (res < 0) {
|
||||
+ if (res < 0) {
|
||||
g_warning ("Could not get current seat: %s",
|
||||
strerror (-res));
|
||||
unload_seat (manager);
|
||||
@@ -1332,8 +1355,12 @@ get_x11_display_for_new_session (ActUserManagerNewSess
|
||||
goto done;
|
||||
}
|
||||
|
||||
+#ifndef __OpenBSD__
|
||||
res = sd_session_get_display (new_session->id,
|
||||
&x11_display);
|
||||
+#else
|
||||
+ res = -1;
|
||||
+#endif
|
||||
if (res < 0) {
|
||||
g_debug ("ActUserManager: Failed to get the x11 display of session '%s': %s",
|
||||
new_session->id,
|
||||
@@ -1562,6 +1589,7 @@ _remove_stale_systemd_sessions (ActUserManager *manage
|
||||
static void
|
||||
reload_systemd_sessions (ActUserManager *manager)
|
||||
{
|
||||
+#ifdef __linux__
|
||||
int res;
|
||||
int i;
|
||||
g_auto(GStrv) sessions = NULL;
|
||||
@@ -1610,21 +1638,25 @@ reload_systemd_sessions (ActUserManager *manager)
|
||||
|
||||
_add_new_systemd_sessions (manager, systemd_sessions);
|
||||
_remove_stale_systemd_sessions (manager, systemd_sessions);
|
||||
+#endif
|
||||
}
|
||||
|
||||
static gboolean
|
||||
on_session_monitor_event (GPollableInputStream *stream,
|
||||
ActUserManager *manager)
|
||||
{
|
||||
+#ifdef __linux__
|
||||
ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager);
|
||||
sd_login_monitor_flush (priv->seat.session_monitor);
|
||||
reload_systemd_sessions (manager);
|
||||
+#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_monitor_for_systemd_session_changes (ActUserManager *manager)
|
||||
{
|
||||
+#ifdef __linux__
|
||||
ActUserManagerPrivate *priv = act_user_manager_get_instance_private (manager);
|
||||
int res;
|
||||
int fd;
|
||||
@@ -1651,6 +1683,7 @@ _monitor_for_systemd_session_changes (ActUserManager *
|
||||
NULL);
|
||||
priv->seat.session_monitor_source_id = g_source_attach (source, NULL);
|
||||
g_source_unref (source);
|
||||
+#endif
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2034,7 +2067,7 @@ maybe_set_is_loaded (ActUserManager *manager)
|
||||
/* Don't set is_loaded yet unless the seat is already loaded enough
|
||||
* or failed to load.
|
||||
*/
|
||||
|
@ -16,3 +166,19 @@ Index: src/libaccountsservice/act-user-manager.c
|
|||
g_debug ("ActUserManager: Seat loaded, so now setting loaded property");
|
||||
} else if (priv->seat.state == ACT_USER_MANAGER_SEAT_STATE_UNLOADED) {
|
||||
g_debug ("ActUserManager: Seat wouldn't load, so giving up on it and setting loaded property");
|
||||
@@ -2513,6 +2546,7 @@ act_user_manager_finalize (GObject *object)
|
||||
g_source_remove (priv->seat.load_idle_id);
|
||||
}
|
||||
|
||||
+#ifdef __linux__
|
||||
if (priv->seat.session_monitor != NULL) {
|
||||
sd_login_monitor_unref (priv->seat.session_monitor);
|
||||
}
|
||||
@@ -2524,6 +2558,7 @@ act_user_manager_finalize (GObject *object)
|
||||
if (priv->seat.session_monitor_source_id != 0) {
|
||||
g_source_remove (priv->seat.session_monitor_source_id);
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (priv->accounts_proxy != NULL) {
|
||||
g_object_unref (priv->accounts_proxy);
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
Index: src/libaccountsservice/meson.build
|
||||
--- src/libaccountsservice/meson.build.orig
|
||||
+++ src/libaccountsservice/meson.build
|
||||
@@ -34,6 +34,7 @@ deps = [
|
||||
glib_dep,
|
||||
libaccounts_generated_dep,
|
||||
logind_dep,
|
||||
+ libconsolekit_dep,
|
||||
]
|
||||
|
||||
symbol_map = join_paths(meson.current_source_dir(), 'symbol.map')
|
|
@ -1,10 +1,10 @@
|
|||
Index: src/meson.build
|
||||
--- src/meson.build.orig
|
||||
+++ src/meson.build
|
||||
@@ -26,8 +26,8 @@ deps = [
|
||||
cflags = [
|
||||
@@ -28,8 +28,8 @@ cflags = [
|
||||
'-DLOCALSTATEDIR="@0@"'.format(act_localstatedir),
|
||||
'-DDATADIR="@0@"'.format(act_datadir),
|
||||
'-DSYSCONFDIR="@0@"'.format(act_sysconfdir),
|
||||
- '-DICONDIR="@0@"'.format(join_paths(act_localstatedir, 'lib', 'AccountsService', 'icons')),
|
||||
- '-DUSERDIR="@0@"'.format(join_paths(act_localstatedir, 'lib', 'AccountsService', 'users')),
|
||||
+ '-DICONDIR="@0@"'.format(join_paths(act_localstatedir, 'db', 'AccountsService', 'icons')),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Index: src/user.c
|
||||
--- src/user.c.orig
|
||||
+++ src/user.c
|
||||
@@ -138,9 +138,14 @@ user_reset_icon_file (User *user)
|
||||
@@ -396,9 +396,14 @@ user_update_from_template (User *user)
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -11,12 +11,12 @@ Index: src/user.c
|
|||
struct spwd *spent)
|
||||
+#else
|
||||
+user_update_from_pwent (User *user,
|
||||
+ struct passwd *pwent)
|
||||
+#endif
|
||||
+ struct passwd *pwent)
|
||||
+#endif
|
||||
{
|
||||
g_autofree gchar *real_name = NULL;
|
||||
gboolean is_system_account;
|
||||
@@ -199,10 +204,24 @@ user_update_from_pwent (User *user,
|
||||
@@ -460,10 +465,24 @@ user_update_from_pwent (User *user,
|
||||
accounts_user_set_shell (ACCOUNTS_USER (user), pwent->pw_shell);
|
||||
|
||||
passwd = NULL;
|
||||
|
@ -41,7 +41,7 @@ Index: src/user.c
|
|||
locked = TRUE;
|
||||
}
|
||||
else {
|
||||
@@ -218,6 +237,7 @@ user_update_from_pwent (User *user,
|
||||
@@ -479,6 +498,7 @@ user_update_from_pwent (User *user,
|
||||
mode = PASSWORD_MODE_NONE;
|
||||
}
|
||||
|
||||
|
@ -49,17 +49,17 @@ Index: src/user.c
|
|||
if (spent) {
|
||||
if (spent->sp_lstchg == 0) {
|
||||
mode = PASSWORD_MODE_SET_AT_LOGIN;
|
||||
@@ -231,6 +251,9 @@ user_update_from_pwent (User *user,
|
||||
@@ -499,6 +519,9 @@ user_update_from_pwent (User *user,
|
||||
user->days_after_expiration_until_lock = spent->sp_inact;
|
||||
user->account_expiration_policy_known = TRUE;
|
||||
}
|
||||
+#else
|
||||
+ user->expiration_time = pwent->pw_expire;
|
||||
+ user->user_expiration_time = g_date_time_new_from_unix_utc(pwent->pw_expire);
|
||||
+#endif
|
||||
|
||||
accounts_user_set_password_mode (ACCOUNTS_USER (user), mode);
|
||||
is_system_account = !user_classify_is_human (accounts_user_get_uid (ACCOUNTS_USER (user)),
|
||||
@@ -1602,7 +1625,11 @@ user_change_locked_authorized_cb (Daemon
|
||||
@@ -2074,7 +2097,11 @@ user_change_locked_authorized_cb (Daemon
|
||||
accounts_user_get_user_name (ACCOUNTS_USER (user)),
|
||||
accounts_user_get_uid (ACCOUNTS_USER (user)));
|
||||
argv[0] = "/usr/sbin/usermod";
|
||||
|
@ -71,7 +71,7 @@ Index: src/user.c
|
|||
argv[2] = "--";
|
||||
argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user));
|
||||
argv[4] = NULL;
|
||||
@@ -1671,14 +1698,24 @@ user_change_account_type_authorized_cb (Daemon
|
||||
@@ -2142,7 +2169,12 @@ user_change_account_type_authorized_cb (Daemon
|
||||
{
|
||||
AccountType account_type = GPOINTER_TO_INT (data);
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
@ -84,8 +84,9 @@ Index: src/user.c
|
|||
gint ngroups;
|
||||
g_autoptr(GString) str = NULL;
|
||||
g_auto(GStrv) extra_admin_groups = NULL;
|
||||
@@ -2150,7 +2182,12 @@ user_change_account_type_authorized_cb (Daemon
|
||||
gsize n_extra_admin_groups_gids = 0;
|
||||
gid_t admin_gid;
|
||||
struct group *grp;
|
||||
gint i;
|
||||
+#ifndef __OpenBSD__
|
||||
const gchar *argv[6];
|
||||
|
@ -96,9 +97,9 @@ Index: src/user.c
|
|||
|
||||
if (((AccountType) accounts_user_get_account_type (ACCOUNTS_USER (user))) != account_type) {
|
||||
sys_log (context,
|
||||
@@ -1694,17 +1731,33 @@ user_change_account_type_authorized_cb (Daemon
|
||||
@@ -2164,7 +2201,15 @@ user_change_account_type_authorized_cb (Daemon
|
||||
return;
|
||||
}
|
||||
admin_gid = grp->gr_gid;
|
||||
|
||||
+#ifdef __OpenBSD__
|
||||
+ ngroups = sizeof(groups) / sizeof(gid_t);
|
||||
|
@ -112,34 +113,26 @@ Index: src/user.c
|
|||
|
||||
str = g_string_new ("");
|
||||
for (i = 0; i < ngroups; i++) {
|
||||
if (groups[i] == admin_gid)
|
||||
continue;
|
||||
@@ -2177,14 +2222,28 @@ user_change_account_type_authorized_cb (Daemon
|
||||
group_is_admin = TRUE;
|
||||
|
||||
if (!group_is_admin)
|
||||
+#ifdef __OpenBSD__
|
||||
+ obsdgrp = getgrgid(groups[i]);
|
||||
+ g_string_append_printf (str, "%s,", obsdgrp->gr_name);
|
||||
+ {
|
||||
+ obsdgrp = getgrgid(groups[i]);
|
||||
+ g_string_append_printf (str, "%s,", obsdgrp->gr_name);
|
||||
+ }
|
||||
+#else
|
||||
g_string_append_printf (str, "%d,", groups[i]);
|
||||
g_string_append_printf (str, "%d,", groups[i]);
|
||||
+#endif
|
||||
}
|
||||
switch (account_type) {
|
||||
case ACCOUNT_TYPE_ADMINISTRATOR:
|
||||
extra_admin_groups = g_strsplit (EXTRA_ADMIN_GROUPS, ",", 0);
|
||||
+#ifdef __OpenBSD__
|
||||
+ class = "staff";
|
||||
+#endif
|
||||
|
||||
for (i = 0; extra_admin_groups[i] != NULL; i++) {
|
||||
struct group *extra_group;
|
||||
@@ -1712,10 +1765,18 @@ user_change_account_type_authorized_cb (Daemon
|
||||
if (extra_group == NULL || extra_group->gr_gid == admin_gid)
|
||||
continue;
|
||||
|
||||
+#ifdef __OpenBSD__
|
||||
+ g_string_append_printf (str, "%s,", extra_group->gr_name);
|
||||
+#else
|
||||
g_string_append_printf (str, "%d,", extra_group->gr_gid);
|
||||
+#endif
|
||||
}
|
||||
for (i = 0; i < n_extra_admin_groups_gids; i++)
|
||||
g_string_append_printf (str, "%d,", extra_admin_groups_gids[i]);
|
||||
|
||||
+#ifdef __OpenBSD__
|
||||
+ g_string_append_printf (str, "%s", ADMIN_GROUP);
|
||||
|
@ -149,7 +142,7 @@ Index: src/user.c
|
|||
break;
|
||||
case ACCOUNT_TYPE_STANDARD:
|
||||
default:
|
||||
@@ -1724,14 +1785,26 @@ user_change_account_type_authorized_cb (Daemon
|
||||
@@ -2193,14 +2252,26 @@ user_change_account_type_authorized_cb (Daemon
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,17 +1,7 @@
|
|||
Index: src/user.h
|
||||
--- src/user.h.orig
|
||||
+++ src/user.h
|
||||
@@ -22,7 +22,9 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
+#ifdef HAVE_SHADOW_H
|
||||
#include <shadow.h>
|
||||
+#endif
|
||||
|
||||
#include <glib.h>
|
||||
#include <gio/gio.h>
|
||||
@@ -54,9 +56,14 @@ GType user_get_type (void) G_G
|
||||
@@ -56,9 +56,14 @@ GType user_get_type (void) G_G
|
||||
User * user_new (Daemon *daemon,
|
||||
uid_t uid);
|
||||
|
||||
|
@ -23,6 +13,6 @@ Index: src/user.h
|
|||
+void user_update_from_pwent (User *user,
|
||||
+ struct passwd *pwent);
|
||||
+#endif
|
||||
void user_update_from_keyfile (User *user,
|
||||
GKeyFile *keyfile);
|
||||
void user_update_from_cache (User *user);
|
||||
void user_update_local_account_property (User *user,
|
||||
gboolean local);
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
Index: src/wtmp-helper.h
|
||||
--- src/wtmp-helper.h.orig
|
||||
+++ src/wtmp-helper.h
|
||||
@@ -23,7 +23,9 @@
|
||||
|
||||
#include <glib.h>
|
||||
#include <pwd.h>
|
||||
+#ifdef HAVE_SHADOW_H
|
||||
#include <shadow.h>
|
||||
+#endif
|
||||
|
||||
const gchar * wtmp_helper_get_path_for_monitor (void);
|
||||
void wtmp_helper_update_login_frequencies (GHashTable *users);
|
|
@ -10,14 +10,14 @@ lib/girepository-1.0/AccountsService-1.0.typelib
|
|||
@lib lib/libaccountsservice.so.${LIBaccountsservice_VERSION}
|
||||
lib/pkgconfig/accountsservice.pc
|
||||
@bin libexec/accounts-daemon
|
||||
share/accountsservice/
|
||||
share/accountsservice/user-templates/
|
||||
share/accountsservice/user-templates/administrator
|
||||
share/accountsservice/user-templates/standard
|
||||
share/dbus-1/interfaces/org.freedesktop.Accounts.User.xml
|
||||
share/dbus-1/interfaces/org.freedesktop.Accounts.xml
|
||||
share/dbus-1/system-services/org.freedesktop.Accounts.service
|
||||
share/examples/accountsservice/
|
||||
share/examples/accountsservice/dbus-1/
|
||||
share/examples/accountsservice/dbus-1/system.d/
|
||||
share/examples/accountsservice/dbus-1/system.d/org.freedesktop.Accounts.conf
|
||||
@sample ${SYSCONFDIR}/dbus-1/system.d/org.freedesktop.Accounts.conf
|
||||
share/dbus-1/system.d/org.freedesktop.Accounts.conf
|
||||
share/gir-1.0/AccountsService-1.0.gir
|
||||
share/locale/af/LC_MESSAGES/accounts-service.mo
|
||||
share/locale/ar/LC_MESSAGES/accounts-service.mo
|
||||
|
@ -100,7 +100,12 @@ share/locale/zh_CN/LC_MESSAGES/accounts-service.mo
|
|||
share/locale/zh_HK/LC_MESSAGES/accounts-service.mo
|
||||
share/locale/zh_TW/LC_MESSAGES/accounts-service.mo
|
||||
share/polkit-1/actions/org.freedesktop.accounts.policy
|
||||
share/vala/
|
||||
share/vala/vapi/
|
||||
share/vala/vapi/accountsservice.deps
|
||||
share/vala/vapi/accountsservice.vapi
|
||||
@sample /var/db/AccountsService/
|
||||
@sample /var/db/AccountsService/icons/
|
||||
@mode 0700
|
||||
@sample /var/db/AccountsService/users/
|
||||
@mode
|
||||
|
|
Loading…
Reference in New Issue