1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-29 04:55:26 +03:00

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>.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2014-06-19 22:02:55 -04:00
parent f56506141c
commit a2ae516a25

View File

@ -67,7 +67,7 @@ static int add_serial_getty(const char *tty) {
log_debug("Automatically adding serial getty for /dev/%s.", tty);
n = unit_name_replace_instance("serial-getty@.service", tty);
n = unit_name_from_path_instance("serial-getty", tty, ".service");
if (!n)
return log_oom();
@ -81,7 +81,7 @@ static int add_container_getty(const char *tty) {
log_debug("Automatically adding container getty for /dev/pts/%s.", tty);
n = unit_name_replace_instance("container-getty@.service", tty);
n = unit_name_from_path_instance("container-getty", tty, ".service");
if (!n)
return log_oom();