Merge pull request #7884 from yuwata/small-fixes

Small fixes
This commit is contained in:
Lennart Poettering
2018-01-15 16:40:41 +01:00
committed by GitHub
8 changed files with 39 additions and 27 deletions
+4 -3
View File
@@ -100,9 +100,9 @@
<citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for information about the configuration of this service.</para>
<para>See <ulink
url="https://www.freedesktop.org/wiki/Software/systemd/multiseat">Multi-Seat
on Linux</ulink> for an introduction into basic concepts of logind
<para>See
<citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>3</manvolnum></citerefentry>
for information about the basic concepts of logind
such as users, sessions and seats.</para>
<para>See the <ulink
@@ -123,6 +123,7 @@
<citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
<citerefentry><refentrytitle>pam_systemd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
<citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
+1 -1
View File
@@ -261,7 +261,7 @@
<para>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].</para>
</listitem>
+6 -5
View File
@@ -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;
}
@@ -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;
}
+1 -1
View File
@@ -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) {
+12 -10
View File
@@ -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;
+1 -1
View File
@@ -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 },
+11 -6
View File
@@ -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;