# vim: ft=apparmor

abi <abi/3.0>,

#include <tunables/global>

/usr/bin/lessopen.sh {
  #include <abstractions/base>
  #include <abstractions/bash>
  #include <abstractions/consoles>
  #include <abstractions/perl>

  capability dac_override,
  capability dac_read_search,

  # workaround for https://bugzilla.opensuse.org/show_bug.cgi?id=1119937 / http://bugzilla.opensuse.org/show_bug.cgi?id=1190552 / https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1784499
  network inet dgram,
  network inet6 dgram,
  network inet stream,
  network inet6 stream,

  /** rk,
  /{usr/,}bin/bash mrix,
  /{usr/,}bin/rpm mrix,
  /{usr/,}bin/tar mrix,
  /tmp/less.* rw,
  /usr/bin/bzip2 mrix,
  /usr/bin/cabextract mrix,
  /usr/bin/cat mrix,
  /usr/bin/colordiff mrix,
  /usr/bin/dvi2tty mrix,
  /usr/bin/eqn mrix,
  /usr/bin/file mrix,
  /usr/bin/grep mrix,
  /usr/bin/groff mrix,
  /usr/bin/grotty mrix,
  /usr/bin/gzip mrix,
  /usr/bin/head mrix,
  /usr/bin/lynx mrix,
  /usr/bin/mktemp mrix,
  /usr/bin/nm mrix,
  /usr/bin/pic mrix,
  /usr/bin/pdftotext mrix,
  /usr/bin/ps2ascii mrix,
  /usr/bin/rm mrix,
  /usr/bin/seq mrix,
  /usr/bin/soelim mrix,
  /usr/bin/tar mrix,
  /usr/bin/tbl mrix,
  /usr/bin/troff mrix,
  /usr/bin/unzip mrix,
  /usr/bin/unzip-plain mrix,
  /usr/bin/w3m mrix,
  /usr/bin/which mrix,
  /usr/bin/xz mrix,

  include if exists <local/usr.bin.lessopen.sh>
}
