From af3e5b21afd587187d820aba493738162db8615b Mon Sep 17 00:00:00 2001 From: netblue30 Date: Thu, 1 Oct 2020 08:39:55 -0400 Subject: print error for /home/netblue in profile files (#3071) --- src/firejail/macros.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/firejail/macros.c b/src/firejail/macros.c index e52a7a430..2623d794f 100644 --- a/src/firejail/macros.c +++ b/src/firejail/macros.c @@ -208,7 +208,11 @@ char *expand_macros(const char *path) { // Replace home macro char *new_name = NULL; - if (strncmp(path, "${HOME}", 7) == 0) { + if (strncmp(path, "$HOME", 5) == 0) { + fprintf(stderr, "Error: $HOME is not allowed in profile files, please replace it with ${HOME}\n"); + exit(1); + } + else if (strncmp(path, "${HOME}", 7) == 0) { if (asprintf(&new_name, "%s%s", cfg.homedir, path + 7) == -1) errExit("asprintf"); if(called_as_root) -- cgit v1.2.3-70-g09d2