diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fbuilder/build_bin.c | 2 | ||||
-rw-r--r-- | src/fbuilder/build_fs.c | 12 | ||||
-rw-r--r-- | src/fbuilder/build_home.c | 2 | ||||
-rw-r--r-- | src/fbuilder/build_profile.c | 23 | ||||
-rw-r--r-- | src/man/firejail-profile.txt | 12 | ||||
-rw-r--r-- | src/man/firejail.txt | 14 |
6 files changed, 39 insertions, 26 deletions
diff --git a/src/fbuilder/build_bin.c b/src/fbuilder/build_bin.c index 96bd351f3..431aebee6 100644 --- a/src/fbuilder/build_bin.c +++ b/src/fbuilder/build_bin.c | |||
@@ -121,6 +121,6 @@ void build_bin(const char *fname, FILE *fp) { | |||
121 | ptr = ptr->next; | 121 | ptr = ptr->next; |
122 | } | 122 | } |
123 | fprintf(fp, "\n"); | 123 | fprintf(fp, "\n"); |
124 | fprintf(fp, "# private-lib\n"); | 124 | fprintf(fp, "#private-lib\n"); |
125 | } | 125 | } |
126 | } | 126 | } |
diff --git a/src/fbuilder/build_fs.c b/src/fbuilder/build_fs.c index 495f71ab8..ac0cd455a 100644 --- a/src/fbuilder/build_fs.c +++ b/src/fbuilder/build_fs.c | |||
@@ -220,6 +220,10 @@ static void tmp_callback(char *ptr) { | |||
220 | // skip strace file | 220 | // skip strace file |
221 | if (strncmp(ptr, "/tmp/firejail-strace", 20) == 0) | 221 | if (strncmp(ptr, "/tmp/firejail-strace", 20) == 0) |
222 | return; | 222 | return; |
223 | if (strncmp(ptr, "/tmp/runtime-", 13) == 0) | ||
224 | return; | ||
225 | if (strcmp(ptr, "/tmp") == 0) | ||
226 | return; | ||
223 | 227 | ||
224 | tmp_out = filedb_add(tmp_out, ptr); | 228 | tmp_out = filedb_add(tmp_out, ptr); |
225 | } | 229 | } |
@@ -232,8 +236,7 @@ void build_tmp(const char *fname, FILE *fp) { | |||
232 | if (tmp_out == NULL) | 236 | if (tmp_out == NULL) |
233 | fprintf(fp, "private-tmp\n"); | 237 | fprintf(fp, "private-tmp\n"); |
234 | else { | 238 | else { |
235 | fprintf(fp, "\n"); | 239 | fprintf(fp, "#private-tmp\n"); |
236 | fprintf(fp, "# private-tmp\n"); | ||
237 | fprintf(fp, "# File accessed in /tmp directory:\n"); | 240 | fprintf(fp, "# File accessed in /tmp directory:\n"); |
238 | fprintf(fp, "# "); | 241 | fprintf(fp, "# "); |
239 | FileDB *ptr = tmp_out; | 242 | FileDB *ptr = tmp_out; |
@@ -310,9 +313,8 @@ void build_dev(const char *fname, FILE *fp) { | |||
310 | if (dev_out == NULL) | 313 | if (dev_out == NULL) |
311 | fprintf(fp, "private-dev\n"); | 314 | fprintf(fp, "private-dev\n"); |
312 | else { | 315 | else { |
313 | fprintf(fp, "\n"); | 316 | fprintf(fp, "#private-dev\n"); |
314 | fprintf(fp, "# private-dev\n"); | 317 | fprintf(fp, "# This is the list of devices accessed on top of regular private-dev devices:\n"); |
315 | fprintf(fp, "# This is the list of devices accessed (on top of regular private-dev devices:\n"); | ||
316 | fprintf(fp, "# "); | 318 | fprintf(fp, "# "); |
317 | FileDB *ptr = dev_out; | 319 | FileDB *ptr = dev_out; |
318 | while (ptr) { | 320 | while (ptr) { |
diff --git a/src/fbuilder/build_home.c b/src/fbuilder/build_home.c index 683009b71..d7706282a 100644 --- a/src/fbuilder/build_home.c +++ b/src/fbuilder/build_home.c | |||
@@ -141,7 +141,7 @@ void process_home(const char *fname, char *home, int home_len) { | |||
141 | } | 141 | } |
142 | 142 | ||
143 | // skip files and directories in whitelist-common.inc | 143 | // skip files and directories in whitelist-common.inc |
144 | if (filedb_find(db_skip, toadd)) { | 144 | if (strlen(toadd) == 0 || filedb_find(db_skip, toadd)) { |
145 | if (dir) | 145 | if (dir) |
146 | free(dir); | 146 | free(dir); |
147 | continue; | 147 | continue; |
diff --git a/src/fbuilder/build_profile.c b/src/fbuilder/build_profile.c index 96a83954d..0c1b57384 100644 --- a/src/fbuilder/build_profile.c +++ b/src/fbuilder/build_profile.c | |||
@@ -150,12 +150,12 @@ void build_profile(int argc, char **argv, int index, FILE *fp) { | |||
150 | 150 | ||
151 | fprintf(fp, "### basic blacklisting\n"); | 151 | fprintf(fp, "### basic blacklisting\n"); |
152 | fprintf(fp, "include disable-common.inc\n"); | 152 | fprintf(fp, "include disable-common.inc\n"); |
153 | fprintf(fp, "# include disable-devel.inc\n"); | 153 | fprintf(fp, "#include disable-devel.inc\n"); |
154 | fprintf(fp, "# include disable-exec.inc\n"); | 154 | fprintf(fp, "#include disable-exec.inc\n"); |
155 | fprintf(fp, "# include disable-interpreters.inc\n"); | 155 | fprintf(fp, "#include disable-interpreters.inc\n"); |
156 | fprintf(fp, "include disable-passwdmgr.inc\n"); | 156 | fprintf(fp, "include disable-passwdmgr.inc\n"); |
157 | fprintf(fp, "# include disable-programs.inc\n"); | 157 | fprintf(fp, "#include disable-programs.inc\n"); |
158 | fprintf(fp, "# include disable-xdg.inc\n"); | 158 | fprintf(fp, "#include disable-xdg.inc\n"); |
159 | fprintf(fp, "\n"); | 159 | fprintf(fp, "\n"); |
160 | 160 | ||
161 | fprintf(fp, "### home directory whitelisting\n"); | 161 | fprintf(fp, "### home directory whitelisting\n"); |
@@ -163,18 +163,17 @@ void build_profile(int argc, char **argv, int index, FILE *fp) { | |||
163 | fprintf(fp, "\n"); | 163 | fprintf(fp, "\n"); |
164 | 164 | ||
165 | fprintf(fp, "### filesystem\n"); | 165 | fprintf(fp, "### filesystem\n"); |
166 | fprintf(fp, "# /usr/share:\n"); | 166 | fprintf(fp, "### /usr/share:\n"); |
167 | build_share(trace_output, fp); | 167 | build_share(trace_output, fp); |
168 | fprintf(fp, "# /var:\n"); | 168 | fprintf(fp, "### /var:\n"); |
169 | build_var(trace_output, fp); | 169 | build_var(trace_output, fp); |
170 | fprintf(fp, "\n"); | 170 | fprintf(fp, "### /bin:\n"); |
171 | fprintf(fp, "# $PATH:\n"); | ||
172 | build_bin(trace_output, fp); | 171 | build_bin(trace_output, fp); |
173 | fprintf(fp, "# /dev:\n"); | 172 | fprintf(fp, "### /dev:\n"); |
174 | build_dev(trace_output, fp); | 173 | build_dev(trace_output, fp); |
175 | fprintf(fp, "# /etc:\n"); | 174 | fprintf(fp, "### /etc:\n"); |
176 | build_etc(trace_output, fp); | 175 | build_etc(trace_output, fp); |
177 | fprintf(fp, "# /tmp:\n"); | 176 | fprintf(fp, "### /tmp:\n"); |
178 | build_tmp(trace_output, fp); | 177 | build_tmp(trace_output, fp); |
179 | fprintf(fp, "\n"); | 178 | fprintf(fp, "\n"); |
180 | 179 | ||
diff --git a/src/man/firejail-profile.txt b/src/man/firejail-profile.txt index ee685da73..2bb57cee2 100644 --- a/src/man/firejail-profile.txt +++ b/src/man/firejail-profile.txt | |||
@@ -295,7 +295,9 @@ Use the options no3d, nodvd, nosound, notv, nou2f and novideo for additional res | |||
295 | Build a new /etc in a temporary | 295 | Build a new /etc in a temporary |
296 | filesystem, and copy the files and directories in the list. | 296 | filesystem, and copy the files and directories in the list. |
297 | The files and directories in the list must be expressed as relative to | 297 | The files and directories in the list must be expressed as relative to |
298 | the /etc directory. | 298 | the /etc directory, and must not contain the / character |
299 | (e.g., /etc/foo must be expressed as foo, but /etc/foo/bar -- | ||
300 | expressed as foo/bar -- is disallowed). | ||
299 | All modifications are discarded when the sandbox is closed. | 301 | All modifications are discarded when the sandbox is closed. |
300 | #ifdef HAVE_PRIVATE_HOME | 302 | #ifdef HAVE_PRIVATE_HOME |
301 | .TP | 303 | .TP |
@@ -319,14 +321,18 @@ This feature is still under development, see \fBman 1 firejail\fR for some examp | |||
319 | Build a new /opt in a temporary | 321 | Build a new /opt in a temporary |
320 | filesystem, and copy the files and directories in the list. | 322 | filesystem, and copy the files and directories in the list. |
321 | The files and directories in the list must be expressed as relative to | 323 | The files and directories in the list must be expressed as relative to |
322 | the /opt directory. | 324 | the /opt directory, and must not contain the / character |
325 | (e.g., /opt/foo must be expressed as foo, but /opt/foo/bar -- | ||
326 | expressed as foo/bar -- is disallowed). | ||
323 | All modifications are discarded when the sandbox is closed. | 327 | All modifications are discarded when the sandbox is closed. |
324 | .TP | 328 | .TP |
325 | \fBprivate-srv file,directory | 329 | \fBprivate-srv file,directory |
326 | Build a new /srv in a temporary | 330 | Build a new /srv in a temporary |
327 | filesystem, and copy the files and directories in the list. | 331 | filesystem, and copy the files and directories in the list. |
328 | The files and directories in the list must be expressed as relative to | 332 | The files and directories in the list must be expressed as relative to |
329 | the /srv directory. | 333 | the /srv directory, and must not contain the / character |
334 | (e.g., /srv/foo must be expressed as foo, but /srv/foo/bar -- | ||
335 | expressed as foo/bar -- is disallowed). | ||
330 | All modifications are discarded when the sandbox is closed. | 336 | All modifications are discarded when the sandbox is closed. |
331 | .TP | 337 | .TP |
332 | \fBprivate-tmp | 338 | \fBprivate-tmp |
diff --git a/src/man/firejail.txt b/src/man/firejail.txt index f27379a2d..1ee7ab1f1 100644 --- a/src/man/firejail.txt +++ b/src/man/firejail.txt | |||
@@ -1883,7 +1883,9 @@ $ | |||
1883 | Build a new /etc in a temporary | 1883 | Build a new /etc in a temporary |
1884 | filesystem, and copy the files and directories in the list. | 1884 | filesystem, and copy the files and directories in the list. |
1885 | The files and directories in the list must be expressed as relative to | 1885 | The files and directories in the list must be expressed as relative to |
1886 | the /etc directory. | 1886 | the /etc directory, and must not contain the / character |
1887 | (e.g., /etc/foo must be expressed as foo, but /etc/foo/bar -- | ||
1888 | expressed as foo/bar -- is disallowed). | ||
1887 | If no listed file is found, /etc directory will be empty. | 1889 | If no listed file is found, /etc directory will be empty. |
1888 | All modifications are discarded when the sandbox is closed. | 1890 | All modifications are discarded when the sandbox is closed. |
1889 | .br | 1891 | .br |
@@ -1893,7 +1895,7 @@ Example: | |||
1893 | .br | 1895 | .br |
1894 | $ firejail --private-etc=group,hostname,localtime, \\ | 1896 | $ firejail --private-etc=group,hostname,localtime, \\ |
1895 | .br | 1897 | .br |
1896 | nsswitch.conf,passwd,resolv.conf,default/motd-news | 1898 | nsswitch.conf,passwd,resolv.conf |
1897 | #ifdef HAVE_PRIVATE_HOME | 1899 | #ifdef HAVE_PRIVATE_HOME |
1898 | .TP | 1900 | .TP |
1899 | \fB\-\-private-home=file,directory | 1901 | \fB\-\-private-home=file,directory |
@@ -1968,7 +1970,9 @@ $ | |||
1968 | Build a new /opt in a temporary | 1970 | Build a new /opt in a temporary |
1969 | filesystem, and copy the files and directories in the list. | 1971 | filesystem, and copy the files and directories in the list. |
1970 | The files and directories in the list must be expressed as relative to | 1972 | The files and directories in the list must be expressed as relative to |
1971 | the /opt directory. | 1973 | the /opt directory, and must not contain the / character |
1974 | (e.g., /opt/foo must be expressed as foo, but /opt/foo/bar -- | ||
1975 | expressed as foo/bar -- is disallowed). | ||
1972 | If no listed file is found, /opt directory will be empty. | 1976 | If no listed file is found, /opt directory will be empty. |
1973 | All modifications are discarded when the sandbox is closed. | 1977 | All modifications are discarded when the sandbox is closed. |
1974 | .br | 1978 | .br |
@@ -1983,7 +1987,9 @@ $ firejail --private-opt=firefox /opt/firefox/firefox | |||
1983 | Build a new /srv in a temporary | 1987 | Build a new /srv in a temporary |
1984 | filesystem, and copy the files and directories in the list. | 1988 | filesystem, and copy the files and directories in the list. |
1985 | The files and directories in the list must be expressed as relative to | 1989 | The files and directories in the list must be expressed as relative to |
1986 | the /srv directory. | 1990 | the /srv directory, and must not contain the / character |
1991 | (e.g., /opt/srv must be expressed as foo, but /srv/foo/bar -- | ||
1992 | expressed as srv/bar -- is disallowed). | ||
1987 | If no listed file is found, /srv directory will be empty. | 1993 | If no listed file is found, /srv directory will be empty. |
1988 | All modifications are discarded when the sandbox is closed. | 1994 | All modifications are discarded when the sandbox is closed. |
1989 | .br | 1995 | .br |