# vim:syntax=apparmor # ------------------------------------------------------------------ # # Copyright (C) 2019-2021 Mikhail Morfikov # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License published by the Free Software Foundation. # # ------------------------------------------------------------------ abi , include @{exec_path} = /{usr/,}bin/gtk{,2,3}-youtube-viewer profile gtk-youtube-viewer @{exec_path} { include include include include include include include include include include network inet dgram, network inet6 dgram, network inet stream, network inet6 stream, network netlink raw, @{exec_path} r, /{usr/,}bin/perl r, /{usr/,}bin/{,ba,da}sh rix, /{usr/,}bin/xterm rCx -> xterm, /{usr/,}bin/rxvt rCx -> xterm, /{usr/,}bin/urxvt rCx -> xterm, # Players /{usr/,}bin/mpv rPx, /{usr/,}bin/vlc rPx, /{usr/,}bin/smplayer rPx, /{usr/,}lib/firefox/firefox rPx, /{usr/,}bin/xdg-open rCx -> open, /{usr/,}lib/@{multiarch}/glib-[0-9]*/gio-launch-desktop rCx -> open, owner @{HOME}/.config/youtube-viewer/{,*} rw, owner @{HOME}/.cache/ rw, owner @{HOME}/.cache/youtube-viewer/ rw, owner @{PROC}/@{pid}/fd/ r, owner @{PROC}/@{pid}/mounts r, profile xterm { include include include include include include include include signal (send) set=(hup, winch) peer=youtube-viewer, signal (send) set=(hup, winch) peer=youtube-viewer//wget, /{usr/,}bin/xterm mr, /{usr/,}bin/rxvt mr, /{usr/,}bin/urxvt mr, /{usr/,}bin/zsh rix, /{usr/,}bin/{,ba,da}sh rix, /{usr/,}bin/youtube-viewer rPx, owner @{PROC}/@{pid}/loginuid r, /etc/shells r, /etc/zsh/* r, /etc/X11/app-defaults/* r, /usr/include/X11/bitmaps/vlines2 r, owner @{HOME}/.urxvt/** r, owner @{HOME}/.Xauthority r, owner @{HOME}/.ICEauthority r, # file_inherit owner @{HOME}/.xsession-errors w, } profile open { include include /{usr/,}bin/xdg-open mr, /{usr/,}lib/@{multiarch}/glib-[0-9]*/gio-launch-desktop mr, /{usr/,}bin/{,ba,da}sh rix, /{usr/,}bin/gawk rix, /{usr/,}bin/readlink rix, /{usr/,}bin/basename rix, owner @{HOME}/ r, owner @{run}/user/[0-9]*/ r, # Allowed apps to open /{usr/,}lib/firefox/firefox rPUx, # file_inherit owner @{HOME}/.xsession-errors w, } include if exists }