diff options
author | netblue30 <netblue30@yahoo.com> | 2020-10-01 08:39:55 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2020-10-01 08:39:55 -0400 |
commit | af3e5b21afd587187d820aba493738162db8615b (patch) | |
tree | f2e6cba5c00f05938770bd76f9fe5664eba5be8e /src | |
parent | fix shell=none for --audit (#3116) (diff) | |
download | firejail-af3e5b21afd587187d820aba493738162db8615b.tar.gz firejail-af3e5b21afd587187d820aba493738162db8615b.tar.zst firejail-af3e5b21afd587187d820aba493738162db8615b.zip |
print error for /home/netblue in profile files (#3071)
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/macros.c | 6 |
1 files changed, 5 insertions, 1 deletions
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) { | |||
208 | 208 | ||
209 | // Replace home macro | 209 | // Replace home macro |
210 | char *new_name = NULL; | 210 | char *new_name = NULL; |
211 | if (strncmp(path, "${HOME}", 7) == 0) { | 211 | if (strncmp(path, "$HOME", 5) == 0) { |
212 | fprintf(stderr, "Error: $HOME is not allowed in profile files, please replace it with ${HOME}\n"); | ||
213 | exit(1); | ||
214 | } | ||
215 | else if (strncmp(path, "${HOME}", 7) == 0) { | ||
212 | if (asprintf(&new_name, "%s%s", cfg.homedir, path + 7) == -1) | 216 | if (asprintf(&new_name, "%s%s", cfg.homedir, path + 7) == -1) |
213 | errExit("asprintf"); | 217 | errExit("asprintf"); |
214 | if(called_as_root) | 218 | if(called_as_root) |