/etc/profile.d/snapd.sh is overwriting PATH and XDG_DATA_DIRS

Bug #1622678 reported by Abhishek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd (Ubuntu)
Confirmed
Undecided
Zygmunt Krynicki

Bug Description

snapd is creating a file /etc/profile.d/snapd.sh which is overwriting the PATH and XDG_DATA_DIRS variables:
    PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/builddir/.local/bin:/builddir/bin:/snap/bin
    if [ -z "" ]; then
        XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
    else
        XDG_DATA_DIRS="":/var/lib/snapd/desktop
   fi
   export XDG_DATA_DIRS

This is on Fedora 24 GNOME version. Snapd was installed using the Copr repo.

Version information from `dnf info snapd`
Installed Packages
Name : snapd
Arch : x86_64
Epoch : 0
Version : 2.14
Release : 1.fc24
Size : 23 M
Repo : @System
From repo : zyga-snapcore

What was expected:

PATH variable with its default value appended with /snap/bin.
XDG_DATA_DIRS variable with its default value appended with /var/lib/snapd/desktop.

What happened instead:

The default value of PATH variable is overwritten.
The default value of XDG_DATA_DIRS is overwritten.

A simple fix which I used:
    PATH=$PATH:/snap/bin
    XDG_DATA_DIRS=$XDG_DATA_DIRS:/var/lib/snapd/desktop

Tags: packaging
Revision history for this message
Abhishek (rawcoder) wrote :

Seems like Fedora packaging issue: http://copr-dist-git.fedorainfracloud.org/cgit/zyga/snapcore/snapd.git/tree/snapd.spec?h=f24#n155

I hope this is the right place for this issue.

tags: added: packaging
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Thank you for reporting this. I will look at fixing this ASAP

Changed in snapd (Ubuntu):
status: New → Confirmed
assignee: nobody → Zygmunt Krynicki (zyga)
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Hello.

I believe this bug is fixed in the current fedora packaging but it is pending release because of selinux confinement issues.

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.