Compare commits
10 Commits
c2bc31d30b
...
1cb3ec8aee
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1cb3ec8aee | ||
|
|
0e7417fa5f | ||
|
|
f41bd7003d | ||
|
|
bebada6651 | ||
|
|
f1d38406b9 | ||
|
|
8c12ca1090 | ||
|
|
3ecf97bd91 | ||
|
|
46a5c55869 | ||
|
|
9a86dd19b9 | ||
|
|
070606616b |
@ -0,0 +1,26 @@
|
||||
From 2807b7704fe1abbd1eb68eb6c8f6c2f430bdf12b Mon Sep 17 00:00:00 2001
|
||||
From: ouyangminxiang <ouyangminxiang@kylinos.com.cn >
|
||||
Date: Wed, 30 Mar 2022 15:47:25 +0800
|
||||
Subject: [PATCH] exclude pcpqa user who cannot login because of SELinux
|
||||
|
||||
---
|
||||
src/user-classify.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/user-classify.c b/src/user-classify.c
|
||||
index 9db1c9a..cbfe177 100644
|
||||
--- a/src/user-classify.c
|
||||
+++ b/src/user-classify.c
|
||||
@@ -51,7 +51,8 @@ static const char *default_excludes[] = {
|
||||
"man",
|
||||
"at",
|
||||
"gdm",
|
||||
- "gnome-initial-setup"
|
||||
+ "gnome-initial-setup",
|
||||
+ "pcpqa"
|
||||
};
|
||||
|
||||
static gboolean
|
||||
--
|
||||
2.33.0
|
||||
|
||||
277
0001-formats-locale-property.patch
Normal file
277
0001-formats-locale-property.patch
Normal file
@ -0,0 +1,277 @@
|
||||
From f090729b7e6f977de4deb3201f177e60de81d006 Mon Sep 17 00:00:00 2001
|
||||
From: peijiankang <peijiankang@kylinos.cn>
|
||||
Date: Thu, 29 Jun 2023 16:23:24 +0800
|
||||
Subject: [PATCH] Addition of FormatsLocale property and SetFormatsLocale
|
||||
|
||||
---
|
||||
data/org.freedesktop.Accounts.User.xml | 45 ++++++++++++++++++++
|
||||
src/libaccountsservice/act-user.c | 55 ++++++++++++++++++++++++
|
||||
src/libaccountsservice/act-user.h | 3 ++
|
||||
src/user.c | 59 ++++++++++++++++++++++++++
|
||||
4 files changed, 162 insertions(+)
|
||||
|
||||
diff --git a/data/org.freedesktop.Accounts.User.xml b/data/org.freedesktop.Accounts.User.xml
|
||||
index 5302e20..3833506 100644
|
||||
--- a/data/org.freedesktop.Accounts.User.xml
|
||||
+++ b/data/org.freedesktop.Accounts.User.xml
|
||||
@@ -150,6 +150,41 @@
|
||||
</doc:doc>
|
||||
</method>
|
||||
|
||||
+ <method name="SetFormatsLocale">
|
||||
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
|
||||
+ <arg name="formats_locale" direction="in" type="s">
|
||||
+ <doc:doc>
|
||||
+ <doc:summary>
|
||||
+ The new regional formats, as a locale specification like "de_DE.UTF-8".
|
||||
+ </doc:summary>
|
||||
+ </doc:doc>
|
||||
+ </arg>
|
||||
+ <doc:doc>
|
||||
+ <doc:description>
|
||||
+ <doc:para>
|
||||
+ Sets the users regional formats.
|
||||
+ </doc:para>
|
||||
+ </doc:description>
|
||||
+ <doc:permission>
|
||||
+ The caller needs one of the following PolicyKit authorizations:
|
||||
+ <doc:list>
|
||||
+ <doc:item>
|
||||
+ <doc:term>org.freedesktop.accounts.change-own-user-data</doc:term>
|
||||
+ <doc:definition>To change his own language</doc:definition>
|
||||
+ </doc:item>
|
||||
+ <doc:item>
|
||||
+ <doc:term>org.freedesktop.accounts.user-administration</doc:term>
|
||||
+ <doc:definition>To change the language of another user</doc:definition>
|
||||
+ </doc:item>
|
||||
+ </doc:list>
|
||||
+ </doc:permission>
|
||||
+ <doc:errors>
|
||||
+ <doc:error name="org.freedesktop.Accounts.Error.PermissionDenied">if the caller lacks the appropriate PolicyKit authorization</doc:error>
|
||||
+ <doc:error name="org.freedesktop.Accounts.Error.Failed">if the operation failed</doc:error>
|
||||
+ </doc:errors>
|
||||
+ </doc:doc>
|
||||
+ </method>
|
||||
+
|
||||
<method name="SetXSession">
|
||||
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
|
||||
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="user_set_x_session"/>
|
||||
@@ -806,6 +841,16 @@
|
||||
</doc:doc>
|
||||
</property>
|
||||
|
||||
+ <property name="FormatsLocale" type="s" access="read">
|
||||
+ <doc:doc>
|
||||
+ <doc:description>
|
||||
+ <doc:para>
|
||||
+ The users regional formats, as a locale specification like "de_DE.UTF-8".
|
||||
+ </doc:para>
|
||||
+ </doc:description>
|
||||
+ </doc:doc>
|
||||
+ </property>
|
||||
+
|
||||
<property name="XSession" type="s" access="read">
|
||||
<doc:doc>
|
||||
<doc:description>
|
||||
diff --git a/src/libaccountsservice/act-user.c b/src/libaccountsservice/act-user.c
|
||||
index 25a28b6..5c39157 100644
|
||||
--- a/src/libaccountsservice/act-user.c
|
||||
+++ b/src/libaccountsservice/act-user.c
|
||||
@@ -96,6 +96,7 @@ enum {
|
||||
PROP_BACKGROUND_FILE,
|
||||
PROP_ICON_FILE,
|
||||
PROP_LANGUAGE,
|
||||
+ PROP_FORMATS_LOCALE,
|
||||
PROP_X_SESSION,
|
||||
PROP_IS_LOADED
|
||||
};
|
||||
@@ -395,6 +396,13 @@ act_user_class_init (ActUserClass *class)
|
||||
"User's locale.",
|
||||
NULL,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
+ g_object_class_install_property (gobject_class,
|
||||
+ PROP_FORMATS_LOCALE,
|
||||
+ g_param_spec_string ("formats_locale",
|
||||
+ "Regional Formats",
|
||||
+ "User's regional formats.",
|
||||
+ NULL,
|
||||
+ G_PARAM_READABLE));
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_X_SESSION,
|
||||
g_param_spec_string ("x-session",
|
||||
@@ -1054,6 +1062,25 @@ act_user_get_language (ActUser *user)
|
||||
return accounts_user_get_language (user->accounts_proxy);
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * act_user_get_formats_locale:
|
||||
+ * @user: a #ActUser
|
||||
+ *
|
||||
+ * Returns the path to the configured formats locale of @user.
|
||||
+ *
|
||||
+ * Returns: (transfer none): a path to an icon
|
||||
+ */
|
||||
+const char *
|
||||
+act_user_get_formats_locale (ActUser *user)
|
||||
+{
|
||||
+ g_return_val_if_fail (ACT_IS_USER (user), NULL);
|
||||
+
|
||||
+ if (user->accounts_proxy == NULL)
|
||||
+ return NULL;
|
||||
+
|
||||
+ return accounts_user_get_formats_locale (user->accounts_proxy);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* act_user_get_x_session:
|
||||
* @user: a #ActUser
|
||||
@@ -1338,6 +1365,34 @@ act_user_get_password_expiration_policy (ActUser *user,
|
||||
}
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * act_user_set_formats_locale:
|
||||
+ * @user: the user object to alter.
|
||||
+ * @formats_locale: a locale (e.g. en_US.utf8)
|
||||
+ *
|
||||
+ * Assigns a new formats locale for @user.
|
||||
+ *
|
||||
+ * Note this function is synchronous and ignores errors.
|
||||
+ **/
|
||||
+void
|
||||
+act_user_set_formats_locale (ActUser *user,
|
||||
+ const char *formats_locale)
|
||||
+{
|
||||
+ g_autoptr(GError) error = NULL;
|
||||
+
|
||||
+ g_return_if_fail (ACT_IS_USER (user));
|
||||
+ g_return_if_fail (formats_locale != NULL);
|
||||
+ g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy));
|
||||
+
|
||||
+ if (!accounts_user_call_set_formats_locale_sync (user->accounts_proxy,
|
||||
+ formats_locale,
|
||||
+ NULL,
|
||||
+ &error)) {
|
||||
+ g_warning ("SetFormatsLocale call failed: %s", error->message);
|
||||
+ return;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* act_user_set_email:
|
||||
* @user: the user object to alter.
|
||||
diff --git a/src/libaccountsservice/act-user.h b/src/libaccountsservice/act-user.h
|
||||
index af66542..40cf7aa 100644
|
||||
--- a/src/libaccountsservice/act-user.h
|
||||
+++ b/src/libaccountsservice/act-user.h
|
||||
@@ -79,6 +79,7 @@ gboolean act_user_is_nonexistent (ActUser *user);
|
||||
const char *act_user_get_background_file (ActUser *user);
|
||||
const char *act_user_get_icon_file (ActUser *user);
|
||||
const char *act_user_get_language (ActUser *user);
|
||||
+const char *act_user_get_formats_locale (ActUser *user);
|
||||
const char *act_user_get_x_session (ActUser *user);
|
||||
const char *act_user_get_session (ActUser *user);
|
||||
const char *act_user_get_session_type (ActUser *user);
|
||||
@@ -100,6 +101,8 @@ void act_user_set_email (ActUser *user,
|
||||
const char *email);
|
||||
void act_user_set_language (ActUser *user,
|
||||
const char *language);
|
||||
+void act_user_set_formats_locale (ActUser *user,
|
||||
+ const char *formats_locale);
|
||||
void act_user_set_background_file (ActUser *user,
|
||||
const char *background_file);
|
||||
void act_user_set_x_session (ActUser *user,
|
||||
diff --git a/src/user.c b/src/user.c
|
||||
index 60b97b0..1bd545f 100644
|
||||
--- a/src/user.c
|
||||
+++ b/src/user.c
|
||||
@@ -256,6 +256,12 @@ user_update_from_keyfile (User *user,
|
||||
g_clear_pointer (&s, g_free);
|
||||
}
|
||||
|
||||
+ s = g_key_file_get_string (keyfile, "User", "FormatsLocale", NULL);
|
||||
+ if (s != NULL) {
|
||||
+ accounts_user_set_formats_locale (ACCOUNTS_USER (user), s);
|
||||
+ g_clear_pointer (&s, g_free);
|
||||
+ }
|
||||
+
|
||||
s = g_key_file_get_string (keyfile, "User", "XSession", NULL);
|
||||
if (s != NULL) {
|
||||
accounts_user_set_xsession (ACCOUNTS_USER (user), s);
|
||||
@@ -354,6 +360,9 @@ user_save_to_keyfile (User *user,
|
||||
if (accounts_user_get_session_type (ACCOUNTS_USER (user)))
|
||||
g_key_file_set_string (keyfile, "User", "SessionType", accounts_user_get_session_type (ACCOUNTS_USER (user)));
|
||||
|
||||
+ if (accounts_user_get_formats_locale (ACCOUNTS_USER (user)))
|
||||
+ g_key_file_set_string (keyfile, "User", "FormatsLocale", accounts_user_get_formats_locale (ACCOUNTS_USER (user)));
|
||||
+
|
||||
if (accounts_user_get_xsession (ACCOUNTS_USER (user)))
|
||||
g_key_file_set_string (keyfile, "User", "XSession", accounts_user_get_xsession (ACCOUNTS_USER (user)));
|
||||
|
||||
@@ -1161,6 +1170,55 @@ user_set_session_type (AccountsUser *auser,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+static void
|
||||
+user_change_formats_locale_authorized_cb (Daemon *daemon,
|
||||
+ User *user,
|
||||
+ GDBusMethodInvocation *context,
|
||||
+ gpointer user_data)
|
||||
+
|
||||
+{
|
||||
+ const gchar *formats_locale = user_data;
|
||||
+
|
||||
+ if (g_strcmp0 (accounts_user_get_formats_locale (ACCOUNTS_USER (user)), formats_locale) != 0) {
|
||||
+ accounts_user_set_formats_locale (ACCOUNTS_USER (user), formats_locale);
|
||||
+
|
||||
+ save_extra_data (user);
|
||||
+ }
|
||||
+
|
||||
+ accounts_user_complete_set_formats_locale (ACCOUNTS_USER (user), context);
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
+user_set_formats_locale (AccountsUser *auser,
|
||||
+ GDBusMethodInvocation *context,
|
||||
+ const gchar *formats_locale)
|
||||
+{
|
||||
+ User *user = (User*)auser;
|
||||
+ int uid;
|
||||
+ const gchar *action_id;
|
||||
+
|
||||
+ if (!get_caller_uid (context, &uid)) {
|
||||
+ throw_error (context, ERROR_FAILED, "identifying caller failed");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid)
|
||||
+ action_id = "org.freedesktop.accounts.change-own-user-data";
|
||||
+ else
|
||||
+ action_id = "org.freedesktop.accounts.user-administration";
|
||||
+
|
||||
+ daemon_local_check_auth (user->daemon,
|
||||
+ user,
|
||||
+ action_id,
|
||||
+ TRUE,
|
||||
+ user_change_formats_locale_authorized_cb,
|
||||
+ context,
|
||||
+ g_strdup (formats_locale),
|
||||
+ (GDestroyNotify) g_free);
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
user_change_x_session_authorized_cb (Daemon *daemon,
|
||||
User *user,
|
||||
@@ -2191,6 +2249,7 @@ user_accounts_user_iface_init (AccountsUserIface *iface)
|
||||
iface->handle_set_automatic_login = user_set_automatic_login;
|
||||
iface->handle_set_background_file = user_set_background_file;
|
||||
iface->handle_set_email = user_set_email;
|
||||
+ iface->handle_set_formats_locale = user_set_formats_locale;
|
||||
iface->handle_set_home_directory = user_set_home_directory;
|
||||
iface->handle_set_icon_file = user_set_icon_file;
|
||||
iface->handle_set_language = user_set_language;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
Binary file not shown.
300
accountsservice-0.6.55-kylin-add-background-file-support.patch
Normal file
300
accountsservice-0.6.55-kylin-add-background-file-support.patch
Normal file
@ -0,0 +1,300 @@
|
||||
From 030c318f18ce50fa183d79ea493ae336ab40475d Mon Sep 17 00:00:00 2001
|
||||
From: huayadong <huayadong@kylinos.cn>
|
||||
Date: Wed, 21 Jun 2023 15:28:28 +0800
|
||||
Subject: [PATCH] add-background-file-support
|
||||
|
||||
---
|
||||
data/org.freedesktop.Accounts.User.xml | 45 ++++++++++++++
|
||||
src/libaccountsservice/act-user.c | 56 ++++++++++++++++++
|
||||
src/libaccountsservice/act-user.h | 3 +
|
||||
src/user.c | 81 ++++++++++++++++++++++++++
|
||||
4 files changed, 185 insertions(+)
|
||||
|
||||
diff --git a/data/org.freedesktop.Accounts.User.xml b/data/org.freedesktop.Accounts.User.xml
|
||||
index 8d3fe1c..5302e20 100644
|
||||
--- a/data/org.freedesktop.Accounts.User.xml
|
||||
+++ b/data/org.freedesktop.Accounts.User.xml
|
||||
@@ -379,6 +379,41 @@
|
||||
</doc:doc>
|
||||
</method>
|
||||
|
||||
+ <method name="SetBackgroundFile">
|
||||
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
|
||||
+ <arg name="filename" direction="in" type="s">
|
||||
+ <doc:doc>
|
||||
+ <doc:summary>
|
||||
+ The absolute filename of a png file to use as the users background.
|
||||
+ </doc:summary>
|
||||
+ </doc:doc>
|
||||
+ </arg>
|
||||
+ <doc:doc>
|
||||
+ <doc:description>
|
||||
+ <doc:para>
|
||||
+ Sets the users background.
|
||||
+ </doc:para>
|
||||
+ </doc:description>
|
||||
+ <doc:permission>
|
||||
+ The caller needs one of the following PolicyKit authorizations:
|
||||
+ <doc:list>
|
||||
+ <doc:item>
|
||||
+ <doc:term>org.freedesktop.accounts.change-own-user-data</doc:term>
|
||||
+ <doc:definition>To change his own background</doc:definition>
|
||||
+ </doc:item>
|
||||
+ <doc:item>
|
||||
+ <doc:term>org.freedesktop.accounts.user-administration</doc:term>
|
||||
+ <doc:definition>To change the background of another user</doc:definition>
|
||||
+ </doc:item>
|
||||
+ </doc:list>
|
||||
+ </doc:permission>
|
||||
+ <doc:errors>
|
||||
+ <doc:error name="org.freedesktop.Accounts.Error.PermissionDenied">if the caller lacks the appropriate PolicyKit authorization</doc:error>
|
||||
+ <doc:error name="org.freedesktop.Accounts.Error.Failed">if the operation failed</doc:error>
|
||||
+ </doc:errors>
|
||||
+ </doc:doc>
|
||||
+ </method>
|
||||
+
|
||||
<method name="SetIconFile">
|
||||
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
|
||||
<arg name="filename" direction="in" type="s">
|
||||
@@ -828,6 +863,16 @@
|
||||
</doc:doc>
|
||||
</property>
|
||||
|
||||
+ <property name="BackgroundFile" type="s" access="read">
|
||||
+ <doc:doc>
|
||||
+ <doc:description>
|
||||
+ <doc:para>
|
||||
+ The filename of a png file containing the users background.
|
||||
+ </doc:para>
|
||||
+ </doc:description>
|
||||
+ </doc:doc>
|
||||
+ </property>
|
||||
+
|
||||
<property name="IconFile" type="s" access="read">
|
||||
<doc:doc>
|
||||
<doc:description>
|
||||
diff --git a/src/libaccountsservice/act-user.c b/src/libaccountsservice/act-user.c
|
||||
index e66acb1..25a28b6 100644
|
||||
--- a/src/libaccountsservice/act-user.c
|
||||
+++ b/src/libaccountsservice/act-user.c
|
||||
@@ -93,6 +93,7 @@ enum {
|
||||
PROP_LOGIN_FREQUENCY,
|
||||
PROP_LOGIN_TIME,
|
||||
PROP_LOGIN_HISTORY,
|
||||
+ PROP_BACKGROUND_FILE,
|
||||
PROP_ICON_FILE,
|
||||
PROP_LANGUAGE,
|
||||
PROP_X_SESSION,
|
||||
@@ -372,6 +373,14 @@ act_user_class_init (ActUserClass *class)
|
||||
G_VARIANT_TYPE ("a(xxa{sv})"),
|
||||
NULL,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
+ g_object_class_install_property (gobject_class,
|
||||
+ PROP_BACKGROUND_FILE,
|
||||
+ g_param_spec_string ("background-file",
|
||||
+ "Background File",
|
||||
+ "The path to a background for this user.",
|
||||
+ NULL,
|
||||
+ G_PARAM_READABLE));
|
||||
+
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_ICON_FILE,
|
||||
g_param_spec_string ("icon-file",
|
||||
@@ -988,6 +997,25 @@ act_user_is_nonexistent (ActUser *user)
|
||||
return user->nonexistent;
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * act_user_get_background_file:
|
||||
+ * @user: a #ActUser
|
||||
+ *
|
||||
+ * Returns the path to the account background belonging to @user.
|
||||
+ *
|
||||
+ * Returns: (transfer none): a path to a background
|
||||
+ */
|
||||
+const char *
|
||||
+act_user_get_background_file (ActUser *user)
|
||||
+{
|
||||
+ g_return_val_if_fail (ACT_IS_USER (user), NULL);
|
||||
+
|
||||
+ if (user->accounts_proxy == NULL)
|
||||
+ return NULL;
|
||||
+
|
||||
+ return accounts_user_get_background_file (user->accounts_proxy);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* act_user_get_icon_file:
|
||||
* @user: a #ActUser
|
||||
@@ -1366,6 +1394,34 @@ act_user_set_language (ActUser *user,
|
||||
}
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * act_user_set_background_file:
|
||||
+ * @user: the user object to alter.
|
||||
+ * @background_file: path to an background
|
||||
+ *
|
||||
+ * Assigns a new background for @user.
|
||||
+ *
|
||||
+ * Note this function is synchronous and ignores errors.
|
||||
+ **/
|
||||
+void
|
||||
+act_user_set_background_file (ActUser *user,
|
||||
+ const char *background_file)
|
||||
+{
|
||||
+ g_autoptr(GError) error = NULL;
|
||||
+
|
||||
+ g_return_if_fail (ACT_IS_USER (user));
|
||||
+ g_return_if_fail (background_file != NULL);
|
||||
+ g_return_if_fail (ACCOUNTS_IS_USER (user->accounts_proxy));
|
||||
+
|
||||
+ if (!accounts_user_call_set_background_file_sync (user->accounts_proxy,
|
||||
+ background_file,
|
||||
+ NULL,
|
||||
+ &error)) {
|
||||
+ g_warning ("SetBackgroundFile call failed: %s", error->message);
|
||||
+ return;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* act_user_set_x_session:
|
||||
* @user: the user object to alter.
|
||||
diff --git a/src/libaccountsservice/act-user.h b/src/libaccountsservice/act-user.h
|
||||
index 34d7fe3..af66542 100644
|
||||
--- a/src/libaccountsservice/act-user.h
|
||||
+++ b/src/libaccountsservice/act-user.h
|
||||
@@ -76,6 +76,7 @@ gboolean act_user_get_automatic_login (ActUser *user);
|
||||
gboolean act_user_is_system_account (ActUser *user);
|
||||
gboolean act_user_is_local_account (ActUser *user);
|
||||
gboolean act_user_is_nonexistent (ActUser *user);
|
||||
+const char *act_user_get_background_file (ActUser *user);
|
||||
const char *act_user_get_icon_file (ActUser *user);
|
||||
const char *act_user_get_language (ActUser *user);
|
||||
const char *act_user_get_x_session (ActUser *user);
|
||||
@@ -99,6 +100,8 @@ void act_user_set_email (ActUser *user,
|
||||
const char *email);
|
||||
void act_user_set_language (ActUser *user,
|
||||
const char *language);
|
||||
+void act_user_set_background_file (ActUser *user,
|
||||
+ const char *background_file);
|
||||
void act_user_set_x_session (ActUser *user,
|
||||
const char *x_session);
|
||||
void act_user_set_session (ActUser *user,
|
||||
diff --git a/src/user.c b/src/user.c
|
||||
index 9f57af5..60b97b0 100644
|
||||
--- a/src/user.c
|
||||
+++ b/src/user.c
|
||||
@@ -295,6 +295,12 @@ user_update_from_keyfile (User *user,
|
||||
g_clear_pointer (&s, g_free);
|
||||
}
|
||||
|
||||
+ s = g_key_file_get_string (keyfile, "User", "Background", NULL);
|
||||
+ if (s != NULL) {
|
||||
+ accounts_user_set_background_file (ACCOUNTS_USER (user), s);
|
||||
+ g_clear_pointer (&s, g_free);
|
||||
+ }
|
||||
+
|
||||
s = g_key_file_get_string (keyfile, "User", "Icon", NULL);
|
||||
if (s != NULL) {
|
||||
accounts_user_set_icon_file (ACCOUNTS_USER (user), s);
|
||||
@@ -357,6 +363,9 @@ user_save_to_keyfile (User *user,
|
||||
if (accounts_user_get_password_hint (ACCOUNTS_USER (user)))
|
||||
g_key_file_set_string (keyfile, "User", "PasswordHint", accounts_user_get_password_hint (ACCOUNTS_USER (user)));
|
||||
|
||||
+ if (accounts_user_get_background_file (ACCOUNTS_USER (user)))
|
||||
+ g_key_file_set_string (keyfile, "User", "Background", accounts_user_get_background_file (ACCOUNTS_USER (user)));
|
||||
+
|
||||
if (accounts_user_get_icon_file (ACCOUNTS_USER (user)))
|
||||
g_key_file_set_string (keyfile, "User", "Icon", accounts_user_get_icon_file (ACCOUNTS_USER (user)));
|
||||
|
||||
@@ -1427,6 +1436,77 @@ become_user (gpointer data)
|
||||
}
|
||||
}
|
||||
|
||||
+static void
|
||||
+user_change_background_file_authorized_cb (Daemon *daemon,
|
||||
+ User *user,
|
||||
+ GDBusMethodInvocation *context,
|
||||
+ gpointer data)
|
||||
+{
|
||||
+ g_autofree gchar *filename = NULL;
|
||||
+ g_autoptr(GFile) file = NULL;
|
||||
+ g_autoptr(GFileInfo) info = NULL;
|
||||
+ GFileType type;
|
||||
+
|
||||
+ filename = g_strdup (data);
|
||||
+
|
||||
+ if (filename == NULL ||
|
||||
+ *filename == '\0') {
|
||||
+ g_free (filename);
|
||||
+ filename = NULL;
|
||||
+
|
||||
+ goto background_saved;
|
||||
+ }
|
||||
+
|
||||
+ file = g_file_new_for_path (filename);
|
||||
+ info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_TYPE,
|
||||
+ 0, NULL, NULL);
|
||||
+ type = g_file_info_get_file_type (info);
|
||||
+
|
||||
+ if (type != G_FILE_TYPE_REGULAR) {
|
||||
+ g_debug ("not a regular file\n");
|
||||
+ throw_error (context, ERROR_FAILED, "file '%s' is not a regular file", filename);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+background_saved:
|
||||
+ accounts_user_set_background_file (ACCOUNTS_USER (user), filename);
|
||||
+
|
||||
+ save_extra_data (user);
|
||||
+
|
||||
+ accounts_user_complete_set_background_file (ACCOUNTS_USER (user), context);
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
+user_set_background_file (AccountsUser *auser,
|
||||
+ GDBusMethodInvocation *context,
|
||||
+ const gchar *filename)
|
||||
+{
|
||||
+ User *user = (User*)auser;
|
||||
+ int uid;
|
||||
+ const gchar *action_id;
|
||||
+
|
||||
+ if (!get_caller_uid (context, &uid)) {
|
||||
+ throw_error (context, ERROR_FAILED, "identifying caller failed");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid)
|
||||
+ action_id = "org.freedesktop.accounts.change-own-user-data";
|
||||
+ else
|
||||
+ action_id = "org.freedesktop.accounts.user-administration";
|
||||
+
|
||||
+ daemon_local_check_auth (user->daemon,
|
||||
+ user,
|
||||
+ action_id,
|
||||
+ TRUE,
|
||||
+ user_change_background_file_authorized_cb,
|
||||
+ context,
|
||||
+ g_strdup (filename),
|
||||
+ (GDestroyNotify)g_free);
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
user_change_icon_file_authorized_cb (Daemon *daemon,
|
||||
User *user,
|
||||
@@ -2109,6 +2189,7 @@ user_accounts_user_iface_init (AccountsUserIface *iface)
|
||||
{
|
||||
iface->handle_set_account_type = user_set_account_type;
|
||||
iface->handle_set_automatic_login = user_set_automatic_login;
|
||||
+ iface->handle_set_background_file = user_set_background_file;
|
||||
iface->handle_set_email = user_set_email;
|
||||
iface->handle_set_home_directory = user_set_home_directory;
|
||||
iface->handle_set_icon_file = user_set_icon_file;
|
||||
--
|
||||
2.36.1
|
||||
|
||||
BIN
accountsservice-0.6.55.tar.xz
Normal file
BIN
accountsservice-0.6.55.tar.xz
Normal file
Binary file not shown.
@ -1,12 +1,16 @@
|
||||
Name: accountsservice
|
||||
Version: 0.6.54
|
||||
Release: 2
|
||||
Version: 0.6.55
|
||||
Release: 4
|
||||
Summary: D-Bus service for accessing the list of user accounts and information attached to those accounts.
|
||||
|
||||
License: GPLv3+
|
||||
URL: https://www.freedesktop.org/wiki/Software/AccountsService/
|
||||
Source0: https://www.freedesktop.org/software/%{name}/%{name}-%{version}.tar.xz
|
||||
|
||||
Patch1: 0001-exclude-pcpqa-user-who-cannot-login-because-of-SELin.patch
|
||||
Patch2: accountsservice-0.6.55-kylin-add-background-file-support.patch
|
||||
Patch3: 0001-formats-locale-property.patch
|
||||
|
||||
BuildRequires: gtk-doc polkit-devel libxslt pkgconfig(dbus-1) systemd systemd-devel
|
||||
BuildRequires: meson gobject-introspection-devel gettext-devel glib2-devel
|
||||
Requires: polkit shadow-utils
|
||||
@ -37,7 +41,7 @@ are contained in %{name}-devel package.
|
||||
%package_help
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version}
|
||||
%autosetup -n %{name}-%{version} -p 1
|
||||
|
||||
%build
|
||||
%meson -Dgtk_doc=true -Duser_heuristics=true
|
||||
@ -87,6 +91,20 @@ are contained in %{name}-devel package.
|
||||
%{_datadir}/gtk-doc/html/libaccountsservice/*
|
||||
|
||||
%changelog
|
||||
* Thu Jun 29 2023 peijiankang <peijiankang@kylinos.cn> - 0.6.55-4
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: add patch3: 0001-formats-locale-property.patch
|
||||
|
||||
* Wed Jun 21 2023 huayadong <huayadong@kylinos.cn> - 0.6.55-3
|
||||
- add patch2:accountsservice-0.6.55-kylin-add-background-file-support.patch
|
||||
|
||||
* Wed Mar 30 2022 ouyangminxiang <ouyangminxiang@kylinsec.com.cn> - 0.6.55-2
|
||||
- exclude pcpqa user who cannot login because of SELinux
|
||||
|
||||
* Thu Jan 28 2021 yanglu <yanglu60@huawei.com> - 0.6.55-1
|
||||
- Version update
|
||||
|
||||
* Fri Sep 06 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.6.54-2
|
||||
- Package Init
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
version_control: git
|
||||
src_repo: https://gitlab.freedesktop.org/accountsservice/accountsservice.git
|
||||
tag_prefix:
|
||||
seperator: .
|
||||
tag_prefix: "^"
|
||||
seperator: "."
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user