From 6ac40a597939989a55ab5465f548489e1ea4937d Mon Sep 17 00:00:00 2001 From: rusty-snake <41237666+rusty-snake@users.noreply.github.com> Date: Thu, 3 Sep 2020 10:17:52 +0200 Subject: 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 --- README.md | 2 +- RELNOTES | 5 +- etc/profile-a-l/gnome-builder.profile | 4 + etc/profile-a-l/gnome-passwordsafe.profile | 5 + etc/profile-m-z/supertuxkart.profile | 1 + etc/profile-m-z/totem.profile | 5 +- src/man/preproc.awk | 9 -- src/man/preproc.c | 166 ----------------------------- 8 files changed, 18 insertions(+), 179 deletions(-) delete mode 100644 src/man/preproc.c 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 penguin-command, x2goclient, frogatto, gnome-mines, gnome-nibbles, lightsoff, ts3client_runscript.sh, warmux, ferdi, abiword, four-in-a-row, gnome-mahjongg, gnome-robots, gnome-sudoku, gnome-taquin, gnome-tetravex, blobwars, gravity-beams-and-evaporating-stars, hyperrogue, jumpnbump-menu, jumpnbump, magicor, mindless, mirrormagic, mrrescue, scorched3d-wrapper, scorchwentbonkers, -seahorse-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 +seahorse-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 * new profiles: sushi, xfce4-screenshooter, org.gnome.NautilusPreviewer, lyx * new profiles: minitube, nuclear, mtpaint, minecraft-launcher, gnome-calendar * new profiles: vmware, git-cola, otter-browser, kazam, menulibre, musictube - * new profiles: onboard, fractal, mirage, quaternion, spectral, man, psi - * new profiles: smuxi-frontend-gnome + * new profiles: onboard, fractal, mirage, quaternion, spectral, man, psi, twitch + * new profiles: smuxi-frontend-gnome, balsa, kube, trojita, youtube, ytmdesktop + * new profiles: youtubemusic-nativefier, cola -- netblue30 Tue, 21 Apr 2020 08:00:00 -0500 firejail (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 # Persistent global definitions include globals.local +noblacklist ${HOME}/.bash_history + noblacklist ${HOME}/.cache/gnome-builder noblacklist ${HOME}/.config/gnome-builder noblacklist ${HOME}/.local/share/gnome-builder @@ -34,3 +36,5 @@ seccomp shell none private-dev + +read-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 private-dev private-etc dconf,fonts,gtk-3.0,passwd private-tmp + +dbus-user filter +dbus-user.own org.gnome.PasswordSafe +dbus-user.talk ca.desrt.dconf +dbus-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 whitelist ${HOME}/.local/share/supertuxkart whitelist /usr/share/supertuxkart include whitelist-common.inc +include whitelist-runuser-common.inc include whitelist-usr-share-common.inc include whitelist-var-common.inc 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} whitelist ${MUSIC} whitelist ${PICTURES} whitelist ${VIDEOS} +whitelist /usr/share/totem include whitelist-common.inc +include whitelist-runuser-common.inc +include whitelist-usr-share-common.inc include whitelist-var-common.inc # apparmor - makes settings immutable @@ -57,4 +60,4 @@ private-tmp # makes settings immutable # dbus-user none -# dbus-system none +dbus-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 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -function errexit(msg) { - print msg > "/dev/stderr" - exit 1 -} - BEGIN { macros[0] = 0 for (arg in ARGV) { if (ARGV[arg] ~ /^-D[A-Z_]+$/) { macros[length(macros) + 1] = substr(ARGV[arg], 3) - } else { - if (ARGV[arg] == "gawk" || ARGV[arg] == "awk") - continue -# errexit("Invalid commandline argument" ARGV[arg]) } ARGV[arg] = "" } 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 @@ -/* - * Copyright (C) 2014-2020 Firejail Authors - * - * This file is part of firejail project - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include -#include -#include -#include - -#define MAXBUF 4096 -#define MAXMACROS 64 -static char *macro[MAXMACROS] = {NULL}; - -static void add_macro(char *m) { - assert(m); - int i; - for (i = 0; i < MAXMACROS && macro[i]; i++); - if (i == MAXMACROS) { - fprintf(stderr, "Error: maximum number of marcros (%d) exceeded\n", MAXMACROS); - exit(1); - } - - macro[i] = m; -} - -static char *find_macro(char *m) { - assert(m); - int i = 0; - while (i < MAXMACROS && macro[i]) { - if (strcmp(macro[i], m) == 0) - return m; - i++; - } - - return NULL; -} - -static void usage(void) { - printf("Simple preprocessor for man pages. It supports:\n"); - printf("\t#if 0 ... #endif\n"); - printf("\t#ifdef macro ... #endif\n"); - printf("Usage: preproc [--help] [-Dmacro] manpage.txt\n"); - return; -} - - -int main(int argc, char **argv) { - if (argc == 1) { - fprintf(stderr, "Error: no files/arguments provided\n"); - usage(); - exit(1); - } - - int i; - for (i = 1; i < argc; i++) { - if (strncmp(argv[i], "-D", 2) == 0) - add_macro(argv[i] + 2); - else if (strcmp(argv[i], "--help") == 0) { - usage(); - return 0; - } - else if (*argv[i] == '-') { - fprintf(stderr, "Error: invalid argument %s\n", argv[i]); - exit(1); - } - else - break; - } - - char *ptr = strstr(argv[i], ".txt"); - if (!ptr || strlen(ptr) != 4) { - fprintf(stderr, "Error: input file needs to have a .txt extension\n"), - exit(1); - } - - FILE *fp = fopen(argv[i], "r"); - if (!fp) { - fprintf(stderr, "Error: cannot open %s\n", argv[i]); - exit(1); - } - char *outfile = strdup(argv[i]); - if (!outfile) - goto errout; - ptr = strstr(outfile, ".txt"); - assert(ptr); - strcpy(ptr, ".man"); - FILE *fpout = fopen(outfile, "w"); - if (!fpout) - goto errout; - - char buf[MAXBUF]; - int disabled = 0; - int enabled = 0; - int line = 0;; - while (fgets(buf, MAXBUF, fp)) { - line++; - if (disabled && strncmp(buf, "#if", 3) == 0) { - fprintf(stderr, "Error %d: already in a #if block on line %d\n", __LINE__, line); - exit(1); - } - if ((!disabled && !enabled) && strncmp(buf, "#endif", 6) == 0) { - fprintf(stderr, "Error %d: unmatched #endif on line %d\n", __LINE__, line); - exit(1); - } - - char *ptr = strchr(buf, '\n'); - if (ptr) - *ptr = '\0'; - - if (strncmp(buf, "#if 0", 5) == 0) { - disabled = 1; - continue; - } - if (strncmp(buf, "#ifdef", 6) == 0) { - char *ptr = buf + 6; - if (*ptr != ' ' && *ptr != '\t') { - fprintf(stderr, "Error %d: invalid macro on line %d\n", __LINE__, line); - exit(1); - } - - while (*ptr == ' ' || *ptr == '\t') - ptr++; - - if (!find_macro(ptr)) - disabled = 1; - else - enabled = 1; - continue; - } - - if (strncmp(buf, "#endif", 6) == 0) { - disabled = 0; - enabled = 1; - continue; - } - - if (!disabled) { -// printf("%s\n", buf); - fprintf(fpout, "%s\n", buf); - } - } - fclose(fp); - - return 0; - -errout: - fclose(fp); - fprintf(stderr, "Error: cannot open output file\n"); - exit(1); -} -- cgit v1.2.3-54-g00ecf