[solved] XAUTHORITY environment value is not a clean path - If I use LightDM

SOLVED The problem was me…
echo $XAUTHORITY was giving me :

[fedora@localhost ~]$ echo $XAUTHORITY 
/var/run/lightdm/fedora/xauthority

Which is not the same as /run/lightdm/fedora/xauthority, I overlloked the /var part.

Further check:

[fedora@localhost ~]$ file /var/run
/var/run: symbolic link to ../run

Indeed this is symlink, thus the check fails and the warning is produces.


It seems to stop giving warning if I set: XAUTHORITY=/run/lightdm/fedora/xauthority
which is the same path as before… Anyway I will ask the Fedora guys why this happens.

Using Fedora 27.
I get this warning If I use LightDM (It doesn’t happen with other DM’s) and I run program installed by snap.

[fedora@localhost ~]$ hello-world
    2018/03/24 16:06:35.406445 cmd_run.go:343: WARNING: XAUTHORITY environment value is not a clean path: "/run/lightdm/fedora/xauthority"
    Hello World!

I found this on Github Link:

        // Ensure the XAUTHORITY env is not abused by checking that
	// it point to exactly the file we just opened (no symlinks,
	// no funny "../.." etc)
	if fin.Name() != xauthPathCan {
		logger.Noticef("WARNING: XAUTHORITY environment value is not a clean path: %q", xauthPathCan)
		return "", nil
        }  

Removed LightDM, there is no such warning anymore. Now echo $XAUTHORITY returns this:

[fedora@localhost ~]$ echo $XAUTHORITY 
/home/fedora/.Xauthority

Is this problem with snapd? Acording to what found in Github this seem the expected behaviour
Promblem with snapd and LightDM? Fedora?

That snapd checks for a symbolic link is a bug. It is unnecessary, if snapd accesses the $XAUTHORITY file with the effective user ID of the user who wants to run the snap application. Now reported at https://bugs.launchpad.net/snapd/+bug/1902250