Skip to content

Commit

Permalink
escape: call unit_name_is_valid() with correct flags
Browse files Browse the repository at this point in the history
Otherwise --template= simply doesn't work:

$ ./systemd-escape --template=systemd-mkfs@.service --path /dev/test9
is_valid: 0
is_template: 1
Template name systemd-mkfs@.service is not valid.

Related: RHEL-17394

rhel-only
  • Loading branch information
mrc0mmand committed Nov 27, 2023
1 parent 2d97c61 commit caa0c0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/escape/escape.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static int parse_argv(int argc, char *argv[]) {

case ARG_TEMPLATE:

if (!unit_name_is_valid(optarg, true) || !unit_name_is_template(optarg)) {
if (!unit_name_is_valid(optarg, UNIT_NAME_TEMPLATE) || !unit_name_is_template(optarg)) {
log_error("Template name %s is not valid.", optarg);
return -EINVAL;
}
Expand Down

0 comments on commit caa0c0a

Please sign in to comment.