summaryrefslogtreecommitdiffstats
path: root/src/shared/user-record-nss.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* user-record-nss: check if strings from pwd/spwd/grp/sgrp are valid utf-8Zbigniew Jędrzejewski-Szmek2020-09-011-11/+37
| | | | | | | | | strv_extend_strv_utf8_only() uses a temporary buffer to make the implementation conscise. Otherwise we'd have to rewrite all of strv_extend_strv() which didn't seem worth the trouble for this one use outside of a hot path. If the data is not serializable, we just pretend it doesn't exists. This fixes #16683 and https://bugs.gentoo.org/735072 in a second way.
* shared: merge {user,group}-record-nss.{c,h}Zbigniew Jędrzejewski-Szmek2020-09-011-0/+213
| | | | | They both are both short and contain similar parts and various helper will be shared between both parts of the code so it's easier to use a single file.
* shared/{user,group}-record-nss: adjust filtering of "valid" passwordsZbigniew Jędrzejewski-Szmek2020-08-311-1/+1
| | | | | | | | | | | | We would reject various passwords that glibc accepts, for example "" or any descrypted password. Accounts with empty password are definitely useful, for example for testing or in scenarios where a password is not needed. Also, using weak encryption methods is probably not a good idea, it's not the job of our nss helpers to decide that: they should just faithfully forward whatever data is there. Also rename the function to make it more obvious that the returned answer is not in any way certain.
* user-record: deal with invalid GECOS fields gracefullyLennart Poettering2020-08-071-4/+20
| | | | | | | | | | Let's fix up invalid GECOS fields both when we convert from NSS to JSON and the other way round. Kinda sucks we have to do that, but NSS does it when writing data to /etc/passwd, so let's do the same. Fixes: #16668
* userdb: when doing client-side NSS look-ups optionally avoid shadow look-upsLennart Poettering2020-04-091-16/+32
|
* shared/user-record-nss: use macro to avoid repeatsZbigniew Jędrzejewski-Szmek2020-01-171-63/+46
| | | | It's easier to read when each field is intialized in exactly one place.
* shared/user-record-nss: shorten code a bitZbigniew Jędrzejewski-Szmek2020-01-161-21/+10
| | | | free_and_strdup() already does comparison internally.
* shared: add helpers for converting NSS passwd/group structures to new JSON ↵Lennart Poettering2020-01-151-0/+288
objects These new calls may be used to convert classic UNIX/glibc NSS struct passwd and struct group records into new-style JSON-based user/group objects.