content interface behaves different if tried an operation before connecting the interface

Bug #1671446 reported by Roberto Mier Escandon
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
New
Undecided
Unassigned

Bug Description

I've got a wifi-connect snap which has an application using content interface to get use of wifi-ap exposed $SNAP_DATA/sockets directory.
Depending on the order of the steps I take, the behaviour of the app run is different resulting in denial or success:

CASE A:
STEPS:
1- have neither wifi-ap or wifi-connect snaps installed
2- install wifi-ap from store
3- install our wifi-connect snap in strict mode
 snap install wifi-connect_0.1_amd64.snap --dangerous
6- connect control interface
 snap connect wifi-connect:control wifi-ap:control
7- run
 sudo wifi-connect.wifi-ap -show
8 got a denial in syslog traces and this response:
 Error: '"/snap/wifi-connect/x1/bin/unixhttpc" ["/var/snap/wifi-ap/current/sockets/control" "/v1/configuration"]' failed. "exit status 2"

That makes sense as wifi-connect tries to mount content share in rw mode into $SNAP/snap/sockets which is read only

CASE B:
STEPS:
1- have neither wifi-ap or wifi-connect snaps installed
2- install wifi-ap from store
3- install our wifi-connect snap in strict mode
 snap install wifi-connect_0.1_amd64.snap --dangerous
4- run
 sudo wifi-connect.wifi-ap -show
5- got a denial in syslog traces and this response:
 Error: '"/snap/wifi-connect/x1/bin/unixhttpc" ["/var/snap/wifi-ap/current/sockets/control" "/v1/configuration"]' failed. "exit status 2"
6- connect control interface
 snap connect wifi-connect:control wifi-ap:control
7- run
 sudo wifi-connect.wifi-ap -show

EXPECTED:
- same denial and result as step 5, as wifi-connect tries to mount content share in rw mode into $SNAP/snap/sockets which is read only

RESULT:
- got this succesful reply
Wifi-ap Configuration:
Unix HTTP client
{"result":{"debug":false,"dhcp.lease-time":"12h","dhcp.range-start":"10.0.60.2","dhcp.range-stop":"10.0.60.199","disabled":false,"share.disabled":false,"share.network-interface":"enx9cebe8163f7d","wifi.address":"10.0.60.1","wifi.channel":"6","wifi.hostapd-driver":"nl80211","wifi.interface":"wlan0","wifi.interface-mode":"direct","wifi.netmask":"255.255.255.0","wifi.operation-mode":"g","wifi.security":"open","wifi.security-passphrase":"","wifi.ssid":"Ubuntu"},"status":"OK","status-code":200,"type":"sync"}

- Anytime from now on you execute the operation, it works.

-----------------------------------------------------------------------------------------------
attached is wifi-connect snap used for this. You can find the source code for it in here [1]

[1] https://github.com/rmescandon/UCWifiConnect/tree/unixhttpc-src

Revision history for this message
Roberto Mier Escandon (rmescandon) wrote :
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This is a known issue that is being tracked https://github.com/snapcore/snapd/projects/1

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.