Public bug reported:

The systemd service installed with the Ubuntu znc package in the default
configuration (
https://git.launchpad.net/ubuntu/+source/znc/tree/debian/znc.service?h=applied/ubuntu/resolute
) sets ZNC's data directory to /var/lib/znc, and starts ZNC as the _znc
user. In the postinstall script (
https://git.launchpad.net/ubuntu/+source/znc/tree/debian/znc.postinst?h=applied/ubuntu/resolute
), the _znc user is given /var/lib/znc as its home directory. The
upshot, thus, is that ZNC's data directory ends up equal to its $HOME.

However, the apparmor profile for ZNC here marks only $HOME/.znc/* as
allowed (which is the path that ZNC uses by default when not instructed
otherwise) not $HOME/*. This makes some sense from a security
perspective, but it means that `systemctl start znc` fails to start ZNC
on Resolute because the apparmor profile denies it access to everything
it needs, including its config file (at <datadir>/configs/znc.conf),
which makes ZNC bail out.

Duplicating all the $HOME/.znc/* rules also for $HOME/* in the apparmor
profile makes things work, as would changing the systemd service, but
neither is ideal.

I would caution against changing the default data directory in the
systemd file of the znc package, as this may result in very surprising
situations for some users if they upgrade and znc can suddenly not find
its files, and thus I would suggest making the apparmor profile more
permissive -- hence me putting the bug report here.

** Affects: apparmor (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2175533

Title:
  ZNC profile incompatible with znc package's systemd unit

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2175533/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to