snap-exec: fix detection if cups interface is connected by mvo5 · Pull Request #11616 · canonical/snapd (original) (raw)

I have now done the following:

I have removed all the three Snaps, cups, cups-admin-test, and cups-admin-test-no-control using sudo snap remove --purge SNAPNAME, so removing all configuration, cache, ... from the Snaps, then I re-installed the Snaps (from local *.snap files), manually connected the interfaces (as I did not install from the Snap Store), ...

... and this solved the problem!!!

I retested all the three Snaps as in my posts above, getting the same (correct) result for cups-admin-test which plugs cups-control and for cups-admin-test-no-control which plugs cups, and getting also a correct result for the CUPS Snap, the CUPS_SERVER variable is now NOT set and the commands cups.lpstat -r, cups.lpstat -v, and cups.lpinfo -v show all the correct results.

Conclusions

Principally, the bug is fixed.

But what I am wondering about now is that if at some point in time in a Snap's sandbox an environment variable is set, that it seems to survive restarts, stopping and starting, updates of both the Snap itself and of snapd, ... in some cache where I have no idea where it is (it seems not to be in /var/snap/cups/current/ or /var/snap/cups/common/). Is this true?

Then I would suggest that if snap-exec finds that there is NO bind mount, that it not only not sets CUPS_SERVER but even UNSETS CUPS_SERVER, to be sure to not have any remains from an old, buggy snapd (2.55.2 from stable).

WDYT?