Requesting ‘classic’ confinement for whatsapp-for-linux

Hi all, I created a whatsapp linux client desktop application. No matter how I tried the QR code doesn’t load with the strict confinement. Here is my snapcraft:

name: whatsapp-for-linux
base: core18
version: '1.0.1'
summary: An unofficial WhatsApp linux client.
description: An unofficial WhatsApp linux client written in C++ with the help of gtkmm-3.0 and webkit2.
grade: stable
confinement: strict

parts:
  whatsapp-for-linux:
    source-type: git
    source-branch: master
    source: https://github.com/eneshecan/whatsapp-for-linux
    plugin: cmake
    configflags:
      - -DCMAKE_BUILD_TYPE=Release
    build-packages:
      - g++
      - cmake
      - make
      - libgtkmm-3.0-dev
      - libwebkit2gtk-4.0-dev
    stage-packages:
      - libgtkmm-3.0-1v5

apps:
  whatsapp-for-linux:
    command: usr/bin/whatsapp-for-linux
    desktop: usr/share/applications/whatsapp-for-linux.desktop
    extensions: [gnome-3-28] # This takes care of most of the things for us
    plugs:
      - account-control
      - network
      - network-manager
      - browser-support
      - camera
      - audio-playback
      - audio-record
      - home
      - opengl
      - upower-observe

Could you give me any suggestions or help me to make this application classic? The latest release is created with the classic confinement: https://dashboard.snapcraft.io/snaps/whatsapp-for-linux/revisions/5/

Is the failure in generating a QR code to display, or reading a QR code with the camera?

Have you connected the camera interface?

The problem is with the generating QR code. It never finishes loading. And yes, I added the camera plug. should I connect that explicitly?

Try installing snappy-debug and then run it in a terminal while you reproduce the problem. If there is a confinement issue that is preventing the QR code from being generated it will appear in the terminal window along with potential solutions.

I got this errors:

= AppArmor =
Time: Jun  4 19:22:48
Log: apparmor="DENIED" operation="capable" profile="/snap/snapd/7777/usr/lib/snapd/snap-confine" pid=30256 comm="snap-confine" capability=4  capname="fsetid"
Capability: fsetid
Suggestions:
* adjust program to not require 'CAP_FSETID' (see 'man 7 capabilities')
* add one of 'account-control' to 'plugs'
* do nothing if program otherwise works properly

= AppArmor =
Time: Jun  4 19:22:52
Log: apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/NetworkManager" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.9" pid=30476 label="snap.whatsapp-for-linux.whatsapp-for-linux" peer_pid=1105 peer_label="unconfined"
DBus access
Suggestion:
* try adding 'network-manager' to 'plugs'

I already have network-manager and account-control in the plugs.

The first one is unrelated, so can be ignored… The second one will go away if you snap connect whatsapp-for-linux:network-manager but I think it is unrelated, too.

Yes, the first one is gone with the desktop-launch command.

in any case make sure to manually connect the plugs you add after installing your snap … the higher privileged ones do not auto-connect

Manually connecting all the plugs also didn’t work. Now I don’t have any error messages in snappy-debug.

your stage-packages list looks pretty sparse, if you build locally, does snapcraft tell you about missing stage-packages or libraries ?

Most of the things are in the gnome extension although the app doesn’t need so may packages. However, snapcraft doesn’t warn me about any missing packages.

well, i was just imagining that you might miss some image processing library to create the QR code that building the snap in classic mode gains you access to while it might be missing in strict or some such …

(there is really no reason why you should need classic for such an app, something must be missing inside the confinement that your host provides otherwise)

Well, after waiting 10 minutes it asked to reload the QR code and it worked. I guess it’s a problem with the webkit2gtk library in a snap environment. As a result, we don’t need a classic confinement for now. Thanks for all the help.

2 Likes