aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar rusty-snake <41237666+rusty-snake@users.noreply.github.com>2020-09-03 10:17:52 +0200
committerLibravatar rusty-snake <41237666+rusty-snake@users.noreply.github.com>2020-09-03 10:17:52 +0200
commit6ac40a597939989a55ab5465f548489e1ea4937d (patch)
treef198684f7427a0fccafe5b1e120a3db7db99b924
parentAdd profile for twitch,youtube,youtube-music; fix git-cola ,add cola (#3577) (diff)
downloadfirejail-6ac40a597939989a55ab5465f548489e1ea4937d.tar.gz
firejail-6ac40a597939989a55ab5465f548489e1ea4937d.tar.zst
firejail-6ac40a597939989a55ab5465f548489e1ea4937d.zip
various
* README.md & RELNOTES * Allow gnome-build do read and write .bash_history, it has a build-in terminal * D-Bus filter for gnome-passwordsafe * wruc for supertuxkart * wruc+wusc for totem * dbus-system none for totem * remove src/man/preproc.c it is replaced by preproc.awk * remove dead-code form preproc.awk
-rw-r--r--README.md2
-rw-r--r--RELNOTES5
-rw-r--r--etc/profile-a-l/gnome-builder.profile4
-rw-r--r--etc/profile-a-l/gnome-passwordsafe.profile5
-rw-r--r--etc/profile-m-z/supertuxkart.profile1
-rw-r--r--etc/profile-m-z/totem.profile5
-rwxr-xr-xsrc/man/preproc.awk9
-rw-r--r--src/man/preproc.c166
8 files changed, 18 insertions, 179 deletions
diff --git a/README.md b/README.md
index c3103f165..8d113bae8 100644
--- a/README.md
+++ b/README.md
@@ -196,4 +196,4 @@ gnome-screenshot, ripperX, sound-juicer, iagno, com.github.dahenson.agenda, gnom
196penguin-command, x2goclient, frogatto, gnome-mines, gnome-nibbles, lightsoff, ts3client_runscript.sh, warmux, ferdi, abiword, 196penguin-command, x2goclient, frogatto, gnome-mines, gnome-nibbles, lightsoff, ts3client_runscript.sh, warmux, ferdi, abiword,
197four-in-a-row, gnome-mahjongg, gnome-robots, gnome-sudoku, gnome-taquin, gnome-tetravex, blobwars, gravity-beams-and-evaporating-stars, 197four-in-a-row, gnome-mahjongg, gnome-robots, gnome-sudoku, gnome-taquin, gnome-tetravex, blobwars, gravity-beams-and-evaporating-stars,
198hyperrogue, jumpnbump-menu, jumpnbump, magicor, mindless, mirrormagic, mrrescue, scorched3d-wrapper, scorchwentbonkers, 198hyperrogue, jumpnbump-menu, jumpnbump, magicor, mindless, mirrormagic, mrrescue, scorched3d-wrapper, scorchwentbonkers,
199seahorse-adventures, wordwarvi, xbill, gnome-klotski, five-or-more, swell-foop, fdns, jitsi-meet-desktop, nicontine, steam-runtime, apostrophe, quadrapassel, dino-im, strawberry, hitori, bijiben, gnote, gnubik, ZeGrapher, gapplication, xonotic-sdl-wrapper, openarena_ded, cawbird, freetube, homebank, mattermost-desktop, newsflash, com.gitlab.newsflash, element-desktop, sushi, xfce4-screenshooter, org.gnome.NautilusPreviewer, lyx, minitube, nuclear, mtpaint, minecraft-launcher, gnome-calendar, vmware, git-cola, otter-browser, kazam, menulibre, musictube, onboard, fractal, mirage, quaternion, spectral, man, psi, smuxi-frontend-gnome 199seahorse-adventures, wordwarvi, xbill, gnome-klotski, five-or-more, swell-foop, fdns, jitsi-meet-desktop, nicontine, steam-runtime, apostrophe, quadrapassel, dino-im, strawberry, hitori, bijiben, gnote, gnubik, ZeGrapher, gapplication, xonotic-sdl-wrapper, openarena_ded, cawbird, freetube, homebank, mattermost-desktop, newsflash, com.gitlab.newsflash, element-desktop, sushi, xfce4-screenshooter, org.gnome.NautilusPreviewer, lyx, minitube, nuclear, mtpaint, minecraft-launcher, gnome-calendar, vmware, git-cola, otter-browser, kazam, menulibre, musictube, onboard, fractal, mirage, quaternion, spectral, man, psi, smuxi-frontend-gnome, balsa, kube, trojita, cola, twitch, youtube, youtubemusic-nativefier, ytmdesktop
diff --git a/RELNOTES b/RELNOTES
index e1a0c85cc..53c79e7ab 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -44,8 +44,9 @@ firejail (0.9.63) baseline; urgency=low
44 * new profiles: sushi, xfce4-screenshooter, org.gnome.NautilusPreviewer, lyx 44 * new profiles: sushi, xfce4-screenshooter, org.gnome.NautilusPreviewer, lyx
45 * new profiles: minitube, nuclear, mtpaint, minecraft-launcher, gnome-calendar 45 * new profiles: minitube, nuclear, mtpaint, minecraft-launcher, gnome-calendar
46 * new profiles: vmware, git-cola, otter-browser, kazam, menulibre, musictube 46 * new profiles: vmware, git-cola, otter-browser, kazam, menulibre, musictube
47 * new profiles: onboard, fractal, mirage, quaternion, spectral, man, psi 47 * new profiles: onboard, fractal, mirage, quaternion, spectral, man, psi, twitch
48 * new profiles: smuxi-frontend-gnome 48 * new profiles: smuxi-frontend-gnome, balsa, kube, trojita, youtube, ytmdesktop
49 * new profiles: youtubemusic-nativefier, cola
49 -- netblue30 <netblue30@yahoo.com> Tue, 21 Apr 2020 08:00:00 -0500 50 -- netblue30 <netblue30@yahoo.com> Tue, 21 Apr 2020 08:00:00 -0500
50 51
51firejail (0.9.62) baseline; urgency=low 52firejail (0.9.62) baseline; urgency=low
diff --git a/etc/profile-a-l/gnome-builder.profile b/etc/profile-a-l/gnome-builder.profile
index 7a684dd59..8f637902c 100644
--- a/etc/profile-a-l/gnome-builder.profile
+++ b/etc/profile-a-l/gnome-builder.profile
@@ -6,6 +6,8 @@ include gnome-builder.local
6# Persistent global definitions 6# Persistent global definitions
7include globals.local 7include globals.local
8 8
9noblacklist ${HOME}/.bash_history
10
9noblacklist ${HOME}/.cache/gnome-builder 11noblacklist ${HOME}/.cache/gnome-builder
10noblacklist ${HOME}/.config/gnome-builder 12noblacklist ${HOME}/.config/gnome-builder
11noblacklist ${HOME}/.local/share/gnome-builder 13noblacklist ${HOME}/.local/share/gnome-builder
@@ -34,3 +36,5 @@ seccomp
34shell none 36shell none
35 37
36private-dev 38private-dev
39
40read-write ${HOME}/.bash_history
diff --git a/etc/profile-a-l/gnome-passwordsafe.profile b/etc/profile-a-l/gnome-passwordsafe.profile
index 615be7873..ed430b654 100644
--- a/etc/profile-a-l/gnome-passwordsafe.profile
+++ b/etc/profile-a-l/gnome-passwordsafe.profile
@@ -52,3 +52,8 @@ private-cache
52private-dev 52private-dev
53private-etc dconf,fonts,gtk-3.0,passwd 53private-etc dconf,fonts,gtk-3.0,passwd
54private-tmp 54private-tmp
55
56dbus-user filter
57dbus-user.own org.gnome.PasswordSafe
58dbus-user.talk ca.desrt.dconf
59dbus-system none
diff --git a/etc/profile-m-z/supertuxkart.profile b/etc/profile-m-z/supertuxkart.profile
index ce69c8b4b..40b996794 100644
--- a/etc/profile-m-z/supertuxkart.profile
+++ b/etc/profile-m-z/supertuxkart.profile
@@ -27,6 +27,7 @@ whitelist ${HOME}/.cache/supertuxkart
27whitelist ${HOME}/.local/share/supertuxkart 27whitelist ${HOME}/.local/share/supertuxkart
28whitelist /usr/share/supertuxkart 28whitelist /usr/share/supertuxkart
29include whitelist-common.inc 29include whitelist-common.inc
30include whitelist-runuser-common.inc
30include whitelist-usr-share-common.inc 31include whitelist-usr-share-common.inc
31include whitelist-var-common.inc 32include whitelist-var-common.inc
32 33
diff --git a/etc/profile-m-z/totem.profile b/etc/profile-m-z/totem.profile
index abbbba6c3..341e9a777 100644
--- a/etc/profile-m-z/totem.profile
+++ b/etc/profile-m-z/totem.profile
@@ -33,7 +33,10 @@ whitelist ${DOWNLOADS}
33whitelist ${MUSIC} 33whitelist ${MUSIC}
34whitelist ${PICTURES} 34whitelist ${PICTURES}
35whitelist ${VIDEOS} 35whitelist ${VIDEOS}
36whitelist /usr/share/totem
36include whitelist-common.inc 37include whitelist-common.inc
38include whitelist-runuser-common.inc
39include whitelist-usr-share-common.inc
37include whitelist-var-common.inc 40include whitelist-var-common.inc
38 41
39# apparmor - makes settings immutable 42# apparmor - makes settings immutable
@@ -57,4 +60,4 @@ private-tmp
57 60
58# makes settings immutable 61# makes settings immutable
59# dbus-user none 62# dbus-user none
60# dbus-system none 63dbus-system none
diff --git a/src/man/preproc.awk b/src/man/preproc.awk
index d5cee8c44..20081b551 100755
--- a/src/man/preproc.awk
+++ b/src/man/preproc.awk
@@ -20,20 +20,11 @@
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21# SOFTWARE. 21# SOFTWARE.
22 22
23function errexit(msg) {
24 print msg > "/dev/stderr"
25 exit 1
26}
27
28BEGIN { 23BEGIN {
29 macros[0] = 0 24 macros[0] = 0
30 for (arg in ARGV) { 25 for (arg in ARGV) {
31 if (ARGV[arg] ~ /^-D[A-Z_]+$/) { 26 if (ARGV[arg] ~ /^-D[A-Z_]+$/) {
32 macros[length(macros) + 1] = substr(ARGV[arg], 3) 27 macros[length(macros) + 1] = substr(ARGV[arg], 3)
33 } else {
34 if (ARGV[arg] == "gawk" || ARGV[arg] == "awk")
35 continue
36# errexit("Invalid commandline argument" ARGV[arg])
37 } 28 }
38 ARGV[arg] = "" 29 ARGV[arg] = ""
39 } 30 }
diff --git a/src/man/preproc.c b/src/man/preproc.c
deleted file mode 100644
index eefa45278..000000000
--- a/src/man/preproc.c
+++ /dev/null
@@ -1,166 +0,0 @@
1/*
2 * Copyright (C) 2014-2020 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#include <stdio.h>
22#include <stdlib.h>
23#include <string.h>
24#include <assert.h>
25
26#define MAXBUF 4096
27#define MAXMACROS 64
28static char *macro[MAXMACROS] = {NULL};
29
30static void add_macro(char *m) {
31 assert(m);
32 int i;
33 for (i = 0; i < MAXMACROS && macro[i]; i++);
34 if (i == MAXMACROS) {
35 fprintf(stderr, "Error: maximum number of marcros (%d) exceeded\n", MAXMACROS);
36 exit(1);
37 }
38
39 macro[i] = m;
40}
41
42static char *find_macro(char *m) {
43 assert(m);
44 int i = 0;
45 while (i < MAXMACROS && macro[i]) {
46 if (strcmp(macro[i], m) == 0)
47 return m;
48 i++;
49 }
50
51 return NULL;
52}
53
54static void usage(void) {
55 printf("Simple preprocessor for man pages. It supports:\n");
56 printf("\t#if 0 ... #endif\n");
57 printf("\t#ifdef macro ... #endif\n");
58 printf("Usage: preproc [--help] [-Dmacro] manpage.txt\n");
59 return;
60}
61
62
63int main(int argc, char **argv) {
64 if (argc == 1) {
65 fprintf(stderr, "Error: no files/arguments provided\n");
66 usage();
67 exit(1);
68 }
69
70 int i;
71 for (i = 1; i < argc; i++) {
72 if (strncmp(argv[i], "-D", 2) == 0)
73 add_macro(argv[i] + 2);
74 else if (strcmp(argv[i], "--help") == 0) {
75 usage();
76 return 0;
77 }
78 else if (*argv[i] == '-') {
79 fprintf(stderr, "Error: invalid argument %s\n", argv[i]);
80 exit(1);
81 }
82 else
83 break;
84 }
85
86 char *ptr = strstr(argv[i], ".txt");
87 if (!ptr || strlen(ptr) != 4) {
88 fprintf(stderr, "Error: input file needs to have a .txt extension\n"),
89 exit(1);
90 }
91
92 FILE *fp = fopen(argv[i], "r");
93 if (!fp) {
94 fprintf(stderr, "Error: cannot open %s\n", argv[i]);
95 exit(1);
96 }
97 char *outfile = strdup(argv[i]);
98 if (!outfile)
99 goto errout;
100 ptr = strstr(outfile, ".txt");
101 assert(ptr);
102 strcpy(ptr, ".man");
103 FILE *fpout = fopen(outfile, "w");
104 if (!fpout)
105 goto errout;
106
107 char buf[MAXBUF];
108 int disabled = 0;
109 int enabled = 0;
110 int line = 0;;
111 while (fgets(buf, MAXBUF, fp)) {
112 line++;
113 if (disabled && strncmp(buf, "#if", 3) == 0) {
114 fprintf(stderr, "Error %d: already in a #if block on line %d\n", __LINE__, line);
115 exit(1);
116 }
117 if ((!disabled && !enabled) && strncmp(buf, "#endif", 6) == 0) {
118 fprintf(stderr, "Error %d: unmatched #endif on line %d\n", __LINE__, line);
119 exit(1);
120 }
121
122 char *ptr = strchr(buf, '\n');
123 if (ptr)
124 *ptr = '\0';
125
126 if (strncmp(buf, "#if 0", 5) == 0) {
127 disabled = 1;
128 continue;
129 }
130 if (strncmp(buf, "#ifdef", 6) == 0) {
131 char *ptr = buf + 6;
132 if (*ptr != ' ' && *ptr != '\t') {
133 fprintf(stderr, "Error %d: invalid macro on line %d\n", __LINE__, line);
134 exit(1);
135 }
136
137 while (*ptr == ' ' || *ptr == '\t')
138 ptr++;
139
140 if (!find_macro(ptr))
141 disabled = 1;
142 else
143 enabled = 1;
144 continue;
145 }
146
147 if (strncmp(buf, "#endif", 6) == 0) {
148 disabled = 0;
149 enabled = 1;
150 continue;
151 }
152
153 if (!disabled) {
154// printf("%s\n", buf);
155 fprintf(fpout, "%s\n", buf);
156 }
157 }
158 fclose(fp);
159
160 return 0;
161
162errout:
163 fclose(fp);
164 fprintf(stderr, "Error: cannot open output file\n");
165 exit(1);
166}