1)  snapcraft.yaml for test-app
name: test2
version: "2"
summary: TEst
description: |
     TEST
confinement: strict
architectures: [amd64]

apps:
   test2:
     command: xdg-open "http://google.com/";
     plugs: [network, network-bind, x11, home, unity7, gsettings]

parts:
   snapd-xdg-open:
     source: https://github.com/ubuntu-core/snapd-xdg-open.git
     plugin: copy
     files:
       data/xdg-open: bin/xdg-open

2) prime/bin/xdg-open

#!/bin/sh
dbus-send --print-reply --session --dest=com.canonical.SafeLauncher / com.canonical.SafeLauncher.OpenURL string:"$1"

3) My host Ubuntu 16.10 have installed snapd-xdg-open

$ apt-cache policy snapd-xdg-open

snapd-xdg-open:
  Installed: 0.0.0

$ apt-cache policy snapd
snapd:
  Installed: 2.14+16.10

===============================================

If I run test2, then got the problem

/snap/test2/x1/bin/xdg-open: 3: /snap/test2/x1/bin/xdg-open: dbus-send: Permission denied

In /var/log/syslog
Aug 30 10:13:04 vasilisc kernel: [ 349.006386] audit: type=1400 audit(1472541184.035:52): apparmor="DENIED" operation="exec" profile="snap.test2.test2" name="/usr/bin/dbus-send" pid=32126 comm="xdg-open" requested_mask="x" denied_mask="x" fsuid=1000 ouid=0


--
Best regards,
vasilisc

--
Snapcraft mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft

Reply via email to