From ef05b63a36d696bee40ac412a2d3950ea82f47ea Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Tue, 13 Sep 2016 10:26:08 +0200 Subject: [PATCH] fix chrony-helper to escape names of systemd units (#1374767) --- chrony.helper | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chrony.helper b/chrony.helper index 0831482..c150ff6 100644 --- a/chrony.helper +++ b/chrony.helper @@ -117,7 +117,7 @@ update_dnssrv_servers() { set_dnssrv_timer() { local state=$1 name=$2 local srv_file=$helper_dir/dnssrv@$name servers - local timer=$dnssrv_timer_prefix$name.timer + local timer=$dnssrv_timer_prefix$(systemd-escape "$name").timer check_dnssrv_name "$name" || return 1 @@ -133,7 +133,10 @@ set_dnssrv_timer() { list_dnssrv_timers() { systemctl --all --full -t timer list-units | grep "^$dnssrv_timer_prefix" | \ - sed "s|^$dnssrv_timer_prefix\(.*\)\.timer.*|\1|" + sed "s|^$dnssrv_timer_prefix\(.*\)\.timer.*|\1|" | + while read -r name; do + systemd-escape --unescape "$name" + done } prepare_helper_dir() {