mirror of
https://github.com/systemd/systemd.git
synced 2024-11-05 06:52:22 +03:00
logind: avoid shadow lookups when doing userdb client side
Let's not trigger MACs needlessly. Ideally everybody would turn on userdb, but if people insist in not doing so, then let's not attempt to open shadow. It's a bit ugly to implement this, since shadow information is more than just passwords (but accound validity metadata), and thus userdb's own "privieleged" scheme is orthogonal to this, but let's still do this for the client side. Fixes: #15105
This commit is contained in:
parent
ed30170ea0
commit
b062ca616c
@ -171,7 +171,7 @@ int manager_add_user_by_name(
|
|||||||
assert(m);
|
assert(m);
|
||||||
assert(name);
|
assert(name);
|
||||||
|
|
||||||
r = userdb_by_name(name, 0, &ur);
|
r = userdb_by_name(name, USERDB_AVOID_SHADOW, &ur);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ int manager_add_user_by_uid(
|
|||||||
assert(m);
|
assert(m);
|
||||||
assert(uid_is_valid(uid));
|
assert(uid_is_valid(uid));
|
||||||
|
|
||||||
r = userdb_by_uid(uid, 0, &ur);
|
r = userdb_by_uid(uid, USERDB_AVOID_SHADOW, &ur);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user