From 6b0fef6dba9a712933d6a5ae7cee9cca7aeb76b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 19 Feb 2018 02:18:32 +0100 Subject: [PATCH] qrexec: automatically translate '$' to '@' in target name specification After the change of target keywords, apply transparen translation from old names. This will avoid breaking calls from not updated VMs. Apply this change only in stable branch. --- qrexec/qrexec-daemon.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qrexec/qrexec-daemon.c b/qrexec/qrexec-daemon.c index 98ab356..679c163 100644 --- a/qrexec/qrexec-daemon.c +++ b/qrexec/qrexec-daemon.c @@ -632,6 +632,10 @@ static void sanitize_name(char * untrusted_s_signed, char *extra_allowed_chars) continue; if (*untrusted_s >= '0' && *untrusted_s <= '9') continue; + if (*untrusted_s == '$' && strchr(extra_allowed_chars, '@')) { + *untrusted_s = '@'; + continue; + } if (*untrusted_s == '_' || *untrusted_s == '-' || *untrusted_s == '.')