Commit Graph

5 Commits

Author SHA1 Message Date
Yu Watanabe db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
Frantisek Sumsal 69e3234db7 tree-wide: fix typos found by codespell
Reported by Fossies.org
2020-09-14 15:32:37 +02:00
Lennart Poettering 002674387c offline-passwd: use chase_symlinks()
In case the passwd/group file is symlinked, follow things correctly.

Follow-up for: #16512
Addresses: https://github.com/systemd/systemd/pull/16512#discussion_r458073677
2020-07-21 22:31:00 +02:00
Zbigniew Jędrzejewski-Szmek 241947d1b4 shared/offline-passwd: look at /usr/lib/{passwd,group} too
This changes the code to allow looking at multiple files with different
prefixes, but uses "/etc" and "/usr/lib". rpm-ostree uses
/usr/lib/{passwd,group} with nss-altfiles. I see no harm in simply trying both
paths on all systems.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1857530.

A minor memory leak is fixed: hashmap_put() returns -EEXIST is the key is
present *and* and the value is different. It return 0 if the value is the
same. Thus, we would leak the user/group name if it was specified multiple
times with the same uid/gid. I opted to remove the warning message completely:
with multiple files it is reasonable to have the same name defined more than
once. But even with one file the warning is dubious: all tools that read those
files deal correctly with duplicate entries and we are not writing a linter.
2020-07-18 14:14:19 +02:00
Zbigniew Jędrzejewski-Szmek 3e5d2264b5 Move offline-password.[ch] to shared and add test-offline-passwd
The test binary has two modes: in the default argument-less mode, it
just checks that "root" can be resolved. When invoked manually, a root
prefix and user/group names can be specified.
2020-07-18 14:14:19 +02:00
Renamed from src/tmpfiles/offline-passwd.c (Browse further)