How to know snap is run at classic

Hi, how to know the snap app was run at classic mode or strict mode?

Thank you

There is no choice on the user side, that decision is made when the package is uploaded by the packager and only very specific packages can actually be classic (after a review by the security team)

You as a user will actually need to specifically define the --classic option when installing the snap, so you should be aware when you install it…

To see if an installed snap is using classic confinement, you can look at the output of snap list on your machine… in the notes column there will be written “classic”

1 Like

Is there some set to let app know? Such as macro ‘SNAP_SCENARIO=classic|strict’

Thank you


I think the point is, if a snap is classic, then it can’t be installed in any other way [ installing without the --classic options will fail ]. Therefor, whoever is developing the snap just needs to make it work in classic confinement mode anyway. There should be no need to detect if a snap is classic or not, it’s just a known thing.

Unless the question is, is it installed on Ubuntu Classic, which is a different question :slight_smile:

There are a few answers to that final question here: Is this the way to detect an Ubuntu Core host system?

Cheers, Just

As i said, there is no way to influence classic or strict on the user side, this decision is made at package creation time, classic snaps have to be created completely different to strict snaps and undergo a completely different release process with manual reviews and deep security inspection since they are more powerful …

you can see the criteria a classic snap needs to fulfill here:

You can see there that classic confinement is also limited to a very narrow set of applications (see the list of Supported types on that page) where strict confinement is simply impossible and would completely kill the functionality of an app (i.e. IDEs that need to have access to header files in random and unpredictable file system locations).

1 Like