aboutsummaryrefslogtreecommitdiffstats
path: root/src/fnetfilter/main.c
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2022-03-10 14:43:17 +0100
committerLibravatar smitsohu <smitsohu@gmail.com>2022-03-10 14:43:17 +0100
commit4d3d3270883140535cc6ea5a190aebdf6f3dc120 (patch)
tree7bae03cfce71b7f13bba30fe907354d97d40df74 /src/fnetfilter/main.c
parentRELNOTES: add warning about allow-tray (diff)
downloadfirejail-4d3d3270883140535cc6ea5a190aebdf6f3dc120.tar.gz
firejail-4d3d3270883140535cc6ea5a190aebdf6f3dc120.tar.zst
firejail-4d3d3270883140535cc6ea5a190aebdf6f3dc120.zip
refactor meta character filtering
Diffstat (limited to 'src/fnetfilter/main.c')
-rw-r--r--src/fnetfilter/main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/fnetfilter/main.c b/src/fnetfilter/main.c
index 081408ab3..a89e12933 100644
--- a/src/fnetfilter/main.c
+++ b/src/fnetfilter/main.c
@@ -187,10 +187,9 @@ printf("\n");
187 char *command = (argc == 3)? argv[1]: NULL; 187 char *command = (argc == 3)? argv[1]: NULL;
188//printf("command %s\n", command); 188//printf("command %s\n", command);
189//printf("destfile %s\n", destfile); 189//printf("destfile %s\n", destfile);
190
190 // destfile is a real filename 191 // destfile is a real filename
191 int len = strlen(destfile); 192 reject_meta_chars(destfile, 0);
192 if (strcspn(destfile, "\\&!?\"'<>%^(){};,*[]") != (size_t)len)
193 err_exit_cannot_open_file(destfile);
194 193
195 // handle default config (command = NULL, destfile) 194 // handle default config (command = NULL, destfile)
196 if (command == NULL) { 195 if (command == NULL) {