Commit e8bc233f authored by Olivier Duchateau's avatar Olivier Duchateau
Browse files

Update to 0.6.44

parent 0eea6d20
......@@ -2,7 +2,7 @@
# $FreeBSD: head/sysutils/accountsservice/Makefile 517057 2019-11-08 13:11:05Z tobik $
PORTNAME= accountsservice
PORTVERSION= 0.6.43
PORTVERSION= 0.6.44
CATEGORIES= sysutils devel
MASTER_SITES= http://www.freedesktop.org/software/${PORTNAME}/
......
TIMESTAMP = 1600418890
SHA256 (accountsservice-0.6.43.tar.xz) = ed3ba94aa38ceb822a0e1a1ac71bf1a8123babf90be049397b3a00900e48d6cc
SIZE (accountsservice-0.6.43.tar.xz) = 381008
TIMESTAMP = 1600421705
SHA256 (accountsservice-0.6.44.tar.xz) = 072b620e3e10ea7af68bf06b980e466d35915060616e356742f0c584b5b88eac
SIZE (accountsservice-0.6.44.tar.xz) = 382496
--- src/daemon.c.orig 2016-09-06 19:48:50 UTC
--- src/daemon.c.orig 2017-03-27 18:05:12 UTC
+++ src/daemon.c
@@ -78,7 +78,11 @@ struct DaemonPrivate {
@@ -79,7 +79,11 @@ struct DaemonPrivate {
GHashTable *extension_ifaces;
};
+#ifdef HAVE_SHADOW_H
typedef struct passwd * (* EntryGeneratorFunc) (GHashTable *, gpointer *, struct spwd **shadow_entry);
typedef struct passwd * (* EntryGeneratorFunc) (Daemon *, GHashTable *, gpointer *, struct spwd **shadow_entry);
+#else
+typedef struct passwd * (* EntryGeneratorFunc) (GHashTable *, gpointer *);
+typedef struct passwd * (* EntryGeneratorFunc) (Daemon *, GHashTable *, gpointer *);
+#endif
static void daemon_accounts_accounts_iface_init (AccountsAccountsIface *iface);
@@ -140,16 +144,23 @@ error_get_type (void)
@@ -141,17 +145,25 @@ error_get_type (void)
#endif
static struct passwd *
+#ifdef HAVE_SHADOW_H
entry_generator_fgetpwent (GHashTable *users,
entry_generator_fgetpwent (Daemon *daemon,
GHashTable *users,
gpointer *state,
struct spwd **spent)
+#else
+entry_generator_fgetpwent (GHashTable *users,
+entry_generator_fgetpwent (Daemon *daemon,
+ GHashTable *users,
+ gpointer *state)
+#endif
{
......@@ -36,7 +38,7 @@
struct {
FILE *fp;
@@ -160,6 +171,7 @@ entry_generator_fgetpwent (GHashTable *users,
@@ -162,6 +174,7 @@ entry_generator_fgetpwent (Daemon *daemon,
if (*state == NULL) {
GHashTable *shadow_users = NULL;
FILE *fp;
......@@ -44,7 +46,7 @@
struct spwd *shadow_entry;
fp = fopen (PATH_SHADOW, "r");
@@ -193,6 +205,7 @@ entry_generator_fgetpwent (GHashTable *users,
@@ -195,6 +208,7 @@ entry_generator_fgetpwent (Daemon *daemon,
g_clear_pointer (&shadow_users, g_hash_table_unref);
return NULL;
}
......@@ -52,7 +54,7 @@
fp = fopen (PATH_PASSWD, "r");
if (fp == NULL) {
@@ -214,12 +227,17 @@ entry_generator_fgetpwent (GHashTable *users,
@@ -216,12 +230,17 @@ entry_generator_fgetpwent (Daemon *daemon,
if (g_hash_table_size (users) < MAX_LOCAL_USERS) {
pwent = fgetpwent (generator_state->fp);
if (pwent != NULL) {
......@@ -70,22 +72,24 @@
}
}
@@ -233,9 +251,14 @@ entry_generator_fgetpwent (GHashTable *users,
@@ -235,10 +254,16 @@ entry_generator_fgetpwent (Daemon *daemon,
}
static struct passwd *
+#ifdef HAVE_SHADOW_H
entry_generator_cachedir (GHashTable *users,
entry_generator_cachedir (Daemon *daemon,
GHashTable *users,
gpointer *state,
struct spwd **shadow_entry)
+#else
+entry_generator_cachedir (GHashTable *users,
+entry_generator_cachedir (Daemon *daemon,
+ GHashTable *users,
+ gpointer *state)
+#endif
{
struct passwd *pwent;
const gchar *name;
@@ -280,7 +303,9 @@ entry_generator_cachedir (GHashTable *users,
@@ -283,7 +308,9 @@ entry_generator_cachedir (Daemon *daemon,
if (pwent == NULL) {
g_debug ("user '%s' in cache dir but not present on system", name);
} else {
......@@ -95,7 +99,34 @@
return pwent;
}
@@ -312,19 +337,29 @@ load_entries (Daemon *daemon,
@@ -309,10 +336,16 @@ entry_generator_cachedir (Daemon *daemon,
}
static struct passwd *
+#ifdef HAVE_SHADOW_H
entry_generator_requested_users (Daemon *daemon,
GHashTable *users,
gpointer *state,
struct spwd **shadow_entry)
+#else
+entry_generator_requested_users (Daemon *daemon,
+ GHashTable *users,
+ gpointer *state)
+#endif
{
struct passwd *pwent;
GList *node;
@@ -339,7 +372,9 @@ entry_generator_requested_users (Daemon *daemon,
if (pwent == NULL) {
g_debug ("user '%s' requested previously but not present on system", name);
} else {
+#ifdef HAVE_SHADOW_H
*shadow_entry = getspnam (pwent->pw_name);
+#endif
return pwent;
}
@@ -361,19 +396,29 @@ load_entries (Daemon *daemon,
{
gpointer generator_state = NULL;
struct passwd *pwent;
......@@ -109,23 +140,23 @@
for (;;) {
+#ifdef HAVE_SHADOW_H
spent = NULL;
pwent = entry_generator (users, &generator_state, &spent);
pwent = entry_generator (daemon, users, &generator_state, &spent);
+#else
+ pwent = entry_generator (users, &generator_state);
+ pwent = entry_generator (daemon, users, &generator_state);
+#endif
if (pwent == NULL)
break;
/* 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)) {
if (!allow_system_users && !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)) {
+ if (!allow_system_users && !user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, NULL)) {
+#endif
g_debug ("skipping user: %s", pwent->pw_name);
continue;
}
@@ -343,7 +378,11 @@ load_entries (Daemon *daemon,
@@ -392,7 +437,11 @@ load_entries (Daemon *daemon,
/* freeze & update users not already in the new list */
g_object_freeze_notify (G_OBJECT (user));
......@@ -137,7 +168,7 @@
g_hash_table_insert (users, g_strdup (user_get_user_name (user)), user);
g_debug ("loaded user: %s", user_get_user_name (user));
@@ -715,14 +754,23 @@ throw_error (GDBusMethodInvocation *context,
@@ -769,14 +818,23 @@ throw_error (GDBusMethodInvocation *context,
}
static User *
......@@ -161,7 +192,7 @@
user_register (user);
g_hash_table_insert (daemon->priv->users,
@@ -750,9 +798,13 @@ daemon_local_find_user_by_id (Daemon *daemon,
@@ -804,9 +862,13 @@ daemon_local_find_user_by_id (Daemon *daemon,
user = g_hash_table_lookup (daemon->priv->users, pwent->pw_name);
if (user == NULL) {
......@@ -172,10 +203,10 @@
+#else
+ user = add_new_user_for_pwent (daemon, pwent);
+#endif
}
return user;
@@ -774,9 +826,13 @@ daemon_local_find_user_by_name (Daemon *daemon,
daemon->priv->explicitly_requested_users = g_list_append (daemon->priv->explicitly_requested_users,
g_strdup (pwent->pw_name));
@@ -831,9 +893,13 @@ daemon_local_find_user_by_name (Daemon *daemon,
user = g_hash_table_lookup (daemon->priv->users, pwent->pw_name);
if (user == NULL) {
......@@ -186,10 +217,10 @@
+#else
+ user = add_new_user_for_pwent (daemon, pwent);
+#endif
}
return user;
@@ -972,20 +1028,18 @@ daemon_create_user_authorized_cb (Daemon
daemon->priv->explicitly_requested_users = g_list_append (daemon->priv->explicitly_requested_users,
g_strdup (pwent->pw_name));
@@ -1032,20 +1098,18 @@ daemon_create_user_authorized_cb (Daemon
sys_log (context, "create user '%s'", cd->user_name);
......@@ -218,3 +249,31 @@
argv[6] = NULL;
}
else {
@@ -1251,19 +1315,17 @@ daemon_delete_user_authorized_cb (Daemon
g_remove (filename);
g_free (filename);
- argv[0] = "/usr/sbin/userdel";
+ argv[0] = "/usr/sbin/pw";
if (ud->remove_files) {
- argv[1] = "-f";
- argv[2] = "-r";
- argv[3] = "--";
- argv[4] = pwent->pw_name;
- argv[5] = NULL;
+ argv[1] = "userdel";
+ argv[2] = pwent->pw_name;
+ argv[3] = "-r";
+ argv[4] = NULL;
}
else {
- argv[1] = "-f";
- argv[2] = "--";
- argv[3] = pwent->pw_name;
- argv[4] = NULL;
+ argv[1] = "userdel";
+ argv[2] = pwent->pw_name;
+ argv[3] = NULL;
}
error = NULL;
--- src/user.c.orig 2016-09-06 19:48:50 UTC
--- src/user.c.orig 2017-03-27 17:53:21 UTC
+++ src/user.c
@@ -145,9 +145,14 @@ account_type_from_pwent (struct passwd *pwent)
@@ -151,9 +151,14 @@ account_type_from_pwent (struct passwd *pwent)
}
void
......@@ -15,7 +15,7 @@
{
gchar *real_name;
gboolean changed;
@@ -247,8 +252,10 @@ user_update_from_pwent (User *user,
@@ -253,8 +258,10 @@ user_update_from_pwent (User *user,
}
passwd = NULL;
......@@ -26,7 +26,7 @@
if (passwd && passwd[0] == '!') {
locked = TRUE;
@@ -270,11 +277,13 @@ user_update_from_pwent (User *user,
@@ -276,6 +283,7 @@ user_update_from_pwent (User *user,
mode = PASSWORD_MODE_NONE;
}
......@@ -34,13 +34,17 @@
if (spent) {
if (spent->sp_lstchg == 0) {
mode = PASSWORD_MODE_SET_AT_LOGIN;
}
@@ -288,6 +296,9 @@ user_update_from_pwent (User *user,
user->days_to_warn = spent->sp_warn;
user->days_after_expiration_until_lock = spent->sp_inact;
}
+#else
+ user->expiration_time = pwent->pw_expire;
+#endif
if (user->password_mode != mode) {
user->password_mode = mode;
@@ -858,11 +867,11 @@ user_change_real_name_authorized_cb (Daemon
@@ -871,11 +882,11 @@ user_change_real_name_authorized_cb (Daemon
"change real name of user '%s' (%d) to '%s'",
user->user_name, user->uid, name);
......@@ -57,7 +61,7 @@
argv[5] = NULL;
error = NULL;
@@ -932,11 +941,11 @@ user_change_user_name_authorized_cb (Daemon
@@ -945,11 +956,11 @@ user_change_user_name_authorized_cb (Daemon
"change name of user '%s' (%d) to '%s'",
old_name, user->uid, name);
......@@ -67,14 +71,14 @@
- argv[3] = "--";
- argv[4] = user->user_name;
+ argv[0] = "/usr/sbin/pw";
+ argv[1] = "usermode";
+ argv[1] = "usermod";
+ argv[2] = user->user_name;
+ argv[3] = "-n";
+ argv[4] = name;
argv[5] = NULL;
error = NULL;
@@ -1207,20 +1216,19 @@ user_change_home_dir_authorized_cb (Daemon
@@ -1268,20 +1279,19 @@ user_change_home_dir_authorized_cb (Daemon
{
gchar *home_dir = data;
GError *error;
......@@ -102,7 +106,7 @@
error = NULL;
if (!spawn_with_login_uid (context, argv, &error)) {
@@ -1276,11 +1284,11 @@ user_change_shell_authorized_cb (Daemon
@@ -1337,11 +1347,11 @@ user_change_shell_authorized_cb (Daemon
"change shell of user '%s' (%d) to '%s'",
user->user_name, user->uid, shell);
......@@ -119,7 +123,7 @@
argv[5] = NULL;
error = NULL;
@@ -1530,17 +1538,16 @@ user_change_locked_authorized_cb (Daemon
@@ -1591,17 +1601,16 @@ user_change_locked_authorized_cb (Daemon
{
gboolean locked = GPOINTER_TO_INT (data);
GError *error;
......@@ -142,7 +146,7 @@
error = NULL;
if (!spawn_with_login_uid (context, argv, &error)) {
@@ -1649,11 +1656,11 @@ user_change_account_type_authorized_cb (Daemon
@@ -1710,11 +1719,11 @@ user_change_account_type_authorized_cb (Daemon
g_free (groups);
......@@ -159,7 +163,7 @@
argv[5] = NULL;
g_string_free (str, FALSE);
@@ -1720,10 +1727,8 @@ user_change_password_mode_authorized_cb (Daemon
@@ -1781,10 +1790,8 @@ user_change_password_mode_authorized_cb (Daemon
mode == PASSWORD_MODE_NONE) {
argv[0] = "/usr/bin/passwd";
......@@ -172,7 +176,7 @@
error = NULL;
if (!spawn_with_login_uid (context, argv, &error)) {
@@ -1733,12 +1738,11 @@ user_change_password_mode_authorized_cb (Daemon
@@ -1794,12 +1801,11 @@ user_change_password_mode_authorized_cb (Daemon
}
if (mode == PASSWORD_MODE_SET_AT_LOGIN) {
......@@ -189,7 +193,7 @@
error = NULL;
if (!spawn_with_login_uid (context, argv, &error)) {
@@ -1762,11 +1766,10 @@ user_change_password_mode_authorized_cb (Daemon
@@ -1823,11 +1829,10 @@ user_change_password_mode_authorized_cb (Daemon
}
}
else if (user->locked) {
......@@ -205,7 +209,7 @@
error = NULL;
if (!spawn_with_login_uid (context, argv, &error)) {
@@ -1829,7 +1832,7 @@ user_change_password_authorized_cb (Daemon
@@ -1890,7 +1895,7 @@ user_change_password_authorized_cb (Daemon
{
gchar **strings = data;
GError *error;
......@@ -214,12 +218,12 @@
sys_log (context,
"set password and hint of user '%s' (%d)",
@@ -1837,12 +1840,11 @@ user_change_password_authorized_cb (Daemon
@@ -1898,12 +1903,11 @@ user_change_password_authorized_cb (Daemon
g_object_freeze_notify (G_OBJECT (user));
- argv[0] = "/usr/sbin/usermod";
+ argv[0] = "/usr/bin/chpass";
+ argv[0] = "/usr/sbin/chpass";
argv[1] = "-p";
argv[2] = strings[0];
- argv[3] = "--";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment