Phockup link apparmor denied


Hi there –

I’m getting an apparmor denied message on creating a hard link with the phockup snap.

dpb@helo:photos[]$ phockup flat by-date -l
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Using link strategy
flat/0000045044bbf7c64cf63da99915dbd4f12fb449.jpgTraceback (most recent call last):
  File "/snap/phockup/204/lib/phockup/", line 88, in <module>
  File "/snap/phockup/204/lib/phockup/", line 82, in main
  File "/snap/phockup/204/lib/phockup/src/", line 36, in __init__
  File "/snap/phockup/204/lib/phockup/src/", line 67, in walk_directory
  File "/snap/phockup/204/lib/phockup/src/", line 162, in process_file, target_file)
PermissionError: [Errno 13] Permission denied: 'flat/0000045044bbf7c64cf63da99915dbd4f12fb449.jpg' -> 'by-date/2017/02/20/20170220-104325359.jpg'

Mar 30 22:45:21 helo kernel: [97429.187072] audit: type=1400 audit(1554007521.925:4845): apparmor="DENIED" operation="link" profile="snap.phockup.phockup" name="/media/photos/by-date/2017/02/20/20170220-104325359.jpg" pid=13701 comm="python3" requested_mask="l" denied_mask="l" fsuid=1000 ouid=1000 target="/media/photos/flat/0000045044bbf7c64cf63da99915dbd4f12fb449.jpg"

Any suggestions?


The removable-media interface does not currently allow hardlinking in /media. I’ve added a TODO to investigate this for 2.39.