UID entry in the machine state file is introduced in v258,
hence when a host is upgraded to v258, the field does not exist in the
file, thus the variable 'uid' is NULL.
Follow-up for
276d20018623ef14956ce87975be48da5de63f29.
Fixes #39061.
log_warning_errno(r, "Failed to parse AF_VSOCK CID, ignoring: %s", vsock_cid);
}
- r = parse_uid(uid, &m->uid);
- if (r < 0)
- log_warning_errno(r, "Failed to parse owning UID, ignoring: %s", uid);
+ if (uid) {
+ r = parse_uid(uid, &m->uid);
+ if (r < 0)
+ log_warning_errno(r, "Failed to parse owning UID, ignoring: %s", uid);
+ }
return r;
}