I checked a few other packages quickly. It seems like evolution email client 
has no apparmor profile. Thunderbird mail client has an apparmor profile and 
the symlink works, but the apparmor profile seems to be including 
/etc/apparmor.d/abstractions/ubuntu-helpers which seems to provide symlink 
support, but also has security warnings.

I also tried following as described in the qtox documentation in 
/etc/apparmor.d/tunables/usr.bin.qtox.
"Create /etc/apparmor.d/tunables/usr.bin.qtox.d/local file to append values 
as..."

However, apparmor failed to load the new profile saying that variable 
"qtox_additional_rw_dirs" was already created. Changing 
/etc/apparmor.d/tunables/usr.bin.qtox partially worked, the profile was loaded, 
but all history was gone from qtox. I also was able to create a new profile, 
but all history was lost between sessions.

As a last resort, I tried a bind mount, and that works. The steps are below. I 
make the original directory chmod 000 when it is not yet bound to ensure that 
qtox doesn't write to it if ever the bind fails. However, a symlink would be 
better. There should be a way in the qtox code to open the symlink without 
de-referencing it, but I would have to look later. There is also probably a way 
to make the apparmor profile work for symlinks.

See "man realpath". realpath will resolve the symlink, but option -s will 
preserve the symlink in the path.

Bind mount alternative (user called user, thus ~/ is /home/user):
mkdir /test/
mv ~/.config/tox /test/
mkdir ~/.config/tox
chmod 000 ~/.config/tox
mount --bind /test/tox ~/.config/tox
umount ~/.config/tox

Make it automatic on startup (add the following to fstab)
nano /etc/fstab
/test/tox /home/user/.config/tox none defaults,bind 0 0

Reply via email to