diff options
author | 2016-03-25 10:43:53 -0400 | |
---|---|---|
committer | 2016-03-25 10:43:53 -0400 | |
commit | 6ca44b90841224e740d464ea1b8107cae6f63d31 (patch) | |
tree | 8c58a69e49596b286d7baac0222d3eb5c464227a /src/firecfg | |
parent | added firecfg utility (diff) | |
download | firejail-6ca44b90841224e740d464ea1b8107cae6f63d31.tar.gz firejail-6ca44b90841224e740d464ea1b8107cae6f63d31.tar.zst firejail-6ca44b90841224e740d464ea1b8107cae6f63d31.zip |
firecfg utility
Diffstat (limited to 'src/firecfg')
-rw-r--r-- | src/firecfg/firecfg.config | 67 | ||||
-rw-r--r-- | src/firecfg/main.c | 26 |
2 files changed, 86 insertions, 7 deletions
diff --git a/src/firecfg/firecfg.config b/src/firecfg/firecfg.config index fb996966f..13bcc5110 100644 --- a/src/firecfg/firecfg.config +++ b/src/firecfg/firecfg.config | |||
@@ -1,7 +1,74 @@ | |||
1 | # /etc/firejail/firecfg.config - firecfg utility configuration file | 1 | # /etc/firejail/firecfg.config - firecfg utility configuration file |
2 | # This is the list of programs handled by firecfg utility | 2 | # This is the list of programs handled by firecfg utility |
3 | # | 3 | # |
4 | |||
5 | # browsers/email | ||
4 | firefox | 6 | firefox |
5 | iceweasel | 7 | iceweasel |
8 | chromium-browser | ||
9 | chromium | ||
10 | conkeror | ||
6 | thunderbird | 11 | thunderbird |
12 | epiphany | ||
13 | flashpeak-slimjet | ||
14 | google-chrome-beta | ||
15 | google-chrome-stable | ||
16 | google-chrome-unstable | ||
17 | google-chrome | ||
18 | icecat | ||
19 | icedove | ||
20 | kmail | ||
21 | midori | ||
22 | opera-beta | ||
23 | opera | ||
24 | qutebrowser | ||
25 | seamonkey | ||
26 | seamonkey-bin | ||
27 | vivaldi-beta | ||
28 | vivaldi | ||
29 | |||
30 | # bittorrent/ftp | ||
31 | deluge | ||
32 | filezilla | ||
33 | qbittorrent | ||
34 | rtorrent | ||
35 | tranmission-gtk | ||
36 | transmission-qt | ||
37 | |||
38 | # office | ||
39 | cherrytree | ||
40 | evince | ||
41 | fbreader | ||
42 | localc | ||
43 | lodraw | ||
44 | loffice | ||
45 | lofromtemplate | ||
46 | loimpress | ||
47 | lomath | ||
48 | loweb | ||
49 | lowriter | ||
50 | Mathematica | ||
51 | mathematica | ||
52 | |||
53 | # Media | ||
7 | vlc | 54 | vlc |
55 | audacious | ||
56 | clementine | ||
57 | deadbeef | ||
58 | parole | ||
59 | rhythmbox | ||
60 | totem | ||
61 | |||
62 | # chat/messaging | ||
63 | bitlbee | ||
64 | empathy | ||
65 | gnome-mplayer | ||
66 | hexchat | ||
67 | pidgin | ||
68 | qtox | ||
69 | quassel | ||
70 | xchat | ||
71 | |||
72 | # games | ||
73 | hedgewars | ||
74 | wesnot | ||
diff --git a/src/firecfg/main.c b/src/firecfg/main.c index 7465f2d3e..0c6b278b5 100644 --- a/src/firecfg/main.c +++ b/src/firecfg/main.c | |||
@@ -30,7 +30,7 @@ static void usage(void) { | |||
30 | printf("Firecfg is the desktop configuration utility for Firejail software. The utility\n"); | 30 | printf("Firecfg is the desktop configuration utility for Firejail software. The utility\n"); |
31 | printf("creates several symbolic links to firejail executable. This allows the user to\n"); | 31 | printf("creates several symbolic links to firejail executable. This allows the user to\n"); |
32 | printf("sandbox applications automatically, just by clicking on a regular desktop\n"); | 32 | printf("sandbox applications automatically, just by clicking on a regular desktop\n"); |
33 | printf("menues and icons.\n\n"); | 33 | printf("menus and icons.\n\n"); |
34 | printf("The symbolic links are placed in /usr/local/bin. For more information, see\n"); | 34 | printf("The symbolic links are placed in /usr/local/bin. For more information, see\n"); |
35 | printf("DESKTOP INTEGRATION section in man 1 firejail.\n\n"); | 35 | printf("DESKTOP INTEGRATION section in man 1 firejail.\n\n"); |
36 | printf("Usage: firecfg [OPTIONS]\n\n"); | 36 | printf("Usage: firecfg [OPTIONS]\n\n"); |
@@ -245,21 +245,33 @@ static void set(void) { | |||
245 | lineno++; | 245 | lineno++; |
246 | if (*buf == '#') // comments | 246 | if (*buf == '#') // comments |
247 | continue; | 247 | continue; |
248 | |||
249 | // do not accept .. and/or / in file name | ||
250 | if (strstr(buf, "..") || strchr(buf, '/')) { | ||
251 | fprintf(stderr, "Error: invalid line %d in %s\n", lineno, cfgfile); | ||
252 | exit(1); | ||
253 | } | ||
248 | 254 | ||
249 | // remove \n | 255 | // remove \n |
250 | char *ptr = strchr(buf, '\n'); | 256 | char *ptr = strchr(buf, '\n'); |
251 | if (ptr) | 257 | if (ptr) |
252 | *ptr = '\0'; | 258 | *ptr = '\0'; |
259 | |||
260 | // trim spaces | ||
261 | ptr = buf; | ||
262 | while (*ptr == ' ' || *ptr == '\t') | ||
263 | ptr++; | ||
264 | char *start = ptr; | ||
253 | 265 | ||
254 | // do not accept .. and/or / in file name | 266 | // empty line |
255 | if (strstr(buf, "..") || strchr(buf, '/')) { | 267 | if (*start == '\0') |
256 | fprintf(stderr, "Error: invalid line %d in %s\n", lineno, cfgfile); | 268 | continue; |
257 | exit(1); | ||
258 | } | ||
259 | 269 | ||
260 | set_file(buf, firejail_exec); | 270 | // set link |
271 | set_file(start, firejail_exec); | ||
261 | } | 272 | } |
262 | 273 | ||
274 | fclose(fp); | ||
263 | free(cfgfile); | 275 | free(cfgfile); |
264 | free(firejail_exec); | 276 | free(firejail_exec); |
265 | } | 277 | } |