diff options
author | startx2017 <vradu.startx@yandex.com> | 2017-10-13 11:30:25 -0400 |
---|---|---|
committer | startx2017 <vradu.startx@yandex.com> | 2017-10-13 11:30:25 -0400 |
commit | 11466d4430da22ee05eb2a1c13706986e719e5b2 (patch) | |
tree | 27639ce36f432bd4eb1006648f8bb5a357b6ad2e /src/firejail/profile.c | |
parent | release allocd mem in private-bin (diff) | |
download | firejail-11466d4430da22ee05eb2a1c13706986e719e5b2.tar.gz firejail-11466d4430da22ee05eb2a1c13706986e719e5b2.tar.zst firejail-11466d4430da22ee05eb2a1c13706986e719e5b2.zip |
enhanced globbing for --blacklist
Diffstat (limited to 'src/firejail/profile.c')
-rw-r--r-- | src/firejail/profile.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/firejail/profile.c b/src/firejail/profile.c index 6880bcaa7..8aabac6fa 100644 --- a/src/firejail/profile.c +++ b/src/firejail/profile.c | |||
@@ -925,7 +925,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
925 | } | 925 | } |
926 | 926 | ||
927 | // check name | 927 | // check name |
928 | invalid_filename(subdirname); | 928 | invalid_filename(subdirname, 0); // no globbing |
929 | if (strstr(subdirname, "..") || strstr(subdirname, "/")) { | 929 | if (strstr(subdirname, "..") || strstr(subdirname, "/")) { |
930 | fprintf(stderr, "Error: invalid overlay name\n"); | 930 | fprintf(stderr, "Error: invalid overlay name\n"); |
931 | exit(1); | 931 | exit(1); |
@@ -993,8 +993,8 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
993 | } | 993 | } |
994 | 994 | ||
995 | // check directories | 995 | // check directories |
996 | invalid_filename(dname1); | 996 | invalid_filename(dname1, 0); // no globbing |
997 | invalid_filename(dname2); | 997 | invalid_filename(dname2, 0); // no globbing |
998 | if (strstr(dname1, "..") || strstr(dname2, "..")) { | 998 | if (strstr(dname1, "..") || strstr(dname2, "..")) { |
999 | fprintf(stderr, "Error: invalid file name.\n"); | 999 | fprintf(stderr, "Error: invalid file name.\n"); |
1000 | exit(1); | 1000 | exit(1); |
@@ -1118,7 +1118,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { | |||
1118 | } | 1118 | } |
1119 | 1119 | ||
1120 | // some characters just don't belong in filenames | 1120 | // some characters just don't belong in filenames |
1121 | invalid_filename(ptr); | 1121 | invalid_filename(ptr, 1); // globbing |
1122 | if (strstr(ptr, "..")) { | 1122 | if (strstr(ptr, "..")) { |
1123 | if (lineno == 0) | 1123 | if (lineno == 0) |
1124 | fprintf(stderr, "Error: \"%s\" is an invalid filename\n", ptr); | 1124 | fprintf(stderr, "Error: \"%s\" is an invalid filename\n", ptr); |
@@ -1165,7 +1165,7 @@ void profile_read(const char *fname) { | |||
1165 | } | 1165 | } |
1166 | 1166 | ||
1167 | // check file | 1167 | // check file |
1168 | invalid_filename(fname); | 1168 | invalid_filename(fname, 0); // no globbing |
1169 | if (strlen(fname) == 0 || is_dir(fname)) { | 1169 | if (strlen(fname) == 0 || is_dir(fname)) { |
1170 | fprintf(stderr, "Error: invalid profile file\n"); | 1170 | fprintf(stderr, "Error: invalid profile file\n"); |
1171 | exit(1); | 1171 | exit(1); |