mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
bus: ignore the passed UID on EXTERNAL auth if ANONYMOUS is allowed
This commit is contained in:
parent
638866cbea
commit
8411d2a2b1
@ -235,7 +235,7 @@ static int verify_external_token(sd_bus *b, const char *p, size_t l) {
|
||||
* the owner of this bus wanted authentication he should have
|
||||
* checked SO_PEERCRED before even creating the bus object. */
|
||||
|
||||
if (!b->ucred_valid)
|
||||
if (!b->anonymous_auth && !b->ucred_valid)
|
||||
return 0;
|
||||
|
||||
if (l <= 0)
|
||||
@ -258,7 +258,9 @@ static int verify_external_token(sd_bus *b, const char *p, size_t l) {
|
||||
if (r < 0)
|
||||
return 0;
|
||||
|
||||
if (u != b->ucred.uid)
|
||||
/* We ignore the passed value if anonymous authentication is
|
||||
* on anyway. */
|
||||
if (!b->anonymous_auth && u != b->ucred.uid)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user