summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* generate-version.sh: fix script inside of a tarballHEADmainorbea2023-05-051-2/+1
|
* Rename directory 'dbusmock' to 'mock_services'Nelson Benítez León2023-04-252-2/+2
| | | | | | | | | so to avoid Python confusing it with the 'dbusmock' python module. Issue reported by Pierre Labastie. Closes #112
* daemon: Assume GDM for autologin if we can't figure it out from systemdRay Strode2023-04-191-4/+4
| | | | | | | | | | | | | | | | | | Right now we figure out which display manager to configure based on reading a symlink from systemd. This isn't full proof though. SELinux security policies may prevent it from being readable, the system might not be using systemd, etc. Furthermore, in the case where it fails, we currently don't set a a GError, which leads to a crash when trying to fetch the error message. This commit makes accountsservice fall back to GDM when it can't figure out what else to do. That way we maintain better backward compatibility. https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2450
* user-manager: Remove user from new users list if destroyedMarco Trevisan (Treviño)2023-04-181-0/+2
| | | | | | | | If an user gets destroyed early enough, while is still being loaded we should also remove it from the list of new users or we'd try to deference it at finalization time. Closes: #114
* act-user-manager: Disconnect from manager signals when freeing a requestMarco Trevisan (Treviño)2023-04-131-3/+7
| | | | | | | | Requests may be pending when we destroy them, in such case we should disconnect them from the manager "is-loaded" changes, so that we don't risk deferencing free'd requests when the manager is loaded again. Closes: #113
* Update Russian translationAleksandr Melman2023-04-121-19/+34
|
* Remove last hardcoded custom.conf referenceAlban Browaeys2023-04-121-1/+1
| | | | Fixes #41 "Customize PATH_GDM_CUSTOM via the configure script".
* user-manager: Fix another compiler warningRay Strode2023-04-111-0/+2
| | | | | | | | -Wswitch-enum apparently complains about missing entries even if there is a default:. This commit ensures ACT_USER_MANAGER_SEAT_STATE_UNLOADED is added to the default case to fix that warning.
* mocklibc: Fix compiler warningRay Strode2023-04-112-0/+15
| | | | | | | print_indent is defined in one file and used in another without a forward declaration. That leads to a compiler warning/error. This commit fixes that.
* user-manager: Track non-existent users23.13.9Ray Strode2023-03-271-1/+10
| | | | | | | | Right now if a user is non-existent we dispose of it. This is wrong, because callers may rely on it and they don't own it. This commit keeps a list of non-existent users on the user manager object.
* user-manager: Deduplicate ActUser objects when possibleRay Strode2023-03-271-0/+68
| | | | | | | | | | | | | | | | | | If act_user_manager_get_user_by_id is called twice in a row for the same user, two ActUser objects get generated, each ultimately representing the same user. That is less than ideal since the ActUser objects are owned by the user manager, not by the callers. This commit tries to minimize the amount of duplicate ActUser objects that can get put in the wild, by checking for existig in-flight requests and consolidating them. Note there can still be duplicated users if there is a act_user_manager_get_user and act_user_manager_get_user_by_id call for the same user at the same time. There's no way to deduplicate the objects in that case.
* user-manager: Cope with buggy callers betterRay Strode2023-03-271-1/+35
| | | | | | | | | | | | | The user manager owns the users returned from act_user_manager_get_user*, but it's possible callers may not realize that. If a caller does unref the result while a user fetch is in progress, it can lead to crashes that are hard to pin back to the caller. This commit adds a weak reference to the user object while fetch user requests are in flight, and cancels those requests, if the user object is unexpectantly destroyed in the meanwhile.
* user-manager: Add cancellable to fetch user requestsRay Strode2023-03-271-2/+19
| | | | | | | | | Right now it's possible for a fetch user request to come in after a user is destroyed. This commit adds a cancellable to the request so we don't leave operations in flight that we'll never need the results for.
* user-manager: Don't prematurely free duplicate ActUser objectsRay Strode2023-03-271-0/+14
| | | | | | | | | | | | | | | If act_user_manager_get_user_by_id is called twice in a row quickly for the same user, two ActUser objects get generated, each ultimately representing the same user. The second one to load gets freed because it's a duplicate. Freeing it is problematic though, because there still may be callers relying on it. This commit changes the code to track the object as a "doppleganger" instead of freeing it. Closes https://gitlab.freedesktop.org/accountsservice/accountsservice/-/issues/103
* tests: Add test for multiple in-flight get_user callsRay Strode2023-03-271-9/+48
| | | | | | | | AccountsService doesn't currently handle act_user_manager_get_user getting called multiple times in quick succession for the same user. This commit adds a test to test that.
* tests: Fix dbusmock accountservice template user parameterizationRay Strode2023-03-271-2/+1
| | | | | | | | | The accountservice template is supposed to allow the caller to be able to provide pre-existing users up front. We haven't used that feature yet, and it turns out it doesn't work. This commit fixes that, so that a future commit can make use of it.
* daemon: Fix boot delayRay Strode2023-03-241-0/+25
| | | | | | | | | | | | commit 836a9135fe2d8fdc7d6de3a6d11fb9a5fd05f926 made accountsservice reload wtmp less aggressively. Unfortunately, if wtmp is modified during boot, that added latency can delay the user list getting loaded. This commit addresses the problem by tracking how pressing the queued reload operation is, and makes it happen sooner if a higher priority request comes in.
* subprojects: Add mocklibc to package cacheRay Strode2023-03-172-0/+0
| | | | | | | | | | | | Many builders don't want to talk to the network at build time, but we currently do fetch mocklibc from the net. This commit adds an in repo copy of it it, to resolve the problem. Note, the project is very slow moving at this point so it's unlikely we'll need to update it later. Closes https://gitlab.freedesktop.org/accountsservice/accountsservice/-/issues/111
* user: Support new LocalAccount property in cache file23.11.69Ray Strode2023-03-153-0/+30
| | | | | | | | | | | | | | | | | | At the moment an admin can decide whether or not a user is a system account by setting SystemAccount= to true or false in the users cache file, but there's no way to to do the same sort of configuration for deciding whether or not a user is a local account. This commit adds support for a new LocalAccount= key in the cache file. Note, by default this key won't get written into the cache file and instead accountsservice will continue to rely on it's "user is in /etc/shadow" heuristic. The key only gets rewritten into the file during cache file serialization if an admin added it there first. Closes: https://gitlab.freedesktop.org/accountsservice/accountsservice/-/issues/110
* daemon: Track local users outside of fgetpwent generatorRay Strode2023-03-151-30/+35
| | | | | | | | | | | | | | | Right now we assume all local users are in /etc/shadow. This mostly right, but there may be cases where an admin wants a user to be treated as local even though they don't have a password set there. As a first step toward supporting that end goal, this commit changes the code to track local users in a hash table allocated outside of the generator function. This way the table can be used from more than one generator. A future commit will change the cache file generator to populate the local users hash table as well.
* meson.build: fix -Wimplicit-function-declaration in configure tests for printfSam James2023-02-281-0/+2
| | | | | | | | <stdio.h> needs to be included for printf. Newer compilers like Clang 16 make implicit function declarations an error by default which can cause misleading or incorrect configure test results. Signed-off-by: Sam James <sam@gentoo.org>
* Update POTFILES.inPiotr Drąg2023-02-251-0/+1
|
* Add lightdm autologin supportzhuyaliang2023-02-234-20/+162
|
* daemon: Don't crash if /etc/shadow doesn't existSimon McVittie2023-02-181-3/+2
| | | | | | | | | | | | | | | Turning off shadow passwords with `shadowconfig off` or `pwunconv` (so that the hashed password is in /etc/passwd) is something that distributions still at least half-support, and apparently some people genuinely do this. After resolving #107 this would cause accountsservice to crash. Looking at the implementation, it seems the same crash would happen if /etc/shadow is present but empty. In this situation, treat all users as non-local (unless cached) with a warning, but don't crash. Bug-Debian: https://bugs.debian.org/1031309 Signed-off-by: Simon McVittie <smcv@debian.org>
* Annotate varargs functions with G_GNUC_PRINTFSimon McVittie2023-02-073-1/+11
| | | | | | | | This lets the compiler detect and diagnose type mismatches like the one fixed in the previous commit. Helps: https://gitlab.freedesktop.org/accountsservice/accountsservice/-/issues/109 Signed-off-by: Simon McVittie <smcv@debian.org>
* user: Use correct format strings to print accounts_user_get_uid()Simon McVittie2023-02-071-12/+12
| | | | | | | | | | | | | | | The Uid property is defined in the D-Bus introspection XML to be a 64-bit unsigned integer, so we need to treat it as such when using varargs. Otherwise, architectures that do not align arguments on the stack at 64-bit boundaries can parse the stack incorrectly, resulting in a crash. For whatever obscure ABI reason, among Debian's supported architectures this only showed up as a segmentation fault on 32-bit ARM (specifically ARMv5 softfloat and ARMv7 hardfloat), and not on (for example) i386. Resolves: https://gitlab.freedesktop.org/accountsservice/accountsservice/-/issues/109 Signed-off-by: Simon McVittie <smcv@debian.org>
* daemon: Define local users as being exactly those present in /etc/shadowSimon McVittie2023-02-051-18/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | According to https://bugs.freedesktop.org/show_bug.cgi?id=48177 and https://gitlab.freedesktop.org/accountsservice/accountsservice/-/merge_requests/116, the intention is that merely existing in /etc/passwd is not enough to consider an account to be local; it must also be listed in /etc/shadow. This was done to provide graceful handling of systems where the complete list of LDAP/NIS/etc. users is written into /etc/passwd by rsync or similar instead of using a NSS plugin (but authentication still uses a PAM plugin). However, this unintentionally regressed in 34bedecf which continues reading after an account not in /etc/shadow is found. entry_generator_fgetpwent() intentionally only outputs a maximum of 50 users, and only outputs users that are classified as likely to be human users' accounts, as opposed to system uids. However, when enumerating cached or explicitly requested users, we need to look them up in a complete list of local users. Otherwise, we can incorrectly classify local users as remote (if they are beyond the limit of 50 or have a username or shell that is more typically used for system users), which makes at least GNOME Settings display a misleading user interface for those users. Resolves: https://gitlab.freedesktop.org/accountsservice/accountsservice/-/issues/107 Bug-Debian: https://bugs.debian.org/1030262 Signed-off-by: Simon McVittie <smcv@debian.org>
* daemon: Clarify use of generator_state->usersSimon McVittie2023-02-051-4/+7
| | | | Signed-off-by: Simon McVittie <smcv@debian.org>
* user: Replace usermod -p with chpasswd -eSimon McVittie2023-02-053-17/+30
| | | | | | | | | Writing the password to chpasswd's standard input avoids it becoming visible in `/proc/$pid/cmdline` (CVE-2012-6655). Resolves: https://gitlab.freedesktop.org/accountsservice/accountsservice/-/issues/8 Bug-Debian: https://bugs.debian.org/757912 Signed-off-by: Simon McVittie <smcv@debian.org>
* CI: Pass --gcov-ignore-parse-errors to gcovrSimon McVittie2023-02-032-0/+8
| | | | | | | | Workaround for https://github.com/gcovr/gcovr/issues/710 and similar bugs. Because Meson invokes gcovr internally, it doesn't seem to be possible to add options any other way. Signed-off-by: Simon McVittie <smcv@debian.org>
* CI: Fix build in a fork whose name is not accountsserviceSimon McVittie2023-02-032-2/+2
| | | | | | | I named my fork smcv/accountsservice-branches> and now I regret that choice. Signed-off-by: Simon McVittie <smcv@debian.org>
* CI: Install systemd, for /usr/share/pkgconfig/systemd.pcSimon McVittie2023-02-031-0/+1
| | | | | | | This is not in systemd-devel because it contains facts about the service manager itself, rather than facts about the libsystemd shared library. Signed-off-by: Simon McVittie <smcv@debian.org>
* Update friulian translationFabio Tomat2023-01-021-19/+32
|
* po: Update Georgian translationNorwayFun2022-11-201-26/+39
|
* Update Hindi (hi) translationHemish2022-11-181-27/+39
|
* Update Hungarian translationBalázs Úr2022-09-231-28/+43
|
* Update Catalan translationJordi Mas2022-09-131-22/+37
|
* Update hr.pogogogogi2022-08-151-1/+1
|
* ci: Do a coding style checkRay Strode2022-07-284-0/+176
| | | | | | | | | Now that the accountsservice code has been uncrustified, it would be good to keep it that way going forward. plymouth has a script it runs during CI to check the coding style. This commit steals that script and uses it for accountsservice CI too.
* ci: Only run ci stuff on merge requestsRay Strode2022-07-281-0/+4
| | | | | This is necessary for the CI_MERGE_REQUEST_DIFF_BASE_SHA variable to be exposed.
* src: Run entire tree through uncrustifyRay Strode2022-07-2819-1066/+1123
| | | | | | | | | | | The accountsservice coding style is less than pristine, and it would be good to improve that going forward. Its coding style is ostensibly the same as plymouths, though, and plymouth has an uncrustify config hammered out already. This commit runs the tree through that config to get things in better shape.
* tests: Fix tests for 2nd userBastien Nocera2022-07-261-5/+5
|
* tests: Add second user to test dataBastien Nocera2022-07-266-1/+17
|
* tests: Support multiple users for user dataBastien Nocera2022-07-261-8/+10
|
* tests: Add test for GetUsersLanguages() methodBastien Nocera2022-07-261-0/+5
|
* daemon: Add GetUsersLanguages() functionBastien Nocera2022-07-262-0/+109
| | | | | This will get an array of unique languages, formatted in XPG locale format, as used by all the users of the system.
* daemon: Move uid variable where it's usedBastien Nocera2022-07-261-1/+1
|
* tests: Add daemon tests for new Languages propertyBastien Nocera2022-07-261-0/+34
|
* tests: Add library tests for "Languages" propertyBastien Nocera2022-07-262-0/+10
|
* user: Add "Languages" user propertyBastien Nocera2022-07-265-6/+200
| | | | | | | | | Languages is a property that can be used by desktops to declare what languages other than the main UI language they would want to use, such as fallback languages for missing translations, preferred languages in subtitles, installed dictionaries, etc. See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1969