protonscr

Steam creates a non-standard desktop file at installation

steamclosed High priorityreviewedSteam client
ValveSoftware/steam-for-linux#655 · opened 2013-01-11 by abt462 · updated 2020-07-14 · 13 comments · github
Aabt462 2013-01-11 github

This problem might be pretty new as it didn't happen when I installed the client weeks ago but happened when I reinstalled it this morning. Also, it has been reported by someone else on a french Ubuntu forum.

Using the Steam repos + installation from DEB package. I'm on Unity, the other user having reported the problem is on KDE, so it's desktop-independant.

The problem is that when installing Steam, I get a launcher simply named "Desktop" in my home dir. At best it should be named steam.desktop or anything with .desktop extension and I don't think it's even supposed to be there.

My guess is that Steam tries to create the launcher on the desktop and the operation is messed up for some reason. It might be because I use a system in french and my desktop folder is named "Bureau". It's supposed to be passed to apps through an env var (I don't remember it's name exactly or the file it's stored in ; probably something like $XDG_DESKTOP_DIR). Maybe a recent update to Steam makes it force to use the english name and when it tries to copy the file in the desktop it mistakenly names it as "Desktop" (something like "cp steam.desktop $HOME/Desktop" which is supposed to copy the file in the Desktop dir but as it doesn't exist it's copied as a file name).

Aabt462 2013-01-12 github

I have a few more details on the problem.

Af you may know, the directories to use are defined in ~/.config/users-dirs.dirs, where env vars are defined, among them there is XDG_DESKTOP_DIR that is set e.g to "$HOME/Desktop".The problem is that in my case, while I have the file and the xdg-update program is supposed to run at session start, the env vars do not seem to be set (echo $XDG_DESKTOP_DIR in a terminal gives me a blank line). One might think that the problem is then specific to my system but as someone else reported the same issue on a forum, I'm wondering if the problem lies in Ubuntu, with XDG having been broken by a recent update or so. Also, I've just checked on my laptop, on which I have reinstalled Ubuntu just a few days ago and this env vars problem is there too.

So it might not be a Steam issue after all, although you should check that the installer uses $XDG_DESKTOP_DIR to determine the correct dir rather than use $HOME/Desktop (I guess it already does that but better check).

Is the problem affecting other people around here?

EDIT : after reading Arch wiki (https://wiki.archlinux.org/index.php/Xdg_user_directories), I'm not sure the vars are supposed to be set, although I thought so. Looks like the right (and only?) way to get the XDG vars is throught xdg-user-dir (e.g. xdg-user-dir DESKTOP).

Ww-flo 2013-01-12 github

This affects me as well (Kubuntu 12.10, German locale, so ~/Arbeitsfläche/ is the desktop directory).

Looking at the ~/ backup of my old Ubuntu 12.04 (Unity) system, it has a steam.desktop file in ~/Arbeitsfläche/, so this is either a regression in Steam or Kubuntu 12.10 handles those things differently.

edit: system info https://gist.github.com/4503760

Jjohnv-valve maintainer 2013-01-14 github

If you look in /usr/bin/steam it does the following in install_bootstrap()

# put the Steam icon on the user's desktop
# try to read ~/.config/user-dirs.dirs to get the current desktop configuration
# http://www.freedesktop.org/wiki/Software/xdg-user-dirs
test -f "${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs" && source "${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs"
DESKTOP_DIR="${XDG_DESKTOP_DIR:-$HOME/Desktop}"

cp "/usr/share/applications/$STEAMPACKAGE.desktop" "$DESKTOP_DIR"

In fact this is exactly the code that freedesktop.org provides as an example. http://www.freedesktop.org/wiki/Software/xdg-user-dirs

If you are seeing this problem, please provide the contents of ~/.config/user-dirs.dirs and the environment variables XDG_CONFIG_HOME and XDG_DESKTOP_DIR.

Aabt462 2013-01-14 github

As I said above, the variables are not set although the user-dirs.dirs file exists and is correct (and I have user-dirs-update-gtk.desktop in /etc/xdg/autostart) . The XDG vars that exist on my systems are $XDG_CONFIG_DIRS, $XDG_CURRENT_DESKTOP, $XDG_DATA_DIRS, $XDG_RUNTIME_DIR, $XDG_SEAT_PATH, $XDG_SESSION_COOKIE and $XDG_SESSION_PATH.

I can also say that the problem appeared recently (I noticed it the day I posted the message and saw the same issue reported on a forum the same day) and the XDG variables are missing too on a PC on which I've installed Ubuntu recently so it isn't specific to my main PC being messed up (I first thought it could be because I tend to customize the system a lot on it).

My current guess is that there has been a recent update for Ubuntu that screwed up XDG. Though I must say that I installed some Windows software through Wine yesterday and I got a launcher on the desktop as expected (so it seems that Wine can identify my desktop dir -- I don't know how it does).

I'm using Ubuntu 12.10 (64 bits). Currently with Unity (on both my main PC on which I use Steam and on my laptop on which I've reinstalled Ubuntu recently but haven't installed Steam).

Here is my ~/.config/user-dirs.dirs so you can see that it seems quite normal:

This file is written by xdg-user-dirs-update
If you want to change or add directories, just edit the line you're
interested in. All local changes will be retained on the next run
Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
absolute path. No other format is supported.

XDG_DESKTOP_DIR="$HOME/Bureau"
XDG_DOWNLOAD_DIR="$HOME/Téléchargements"
XDG_TEMPLATES_DIR="$HOME/Modèles"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Musique"
XDG_PICTURES_DIR="$HOME/Images"
XDG_VIDEOS_DIR="$HOME/Vidéos"

(EDIT : I removed the # for the comments of the user-dirs.dirs -- 6 first lines -- as they were interpreted by Github and messed my post a bit, but I can safely say that the file is legit.)

Ww-flo 2013-01-14 github

@johnv-valve:
The code you pasted does not work for me:

$ test -f "${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs" && source "${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs"; DESKTOP_DIR="${XDG_DESKTOP_DIR:-$HOME/Desktop}"; echo $XDG_DESKTOP_DIR; echo $DESKTOP_DIR

/home/[redacted]/Desktop

In fact, the call to "test" fails because it can't find "~/.config/user-dirs.dirs", even though that file exists. It does work without the quotation marks around the paths for "test" and "source", apparently my shell does not expand ~ when used inside a string. Not sure what the negative consequences of deleting the quotation marks could be, it should probably be tested with white space home directories and white space XDG_CONFIG_HOMES.. (actually, I just noticed that the freedesktop.org link you gave has the code without quotation marks.)

$ test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && source ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs; DESKTOP_DIR="${XDG_DESKTOP_DIR:-$HOME/Desktop}"; echo $XDG_DESKTOP_DIR; echo $DESKTOP_DIR
/home/[redacted]/Arbeitsfläche
/home/[redacted]/Arbeitsfläche

Edit: Maybe the following is a good mix of both solutions? Shell experts required. :-)

test -f "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" && source "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs"; DESKTOP_DIR="${XDG_DESKTOP_DIR:-$HOME/Desktop}"; echo $XDG_DESKTOP_DIR; echo $DESKTOP_DIR
Jjohnv-valve maintainer 2013-01-15 github

@jui-feng - thanks for your sharp eyes, those quotes got introduced a few weeks ago and as you figured out they broke the expansion of ~. Next release will have your suggested fix.

Jjohnv-valve maintainer 2013-01-18 github

fixed in the 1.0.0.22 .deb release

?ghost 2020-02-06 github

What is a .desktop file? I would be led to believe that this is the Steam OS I've heard of, but why is it delivered in such an insecure manner? It's not a trusted file. it's not named in Steam style, it looks like hackers put it together, and I don't trust it.

Any information on the manner of this file and its build process would be much appreciated.
mike

TTriMoon 2020-02-06 github

@mkstarr It is a text file used on Linux that tells the WindowManager how to create a menu item for an application.
You don't have to be scared about it :wink:

For more info on it see: here and here or use your favorite search engine...

Aabt462 2020-02-06 github

@mkstarr It's basically a shortcut for an application. If you're familiar with Windows, it's the equivalent on Linux of a .lnk file, a shortcut to an app that you put wherever you want for easy access. It's not related to SteamOS specifically.

My original issue was that Steam didn't create a proper .desktop file as expected.

?ghost 2020-04-29 github

@mkstarr It is a text file used on Linux that tells the WindowManager how to create a menu item for an application.
You don't have to be scared about it

For more info on it see: here and here or use your favorite search engine...

Thanks, TriMoon.

?ghost 2020-05-06 github

Ok so I figured it out.

It's a .desktop file (Ubuntu/Linux) which,after you trust it, turns into a desktop shortcut.

Still seems pretty risky to me.

Exploitable.

TTriMoon 2020-07-14 github

@mkstarr Ok so I figured it out.

It's a .desktop file (Ubuntu/Linux) which,after you trust it, turns into a desktop shortcut.

Still seems pretty risky to me.

Exploitable.

These files are used in all Linux variants, they can be turned into a desktop shortcut or menu item.
Just keep in mind that they are not automatically executed, it needs the user to interact with them :wink:
Same goes for shortcuts in M$ windcrap :rofl:

In computers everything is exploitable if that is your fear....
So as i said before: You don't have to be scared about it

Nothing extracted yet.