mirror of
https://github.com/systemd/systemd.git
synced 2024-11-02 02:21:44 +03:00
main: make sure set_machine_id() doesn't clobber arg_machine_id on failure
This commit is contained in:
parent
15b1248a6b
commit
e042eab720
@ -291,14 +291,16 @@ static int parse_crash_chvt(const char *value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int set_machine_id(const char *m) {
|
static int set_machine_id(const char *m) {
|
||||||
|
sd_id128_t t;
|
||||||
assert(m);
|
assert(m);
|
||||||
|
|
||||||
if (sd_id128_from_string(m, &arg_machine_id) < 0)
|
if (sd_id128_from_string(m, &t) < 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (sd_id128_is_null(arg_machine_id))
|
if (sd_id128_is_null(t))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
arg_machine_id = t;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user