diff --git a/man/systemd-logind.service.xml b/man/systemd-logind.service.xml index b51158b7cd..f3a3b24200 100644 --- a/man/systemd-logind.service.xml +++ b/man/systemd-logind.service.xml @@ -100,9 +100,9 @@ logind.conf5 for information about the configuration of this service. - See Multi-Seat - on Linux for an introduction into basic concepts of logind + See + sd-login3 + for information about the basic concepts of logind such as users, sessions and seats. See the loginctl1, logind.conf5, pam_systemd8 + sd-login3 diff --git a/man/systemd.generator.xml b/man/systemd.generator.xml index 5e25bb776d..7ed6a2dc82 100644 --- a/man/systemd.generator.xml +++ b/man/systemd.generator.xml @@ -261,7 +261,7 @@ Of these two rules the first rule is probably the more important one and breaks the second one sometimes. Hence, - when deciding whether to user argv[1], argv[2], or argv[3], + when deciding whether to use argv[1], argv[2], or argv[3], your default choice should probably be argv[1]. diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index 278f38f24e..74536e1715 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -464,13 +464,14 @@ static int do_rotate( return -EINVAL; r = journal_file_rotate(f, s->compress, seal, s->deferred_closes); - if (r < 0) + if (r < 0) { if (*f) - log_error_errno(r, "Failed to rotate %s: %m", (*f)->path); + return log_error_errno(r, "Failed to rotate %s: %m", (*f)->path); else - log_error_errno(r, "Failed to create new %s journal: %m", name); - else - server_add_acls(*f, uid); + return log_error_errno(r, "Failed to create new %s journal: %m", name); + } + + server_add_acls(*f, uid); return r; } diff --git a/src/libsystemd-network/test-dhcp6-client.c b/src/libsystemd-network/test-dhcp6-client.c index 3eaf9111dc..aae49fa467 100644 --- a/src/libsystemd-network/test-dhcp6-client.c +++ b/src/libsystemd-network/test-dhcp6-client.c @@ -262,6 +262,7 @@ static int test_option_status(sd_event *e) { r = dhcp6_option_parse_ia(option, &ia); assert_se(r >= 0); assert_se(ia.addresses != NULL); + dhcp6_lease_free_ia(&ia); zero(pd); option = (DHCP6Option *)option4; @@ -273,6 +274,7 @@ static int test_option_status(sd_event *e) { assert_se(memcmp(&pd.ia_pd.id, &option4[4], 4) == 0); assert_se(memcmp(&pd.ia_pd.lifetime_t1, &option4[8], 4) == 0); assert_se(memcmp(&pd.ia_pd.lifetime_t2, &option4[12], 4) == 0); + dhcp6_lease_free_ia(&pd); zero(pd); option = (DHCP6Option *)option5; @@ -281,6 +283,7 @@ static int test_option_status(sd_event *e) { r = dhcp6_option_parse_ia(option, &pd); assert_se(r == 0); assert_se(pd.addresses != NULL); + dhcp6_lease_free_ia(&pd); return 0; } diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 6ff1d9890c..2bdb5852a2 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -129,7 +129,7 @@ static bool link_radv_enabled(Link *link) { if (!link_ipv6ll_enabled(link)) return false; - return (link->network->router_prefix_delegation != RADV_PREFIX_DELEGATION_NONE); + return link->network->router_prefix_delegation != RADV_PREFIX_DELEGATION_NONE; } static bool link_lldp_rx_enabled(Link *link) { diff --git a/src/network/networkd-radv.c b/src/network/networkd-radv.c index 5fdab89f2d..a921d120b3 100644 --- a/src/network/networkd-radv.c +++ b/src/network/networkd-radv.c @@ -28,16 +28,18 @@ #include "sd-radv.h" #include "string-util.h" -int config_parse_router_prefix_delegation(const char *unit, - const char *filename, - unsigned line, - const char *section, - unsigned section_line, - const char *lvalue, - int ltype, - const char *rvalue, - void *data, - void *userdata) { +int config_parse_router_prefix_delegation( + const char *unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + Network *network = userdata; int d; diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 906eb1879a..e44241fd3a 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -8409,7 +8409,7 @@ static int systemctl_main(int argc, char *argv[]) { { "isolate", 2, 2, VERB_ONLINE_ONLY, start_unit }, { "kill", 2, VERB_ANY, VERB_ONLINE_ONLY, kill_unit }, { "is-active", 2, VERB_ANY, VERB_ONLINE_ONLY, check_unit_active }, - { "check", 2, VERB_ANY, VERB_ONLINE_ONLY, check_unit_active }, + { "check", 2, VERB_ANY, VERB_ONLINE_ONLY, check_unit_active }, /* deprecated alias of is-active */ { "is-failed", 2, VERB_ANY, VERB_ONLINE_ONLY, check_unit_failed }, { "show", VERB_ANY, VERB_ANY, VERB_ONLINE_ONLY, show }, { "cat", 2, VERB_ANY, VERB_ONLINE_ONLY, cat }, diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c index 962285f7b1..acd7ff133a 100644 --- a/src/timesync/timesyncd.c +++ b/src/timesync/timesyncd.c @@ -96,7 +96,7 @@ static int load_clock_timestamp(uid_t uid, gid_t gid) { int main(int argc, char *argv[]) { _cleanup_(manager_freep) Manager *m = NULL; const char *user = "systemd-timesync"; - uid_t uid; + uid_t uid, uid_current; gid_t gid; int r; @@ -113,10 +113,15 @@ int main(int argc, char *argv[]) { goto finish; } - r = get_user_creds(&user, &uid, &gid, NULL, NULL); - if (r < 0) { - log_error_errno(r, "Cannot resolve user name %s: %m", user); - goto finish; + uid = uid_current = geteuid(); + gid = getegid(); + + if (uid_current == 0) { + r = get_user_creds(&user, &uid, &gid, NULL, NULL); + if (r < 0) { + log_error_errno(r, "Cannot resolve user name %s: %m", user); + goto finish; + } } r = load_clock_timestamp(uid, gid); @@ -125,7 +130,7 @@ int main(int argc, char *argv[]) { /* Drop privileges, but only if we have been started as root. If we are not running as root we assume all * privileges are already dropped. */ - if (geteuid() == 0) { + if (uid_current == 0) { r = drop_privileges(uid, gid, (1ULL << CAP_SYS_TIME)); if (r < 0) goto finish;