diff options
author | netblue30 <netblue30@yahoo.com> | 2017-01-04 08:34:16 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2017-01-04 08:34:16 -0500 |
commit | ceaee7d23c9650ccb4d88e3d07c42a3443b75839 (patch) | |
tree | 70a26f27c7c3337ecb71c289ee0847086b5a8048 | |
parent | allow non-seccomp setup for OverlayFS sandboxes (diff) | |
download | firejail-ceaee7d23c9650ccb4d88e3d07c42a3443b75839.tar.gz firejail-ceaee7d23c9650ccb4d88e3d07c42a3443b75839.tar.zst firejail-ceaee7d23c9650ccb4d88e3d07c42a3443b75839.zip |
3 new Python scripts in contrib section
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | RELNOTES | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | contrib/fix_private-bin.py (renamed from contrib/fix_private-bin_for_symlinked_sh.py) | 0 | ||||
-rwxr-xr-x | contrib/fjclip.py | 35 | ||||
-rwxr-xr-x | contrib/fjdisplay.py | 43 | ||||
-rwxr-xr-x | contrib/fjresize.py | 25 |
6 files changed, 107 insertions, 1 deletions
@@ -97,6 +97,8 @@ valoq (https://github.com/valoq) | |||
97 | - added skanlite, ssh-agent, transmission-cli, tracker, transmission-show, w3m, xfburn, xpra profiles | 97 | - added skanlite, ssh-agent, transmission-cli, tracker, transmission-show, w3m, xfburn, xpra profiles |
98 | - added wget profile | 98 | - added wget profile |
99 | - disable gnupg and systemd directories under /run/user | 99 | - disable gnupg and systemd directories under /run/user |
100 | Pixel Fairy (https://github.com/xahare) | ||
101 | - added fjclip.py, fjdisplay.py and fjresize.py in contrib section | ||
100 | pshpsh (https://github.com/pshpsh) | 102 | pshpsh (https://github.com/pshpsh) |
101 | - added FossaMail profile | 103 | - added FossaMail profile |
102 | eventyrer (https://github.com/eventyrer) | 104 | eventyrer (https://github.com/eventyrer) |
@@ -109,7 +111,7 @@ SYN-cook (https://github.com/SYN-cook) | |||
109 | thewisenerd (https://github.com/thewisenerd) | 111 | thewisenerd (https://github.com/thewisenerd) |
110 | - appimage: pass commandline arguments | 112 | - appimage: pass commandline arguments |
111 | KOLANICH (https://github.com/KOLANICH) | 113 | KOLANICH (https://github.com/KOLANICH) |
112 | - added symlink fixer | 114 | - added symlink fixer fix_private-bin.py in contrib section |
113 | Jesse Smith (https://github.com/slicer69) | 115 | Jesse Smith (https://github.com/slicer69) |
114 | - added QupZilla profile | 116 | - added QupZilla profile |
115 | Lari Rauno (https://github.com/tuutti) | 117 | Lari Rauno (https://github.com/tuutti) |
@@ -17,6 +17,7 @@ firejail (0.9.45) baseline; urgency=low | |||
17 | * feature: pass command line arguments to appimages | 17 | * feature: pass command line arguments to appimages |
18 | * feature: --allow-private-blacklist option | 18 | * feature: --allow-private-blacklist option |
19 | * feature: allow non-seccomp setup for OverlayFS sandboxes | 19 | * feature: allow non-seccomp setup for OverlayFS sandboxes |
20 | * feature: added a number o Python scripts for handling sandboxes | ||
20 | * new profiles: xiphos, Tor Browser Bundle, display (imagemagik), Wire, | 21 | * new profiles: xiphos, Tor Browser Bundle, display (imagemagik), Wire, |
21 | * new profiles: mumble, zoom, Guayadeque, qemu, keypass2, xed, pluma, | 22 | * new profiles: mumble, zoom, Guayadeque, qemu, keypass2, xed, pluma, |
22 | * new profiles: Cryptocat, Bless, Gnome 2048, Gnome Calculator, | 23 | * new profiles: Cryptocat, Bless, Gnome 2048, Gnome Calculator, |
diff --git a/contrib/fix_private-bin_for_symlinked_sh.py b/contrib/fix_private-bin.py index 705e46e46..705e46e46 100644..100755 --- a/contrib/fix_private-bin_for_symlinked_sh.py +++ b/contrib/fix_private-bin.py | |||
diff --git a/contrib/fjclip.py b/contrib/fjclip.py new file mode 100755 index 000000000..cd12cd289 --- /dev/null +++ b/contrib/fjclip.py | |||
@@ -0,0 +1,35 @@ | |||
1 | #!/usr/bin/env python | ||
2 | |||
3 | import re | ||
4 | import sys | ||
5 | import subprocess | ||
6 | import fjdisplay | ||
7 | |||
8 | usage = """fjclip.py src dest. src or dest can be named firejails or - for stdin or stdout. | ||
9 | firemon --x11 to see available running x11 firejails. firejail names can be shortened | ||
10 | to least ambiguous. for example 'work-libreoffice' can be shortened to 'work' if no | ||
11 | other firejails name starts with 'work'. | ||
12 | warning: browsers are dangerous. clipboards from browsers are dangerous. see | ||
13 | https://github.com/dxa4481/Pastejacking | ||
14 | fjclip.py strips whitespace from both | ||
15 | ends, but does nothing else to protect you. use a simple gui text editor like | ||
16 | gedit if you want to see what your pasting.""" | ||
17 | |||
18 | if len(sys.argv) != 3 or sys.argv == '-h' or sys.argv == '--help': | ||
19 | print(usage) | ||
20 | exit(1) | ||
21 | |||
22 | if sys.argv[1] == '-': | ||
23 | clipin_raw = sys.stdin.read() | ||
24 | else: | ||
25 | display = fjdisplay.getdisplay(sys.argv[1]) | ||
26 | clipin_raw = subprocess.check_output(['xsel','-b','--display',display]) | ||
27 | |||
28 | clipin = clipin_raw.strip() | ||
29 | |||
30 | if sys.argv[2] == '-': | ||
31 | print(clipin) | ||
32 | else: | ||
33 | display = fjdisplay.getdisplay(sys.argv[2]) | ||
34 | clipout = subprocess.Popen(['xsel','-b','-i','--display',display],stdin=subprocess.PIPE) | ||
35 | clipout.communicate(clipin) \ No newline at end of file | ||
diff --git a/contrib/fjdisplay.py b/contrib/fjdisplay.py new file mode 100755 index 000000000..0e0ef01ec --- /dev/null +++ b/contrib/fjdisplay.py | |||
@@ -0,0 +1,43 @@ | |||
1 | #!/usr/bin/env python | ||
2 | |||
3 | import re | ||
4 | import sys | ||
5 | import subprocess | ||
6 | |||
7 | usage = """fjdisplay.py name-of-firejail | ||
8 | returns the display in the form of ':NNN' | ||
9 | """ | ||
10 | |||
11 | def getfirejails(): | ||
12 | output = subprocess.check_output(['firemon','--x11']) | ||
13 | firejails = {} | ||
14 | name = '' | ||
15 | for line in output.split('\n'): | ||
16 | namematch = re.search('--name=(\w+\S*)',line) | ||
17 | if namematch: | ||
18 | name = namematch.group(1) | ||
19 | displaymatch = re.search('DISPLAY (:\d+)',line) | ||
20 | if displaymatch: | ||
21 | firejails[name] = displaymatch.group(1) | ||
22 | return firejails | ||
23 | |||
24 | def getdisplay(name): | ||
25 | firejails = getfirejails() | ||
26 | fjlist = '\n'.join(firejails.keys()) | ||
27 | namere = re.compile('^'+name+'.*', re.MULTILINE) | ||
28 | matchingjails = namere.findall(fjlist) | ||
29 | if len(matchingjails) == 1: | ||
30 | return firejails[matchingjails[0]] | ||
31 | if len(matchingjails) == 0: | ||
32 | raise NameError("firejail {} does not exist".format(name)) | ||
33 | else: | ||
34 | raise NameError("ambiguous firejail name") | ||
35 | |||
36 | if __name__ == '__main__': | ||
37 | if '-h' in sys.argv or '--help' in sys.argv or len(sys.argv) > 2: | ||
38 | print(usage) | ||
39 | exit() | ||
40 | if len(sys.argv) == 1: | ||
41 | print(getfirejails()) | ||
42 | if len(sys.argv) == 2: | ||
43 | print (getdisplay(sys.argv[1])) \ No newline at end of file | ||
diff --git a/contrib/fjresize.py b/contrib/fjresize.py new file mode 100755 index 000000000..52b289159 --- /dev/null +++ b/contrib/fjresize.py | |||
@@ -0,0 +1,25 @@ | |||
1 | #!/usr/bin/env python | ||
2 | |||
3 | import sys | ||
4 | import fjdisplay | ||
5 | import subprocess | ||
6 | |||
7 | usage = """usage: fjresize.py firejail-name displaysize | ||
8 | resize firejail xephyr windows. | ||
9 | fjdisplay.py with no other arguments will list running named firejails with displays. | ||
10 | fjresize.py with only a firejail name will list valid resolutions. | ||
11 | names can be shortend as long its unambiguous. | ||
12 | note: you may need to move the xephyr window for the resize to take effect | ||
13 | example: | ||
14 | fjresize.py browser 1280x800 | ||
15 | """ | ||
16 | |||
17 | |||
18 | if len(sys.argv) == 2: | ||
19 | out = subprocess.check_output(['xrandr','--display',fjdisplay.getdisplay(sys.argv[1])]) | ||
20 | print(out) | ||
21 | elif len(sys.argv) == 3: | ||
22 | out = subprocess.check_output(['xrandr','--display',fjdisplay.getdisplay(sys.argv[1]),'--output','default','--mode',sys.argv[2]]) | ||
23 | print(out) | ||
24 | else: | ||
25 | print(usage) \ No newline at end of file | ||