mirror of
https://github.com/systemd/systemd.git
synced 2025-03-31 14:50:15 +03:00
Merge pull request #19570 from poettering/userdb-followup-fixlets
two minor userdb fixes
This commit is contained in:
commit
aa67e45b4b
@ -114,6 +114,8 @@ static UserDBIterator* userdb_iterator_new(LookupWhat what, UserDBFlags flags) {
|
||||
*i = (UserDBIterator) {
|
||||
.what = what,
|
||||
.flags = flags,
|
||||
.synthesize_root = !FLAGS_SET(flags, USERDB_DONT_SYNTHESIZE),
|
||||
.synthesize_nobody = !FLAGS_SET(flags, USERDB_DONT_SYNTHESIZE),
|
||||
};
|
||||
|
||||
return i;
|
||||
@ -510,7 +512,7 @@ static int userdb_start_query(
|
||||
}
|
||||
|
||||
if (set_isempty(iterator->links))
|
||||
return ret; /* propagate last error we saw if we couldn't connect to anything. */
|
||||
return ret < 0 ? ret : -ESRCH; /* propagate last error we saw if we couldn't connect to anything. */
|
||||
|
||||
/* We connected to some services, in this case, ignore the ones we failed on */
|
||||
return 0;
|
||||
@ -730,8 +732,6 @@ int userdb_all(UserDBFlags flags, UserDBIterator **ret) {
|
||||
if (!iterator)
|
||||
return -ENOMEM;
|
||||
|
||||
iterator->synthesize_root = iterator->synthesize_nobody = !FLAGS_SET(flags, USERDB_DONT_SYNTHESIZE);
|
||||
|
||||
qr = userdb_start_query(iterator, "io.systemd.UserDatabase.GetUserRecord", true, NULL, flags);
|
||||
|
||||
if (!FLAGS_SET(flags, USERDB_EXCLUDE_NSS) && (qr < 0 || !iterator->nss_covered)) {
|
||||
@ -1002,8 +1002,6 @@ int groupdb_all(UserDBFlags flags, UserDBIterator **ret) {
|
||||
if (!iterator)
|
||||
return -ENOMEM;
|
||||
|
||||
iterator->synthesize_root = iterator->synthesize_nobody = !FLAGS_SET(flags, USERDB_DONT_SYNTHESIZE);
|
||||
|
||||
qr = userdb_start_query(iterator, "io.systemd.UserDatabase.GetGroupRecord", true, NULL, flags);
|
||||
|
||||
if (!FLAGS_SET(flags, USERDB_EXCLUDE_NSS) && (qr < 0 || !iterator->nss_covered)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user