Skip to content

Commit a2ae516

Browse files
committed
getty-generator: properly escape instance names
Otherwise the add_symlink() function tries to make directories for each slash even for the slash after the @ symbol in the final link name, failing for /dev/3270/tty1. Based on a patch by Werner Fink <werner@suse.de>.
1 parent f565061 commit a2ae516

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/getty-generator/getty-generator.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static int add_serial_getty(const char *tty) {
6767

6868
log_debug("Automatically adding serial getty for /dev/%s.", tty);
6969

70-
n = unit_name_replace_instance("serial-getty@.service", tty);
70+
n = unit_name_from_path_instance("serial-getty", tty, ".service");
7171
if (!n)
7272
return log_oom();
7373

@@ -81,7 +81,7 @@ static int add_container_getty(const char *tty) {
8181

8282
log_debug("Automatically adding container getty for /dev/pts/%s.", tty);
8383

84-
n = unit_name_replace_instance("container-getty@.service", tty);
84+
n = unit_name_from_path_instance("container-getty", tty, ".service");
8585
if (!n)
8686
return log_oom();
8787

0 commit comments

Comments
 (0)