PATH set in snap-level environment is overriden by snap-confine

Bug #1868450 reported by Zygmunt Krynicki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Triaged
Undecided
Zygmunt Krynicki

Bug Description

A snap with something like this in meta/snap.yaml

name: foo
version: 1
environment:
  PATH: $PATH:/custom
apps:
  foo:
    command: foo

Will not see /custom in$ PATH because $PATH is reset by snap-confine, for startup of strict and devmode confinement snaps. To work around this you can set $PATH at the level of the application,
then snap-exec will apply it.

This makes me wonder if snap-confine should still set PATH to a fixed value. The value we set makes sense only for core and core-like base snaps, not all base snaps. Snap run has way more information about what ought to be set and in fact, is setting PATH when invoking snap-confine.

This bug is fixed in edge, where new snap environment handling has landed. I think the part about $PATH and snap-confine is true so I will file it nonetheless.

Revision history for this message
Claudio Matsuoka (cmatsuoka) wrote :

Do you have a solution in mind for the issue, or plans to work on it? I'll leave it assigned to you because you're familiar with the problem and this specific area, please reassign or unassign if you feel appropriate.

Changed in snapd:
status: New → Triaged
assignee: nobody → Zygmunt Krynicki (zyga)
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.