sysusers: support u username -:300 style syntax (#8325)
This PR implements the first part of RFE #8046. I.e. this allows to write: ``` u username -:300 ``` Where the uid is chosen automatically but the gid is fixed.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
283def70cf
commit
1825c909ff
@@ -1599,11 +1599,12 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
||||
i->id_set_strict = true;
|
||||
free_and_replace(resolved_id, uid);
|
||||
}
|
||||
r = parse_uid(resolved_id, &i->uid);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to parse UID: '%s': %m", id);
|
||||
|
||||
i->uid_set = true;
|
||||
if (!streq(resolved_id, "-")) {
|
||||
r = parse_uid(resolved_id, &i->uid);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to parse UID: '%s': %m", id);
|
||||
i->uid_set = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user