Makemkv tries to open a file in $SNAP with mask 'c'

I’m working through an issue where MakeMKV is using failsafe defaults because it cannot open its file at $SNAP/usr/share/MakeMKV/appdata.tar with flags c (at least I think that’s where the issue is stemming from):

= AppArmor =
Time: Jan 15 15:15:44
Log: apparmor="DENIED" operation="open" profile="snap.makemkv.makemkv" name="/snap/makemkv/x5/usr/share/MakeMKV/appdata.tar" pid=92745 comm="makemkvcon.real" requested_mask="c" denied_mask="c" fsuid=1000 ouid=0
File: /snap/makemkv/x5/usr/share/MakeMKV/appdata.tar (write)
* adjust program to not write to $SNAP

This is unfortunately a semi-closed-source application so I may not be able to edit the code to prevent it trying to open with the flag c. Advice?

super-gross sledgehammer:

snapcraft-preload to intercept the write() function to redirect when trying to write this particular file ?

1 Like

It’s super weird to write to /usr/share but I would have the following-advice. Use a layout for to bind-file $SNAP/usr/share/MakeMKV/appdata.tar to $SNAP_DATA/appdata.tar.

You would also have to ship the vanilla appdata.tar somewhere in the snap and use the install-hook to copy it to $SNAP_DATA

On a non-snap install the files are root-owned and mode 644 so MakeMKV cannot write to them in the normal case. It’s unclear why it’s requesting write access when the likelihood is it won’t be able to write in a normal installation.

Maybe it’s doing the trial 30 day thing check?

1 Like