diff options
Diffstat (limited to 'src/firejail/fs_etc.c')
-rw-r--r-- | src/firejail/fs_etc.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/firejail/fs_etc.c b/src/firejail/fs_etc.c index 7e18840fd..6a70d482c 100644 --- a/src/firejail/fs_etc.c +++ b/src/firejail/fs_etc.c | |||
@@ -62,37 +62,6 @@ errexit: | |||
62 | exit(1); | 62 | exit(1); |
63 | } | 63 | } |
64 | 64 | ||
65 | void fs_check_etc_list(void) { | ||
66 | EUID_ASSERT(); | ||
67 | if (strstr(cfg.etc_private_keep, "..")) { | ||
68 | fprintf(stderr, "Error: invalid private etc list\n"); | ||
69 | exit(1); | ||
70 | } | ||
71 | |||
72 | char *dlist = strdup(cfg.etc_private_keep); | ||
73 | if (!dlist) | ||
74 | errExit("strdup"); | ||
75 | |||
76 | // build a new list only with the files found | ||
77 | char *newlist = malloc(strlen(cfg.etc_private_keep) + 1); | ||
78 | if (!newlist) | ||
79 | errExit("malloc"); | ||
80 | *newlist = '\0'; | ||
81 | |||
82 | char *ptr = strtok(dlist, ","); | ||
83 | if (check_dir_or_file(ptr)) | ||
84 | strcat(newlist, ptr); | ||
85 | while ((ptr = strtok(NULL, ",")) != NULL) { | ||
86 | if (check_dir_or_file(ptr)) { | ||
87 | strcat(newlist, ","); | ||
88 | strcat(newlist, ptr); | ||
89 | } | ||
90 | } | ||
91 | cfg.etc_private_keep = newlist; | ||
92 | |||
93 | free(dlist); | ||
94 | } | ||
95 | |||
96 | static void duplicate(char *fname) { | 65 | static void duplicate(char *fname) { |
97 | // copy the file | 66 | // copy the file |
98 | if (arg_debug) | 67 | if (arg_debug) |