aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-03-11 10:33:56 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-03-11 10:33:56 -0500
commit3c284e4029eb98472a7e5b53f21ec5394a97285a (patch)
treee63f84d623c860d262a49432133ca661443a1b71
parenttesting (diff)
downloadfirejail-3c284e4029eb98472a7e5b53f21ec5394a97285a.tar.gz
firejail-3c284e4029eb98472a7e5b53f21ec5394a97285a.tar.zst
firejail-3c284e4029eb98472a7e5b53f21ec5394a97285a.zip
file transfer feature
-rw-r--r--README.md39
-rw-r--r--src/firejail/ls.c1
-rw-r--r--src/firejail/usage.c3
-rw-r--r--src/man/firejail.txt61
4 files changed, 103 insertions, 1 deletions
diff --git a/README.md b/README.md
index ac436cd8e..c62121b38 100644
--- a/README.md
+++ b/README.md
@@ -50,6 +50,45 @@ $ firejail --x11 --net=eth0 firefox
50--x11 starts the server, --net is required in order to remove the main X11 server socket from the sandbox. 50--x11 starts the server, --net is required in order to remove the main X11 server socket from the sandbox.
51More information here: https://firejail.wordpress.com/documentation-2/x11-guide/ 51More information here: https://firejail.wordpress.com/documentation-2/x11-guide/
52 52
53## File transfers
54`````
55FILE TRANSFERS
56 These features allow the user to inspect the file system container of
57 an existing sandbox and transfer files from the container to the host
58 file system.
59
60 --get=name filename
61 Retrieve the container file filename and store it on the host in
62 the current working directory. The container is spececified by
63 name (--name option). Full path is needed for filename.
64
65 --get=pid filename
66 Retrieve the container file filename and store it on the host in
67 the current working directory. The container is spececified by
68 process ID. Full path is needed for filename.
69
70 --ls=name dir_or_filename
71 List container files. The container is spececified by name
72 (--name option). Full path is needed for dir_or_filename.
73
74 --ls=pid dir_or_filename
75 List container files. The container is spececified by process
76 ID. Full path is needed for dir_or_filename.
77
78 Examples:
79
80 $ firejail --ls=mybrowser ~/Downloads
81 drwxr-xr-x netblue netblue 4096 .
82 drwxr-xr-x netblue netblue 4096 ..
83 -rw-r--r-- netblue netblue 7847 x11-x305.png
84 -rw-r--r-- netblue netblue 6800 x11-x642.png
85 -rw-r--r-- netblue netblue 34139 xpra-clipboard.png
86
87 $ firejail --get=mybrowser ~/Downloads/xpra-clipboard.png
88
89
90`````
91
53## Default seccomp filter update 92## Default seccomp filter update
54 93
55Currently 50 syscalls are blacklisted by default, out of a total of 318 calls (AMD64, Debian Jessie). 94Currently 50 syscalls are blacklisted by default, out of a total of 318 calls (AMD64, Debian Jessie).
diff --git a/src/firejail/ls.c b/src/firejail/ls.c
index 928da81c1..983927cf1 100644
--- a/src/firejail/ls.c
+++ b/src/firejail/ls.c
@@ -21,6 +21,7 @@
21#include "firejail.h" 21#include "firejail.h"
22#include <sys/types.h> 22#include <sys/types.h>
23#include <sys/stat.h> 23#include <sys/stat.h>
24#include <sys/wait.h>
24#include <unistd.h> 25#include <unistd.h>
25#include <dirent.h> 26#include <dirent.h>
26#include <pwd.h> 27#include <pwd.h>
diff --git a/src/firejail/usage.c b/src/firejail/usage.c
index 58f9d2cf7..7bc6ea47a 100644
--- a/src/firejail/usage.c
+++ b/src/firejail/usage.c
@@ -85,7 +85,7 @@ void usage(void) {
85 printf(" --env=name=value - set environment variable in the new sandbox.\n\n"); 85 printf(" --env=name=value - set environment variable in the new sandbox.\n\n");
86 printf(" --fs.print=name|pid - print the filesystem log for the sandbox identified\n"); 86 printf(" --fs.print=name|pid - print the filesystem log for the sandbox identified\n");
87 printf("\tby name or PID.\n\n"); 87 printf("\tby name or PID.\n\n");
88 88 printf(" --get=name|pid filename - get a file from sandbox container.\n\n");
89 printf(" --help, -? - this help screen.\n\n"); 89 printf(" --help, -? - this help screen.\n\n");
90 printf(" --hostname=name - set sandbox hostname.\n\n"); 90 printf(" --hostname=name - set sandbox hostname.\n\n");
91 printf(" --ignore=command - ignore command in profile files.\n\n"); 91 printf(" --ignore=command - ignore command in profile files.\n\n");
@@ -110,6 +110,7 @@ void usage(void) {
110 printf("\tidentified by name or PID.\n\n"); 110 printf("\tidentified by name or PID.\n\n");
111#endif 111#endif
112 printf(" --list - list all sandboxes.\n\n"); 112 printf(" --list - list all sandboxes.\n\n");
113 printf(" --ls=name|pid dir_or_filename - list files in sandbox container.\n\n");
113#ifdef HAVE_NETWORK 114#ifdef HAVE_NETWORK
114 printf(" --mac=xx:xx:xx:xx:xx:xx - set interface MAC address.\n\n"); 115 printf(" --mac=xx:xx:xx:xx:xx:xx - set interface MAC address.\n\n");
115 printf(" --mtu=number - set interface MTU.\n\n"); 116 printf(" --mtu=number - set interface MTU.\n\n");
diff --git a/src/man/firejail.txt b/src/man/firejail.txt
index 56a768614..a53d2d14e 100644
--- a/src/man/firejail.txt
+++ b/src/man/firejail.txt
@@ -8,6 +8,12 @@ Start a sandbox:
8firejail [OPTIONS] [program and arguments] 8firejail [OPTIONS] [program and arguments]
9.RE 9.RE
10.PP 10.PP
11File transfer from an existing sandbox
12.PP
13.RS
14firejail {\-\-ls | \-\-get} dir_or_filename
15.RE
16.PP
11Network traffic shaping for an existing sandbox: 17Network traffic shaping for an existing sandbox:
12.PP 18.PP
13.RS 19.RS
@@ -392,6 +398,9 @@ $ firejail \-\-list
392.br 398.br
393$ firejail \-\-fs.print=3272 399$ firejail \-\-fs.print=3272
394 400
401.TP
402\fB\-\-get=name|pid filename
403Get a file from sandbox container, see \fBFILE TRANSFER\fR section for more details.
395 404
396.TP 405.TP
397\fB\-?\fR, \fB\-\-help\fR 406\fB\-?\fR, \fB\-\-help\fR
@@ -549,7 +558,11 @@ Security filters, cgroups and cpus configurations are not applied to the process
549 558
550 559
551 560
561.TP
562\fB\-\-ls=name|pid dir_or_filename
563List files in sandbox container, see \fBFILE TRANSFER\fR section for more details.
552 564
565\fB
553 566
554.TP 567.TP
555\fB\-\-list 568\fB\-\-list
@@ -1521,6 +1534,54 @@ Example:
1521.br 1534.br
1522$ firejail \-\-zsh 1535$ firejail \-\-zsh
1523 1536
1537.SH FILE TRANSFER
1538These features allow the user to inspect the file system container of an existing sandbox
1539and transfer files from the container to the host file system.
1540
1541.TP
1542\fB\-\-get=name filename
1543Retrieve the container file filename and store it on the host in the current working directory.
1544The container is spececified by name (\-\-name option). Full path is needed for filename.
1545
1546.TP
1547\fB\-\-get=pid filename
1548Retrieve the container file filename and store it on the host in the current working directory.
1549The container is spececified by process ID. Full path is needed for filename.
1550
1551.TP
1552\fB\-\-ls=name dir_or_filename
1553List container files.
1554The container is spececified by name (\-\-name option).
1555Full path is needed for dir_or_filename.
1556
1557.TP
1558\fB\-\-ls=pid dir_or_filename
1559List container files.
1560The container is spececified by process ID.
1561Full path is needed for dir_or_filename.
1562
1563.TP
1564Examples:
1565.br
1566
1567.br
1568$ firejail \-\-ls=mybrowser ~/Downloads
1569.br
1570drwxr-xr-x netblue netblue 4096 .
1571.br
1572drwxr-xr-x netblue netblue 4096 ..
1573.br
1574-rw-r--r-- netblue netblue 7847 x11-x305.png
1575.br
1576-rw-r--r-- netblue netblue 6800 x11-x642.png
1577.br
1578-rw-r--r-- netblue netblue 34139 xpra-clipboard.png
1579.br
1580
1581.br
1582$ firejail \-\-get=mybrowser ~/Downloads/xpra-clipboard.png
1583
1584
1524.SH TRAFFIC SHAPING 1585.SH TRAFFIC SHAPING
1525Network bandwidth is an expensive resource shared among all sandboxes running on a system. 1586Network bandwidth is an expensive resource shared among all sandboxes running on a system.
1526Traffic shaping allows the user to increase network performance by controlling 1587Traffic shaping allows the user to increase network performance by controlling