summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-01-27Don't try to add admin users to non existing groupsHEADmasterSebastien1-5/+19
2021-10-31Fix build with meson 0.60Luca Boccassi1-1/+0
Positional parameters to merge_file() were never allowed and always ignored, so just drop it. See: https://github.com/mesonbuild/meson/issues/9441 Fixes #97
2021-10-12Update Brazilian Portuguese translation Rafael Fontenelle1-24/+38
Contribution by Henrique Machado Campos
2021-10-11Use timestamps instead of (expiration time and last change time)dayszhuyaliang1-6/+17
2021-10-08main: Allow cache files to be marked immutableRay Strode1-4/+25
At the moment, at start up we unconditionally reset permission of all cache files in /var/lib/AccountsService/users. If the mode of the files can't be reset, accountsservice fails to start. But there's a situation where we should proceed anyway: If the mode is already correct, and the file is read-only, there is no reason to refuse to proceed. This commit changes the code to explicitly validate the permissions of the file before failing.
2021-10-08daemon: Allow SystemAccount=false to be set in cache fileRay Strode1-12/+12
At the moment we do dodgy checks based on uid to decide whether or not an account is a system account. For legacy reasons, sometimes normal users have really low UIDs. This commit reshuffles things, so the cache file "wins" for deciding whether or not a user is a system user.
2021-10-08po: update slovak translationDušan Kazik1-27/+48
2021-10-08user: Introduce user templates for setting default session etcRay Strode7-13/+305
At the moment there's no easy way to set a default session, or face icon or whatever for all users. If a user has never logged in before, we just generate their cache file from hardcoded defaults. This commit introduces a template system to make it possible for admins to set up defaults on their own. Admins can write either /etc/accountsservice/user-templates/administrator or /etc/accountsservice/user-templates/standard files. These files follow the same format as /var/lib/AccountsService/users/username files, but will support substituting $HOME and $USER to the appropriate user specific values. User templates also support an additional group [Template] that have an additional key EnvironmentFiles that specify a list of environment files to load (files with KEY=VALUE pairs in them). Any keys listed in those environment files will also get substituted. https://gitlab.freedesktop.org/accountsservice/accountsservice/-/issues/63
2021-09-30Conditionalize more use of shadow.hMaya Rashish2-0/+4
2021-07-26Update Ukrainian translationYuri Chornoivan1-24/+40
2021-07-14po: update zh_CN.podengbo1-15/+18
2021-06-27act-user: Use stronger hashing methods in make_crypted() if available.Björn Esser2-8/+39
2021-06-26Update oc.poMejans1-20/+36
2021-06-22Replace empty he.po with an actual translationYaron Shahrabani1-27/+41
2021-06-17daemon: Remove duplicate "changed" signal emissionzhuyaliang1-3/+0
The daemon code manually calls `g_signal_emit_by_name (user, "changed", 0)` every time it changes that users `automatic-login` property. This emission is redundant because the user code sets up a `notify` handler to emit `changed` it self any time any of its properties are changed.
2021-05-13util: Get uid when neededorcno1-5/+5
The variable uid is used only when the loginuid cannot be obtained or is empty. Change it to get the variable uid when needed
2021-03-24tests: Sync tests with upstream python-dbusmockMarco Trevisan (Treviño)2-46/+98
2021-03-16ci: Add test stage, reusing the build oneMarco Trevisan (Treviño)1-1/+23
2021-03-16ci: Cleanup the build stage so that we can define dependencies just onceMarco Trevisan (Treviño)1-1/+17
2021-03-16tests: Add unit tests for libaccountservice using dbusmock and gir bindingsMarco Trevisan (Treviño)5-0/+915
2021-03-16user: Translate property x-session property name to match the proxy oneMarco Trevisan (Treviño)1-1/+4
The proxy "xsession" property is exposed as "x-session" to the API, so don't break the API, but translate the name internally.
2021-03-16user-manager: Update users tables on username changesMarco Trevisan (Treviño)1-1/+52
Accounts service provides the user's set_user_name() function that allows to change an user username, but if this happens the user won't ever be moved by index in the containing hash table, causing the user to be never deleted when calling delete_user() and it will be always exposed when listing or fetching it. In fact we refer to the users only by their usernames but this may change and in such situation they'd be left stale in the containing table. So, add ability to get an user by the UID, and use this function to check if the user has been renamed during the "changed" callback and if so, update its hashtable key.
2021-03-16act-user-manager: Fix various refcounting bugsPhilip Withnall1-28/+27
The refcounting of `ActUser` instances was a bit jumbled and unclear, and seemed to contain several bugs. In particular, `act_user_manager_get_user_by_id()` was behaving as `(transfer full)` when it was documented as `(transfer none)`. Try and tidy the refcounting up, to a certain extent. There may still be issues left. Signed-off-by: Philip Withnall <withnall@endlessm.com>
2021-03-16act-user-manager: Fix incorrect return types in some finish() functionsPhilip Withnall1-2/+2
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-09-04Update German translationChristian K1-19/+37
2020-08-14build: Add missing pkg-config Requires.private dependenciesSimon McVittie1-0/+6
Otherwise, a trivial executable that includes <act/act.h>, built with $(pkg-config --cflags --libs accountsservice), will fail to compile when we cannot include headers like <glib-object.h>. Signed-off-by: Simon McVittie <smcv@debian.org>
2020-05-04act-user-manager: Watch for the daemon going away and coming backIain Lane1-0/+21
And set is-loaded accordingly. This causes properties to be invalidated on the client side and then get re-fetched when the daemon comes back. https://gitlab.freedesktop.org/accountsservice/accountsservice/issues/55
2020-05-01util: Split out helper method for getting admin group IDsPhilip Withnall3-17/+76
This introduces one small functional change: if any of the groups in `EXTRA_ADMIN_GROUPS` can’t be resolved using `getgrnam()`, an error will now be thrown. Previously, it would be ignored. Other than that, this introduces no functional changes and is just intended as a code cleanup. Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-05-01user: Remove user from extra_admin_groups when demoting them from adminPhilip Withnall1-12/+26
Filter out the `extra_admin_groups` from the group list when a user is no longer an admin. Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-04-27main: Don’t print translation header with `--help`Philip Withnall1-1/+1
The correct way to tell `g_option_context_new()` not to print any information after the options is to pass `NULL`. Passing the empty string results in a call to `gettext ("")`, which returns the translation’s header. This fixes the output of `accounts-daemon --help`. Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-04-27Updated Indonesian translationAndika Triwidada1-27/+42
2020-03-12user-classify: Add git to username blacklistMichael Catanzaro1-1/+2
Bad news for Geoffrey Ingram Taylor. See: #57
2020-03-12Remove user heuristicsMichael Catanzaro3-43/+0
We don't want this code running except on Red Hat systems, where we can maintain it in a downstream patch if need be. The heuristic has been wrong before (e.g. as in #57) and is not useful on upstream systems where 1000 is the presumed minimum uid for human users.
2020-03-04Never delete the root filesystem when removing usersMichael Catanzaro1-0/+13
Many, many user accounts use / as their home directory. If deleting these accounts with accountsservice, we should just ignore requests to delete the home dir, rather than trash the user's computer. Fixes #57
2020-02-28user: reject requests to change full name to something including a commaMichael Catanzaro1-0/+5
Because real name is stored in the GECOS field of /etc/passwd, which is delimited by commas that cannot be escaped, the user's full name must not contain a comma. Fixes #83
2020-02-28user: Don't overwrite entire GECOS field when setting full nameMichael Catanzaro1-1/+19
See: #83
2020-02-27user: fix double-unref of GDBusMethodInvocation throughoutMichael Catanzaro1-14/+14
When we return FALSE, we're not saying "failure," we're actually saying "unhandled." So in accounts-user-generated.c (generated by gdbus-codegen), _accounts_user_skeleton_handle_method_call() will call g_dbus_method_invocation_return_error(), which assumes ownership, sends a D-Bus error to the peer, and unrefs the GDBusMethodInvocation. Problem is, we've already done all of that and doing so twice is unexpected and bad. Spotted by Ray Strode in !51. Fixes #86
2020-02-27user: fix indentation errorMichael Catanzaro1-1/+1
2020-02-24act-user: Use G_DECLARE_FINAL_TYPE to declare ActUserPhilip Withnall2-21/+2
This tidies up the code a bit, and (critically) exposes a concrete structure for `ActUser` and `ActUserClass`. Previously these were dangling typedefs, which meant the compiler had no idea they derived from `GObject`, and hence would give warnings about strict aliasing when (for example) calling: ``` g_set_object (&my_user, user); ``` where `my_user` and `user` were both `ActUser*`. This shouldn’t introduce any API or ABI changes, as the library basically exposed no API in this area before. The autoptr cleanup function is now defined by `G_DECLARE_FINAL_TYPE`. libaccountsservice already depends on GLib 2.63, so no dependency bump is needed. Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-24Update Swedish translationAnders Jonsson1-19/+30
2020-02-24act-user-manager: Remove ConsoleKit supportRobert Ancell7-1673/+19
ConsoleKit is very much dead and replaced by logind or elogind.
2020-02-24Update tr.polibre ajans1-26/+43
2020-02-24po: delete obsolete po/accounts-service.potGunnar Hjalmarsson1-60/+0
We don't use transifex anymore, so the file can be generated when needed instead of stored in version control. Closes: https://gitlab.freedesktop.org/accountsservice/accountsservice/issues/30
2020-02-18libaccountsservice: Expand documentation of ActUser:languagePhilip Withnall1-4/+23
In particular, make it clear what format a locale is in, and what the empty string and NULL values mean. I’ve guessed what they mean based on what code which uses libaccountsservice does. Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-11daemon: Fix error check in save_autologin()Michael Catanzaro1-1/+1
This regressed in 4b3fdd19.
2020-02-07Check GDBusMessage for INTERACTIVE_AUTHORIZATION flagMatthew Leeds9-34/+112
Currently we always use the flag POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION when checking if a subject is authorized for an action, meaning that we cause polkit to create an interactive dialog box. However since GLib 2.46, there has been a flag G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION which indicates if the caller is prepared to have the user authenticate (e.g. it's a user-facing program not a daemon). So, check for this flag in daemon_local_check_auth(). The impetus for this patch is that in the Endles fork of gnome-control-center we use the library malcontent, and call mct_manager_get_app_filter() even when we don't have permission to actually read the user's app filter, since it shouldn't cause a dialog without MCT_GET_APP_FILTER_FLAGS_INTERACTIVE being passed to it. However because accountsservice doesn't respect G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION, polkit attempts to create an auth dialog anyway (and hits an error but that's a separate gnome-shell bug). In libaccountsservice, we use code generated by gdbus-codegen to call D-Bus methods implemented by the daemon, and that generated code unconditionally uses G_DBUS_CALL_FLAGS_NONE, which would mean that users of libaccountsservice can't use interactive auth. The solution is to bump our GLib requirement to 2.63.5 (2.64 hasn't been released yet) and pass --glib-min-required 2.64 to gdbus-codegen, which causes the generated code to have two more arguments for each method call: one for GDBusCallFlags and one for a timeout value. For now we always use G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION in libaccountsservice, to maintain compatibility. It might make sense to add API in the future so that users of the library can specify if they want to allow interactive auth. This commit also makes us use G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION for method calls implemented by ConsoleKit, even though presumably no problems are caused by the current behavior of using G_DBUS_CALL_FLAGS_NONE. In theory ConsoleKit could check for G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION one day (although in practice I think it's deprecated and inactive), and I think the whole of libaccountsservice should assume interactive auth is allowed until we have API to distinguish the no-interactive-auth case.
2019-09-16Add support to build vala bindingsRico Tzschichholz3-2/+12
2019-09-13Fix g-i annotation of act_user_get_password_expiration_policyRico Tzschichholz1-6/+6
2019-09-06build: Bump minimum version of meson requiredRobert Ancell1-1/+1
Meson gives the warning: WARNING: Project specifies a minimum meson_version '>= 0.46.0' but uses features which were added in newer versions: * 0.50.0: {'install arg in configure_file'}
2019-09-04daemon: Write GDM custom.conf file if it doesn't existRobert Ancell1-1/+6
The previous code would abort the write if it didn't exist.