mirror of
https://github.com/systemd/systemd.git
synced 2025-01-04 09:18:12 +03:00
varlink: invert uid check to reduce call of getuid()
This commit is contained in:
parent
7647b8b2c2
commit
275f747924
@ -72,7 +72,7 @@ int varlink_method_set_log_level(sd_varlink *link, sd_json_variant *parameters,
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (uid != getuid() && uid != 0)
|
||||
if (uid != 0 && uid != getuid())
|
||||
return sd_varlink_error(link, SD_VARLINK_ERROR_PERMISSION_DENIED, parameters);
|
||||
|
||||
log_debug("Received io.systemd.Service.SetLogLevel(%i)", level);
|
||||
|
Loading…
Reference in New Issue
Block a user