protonscr

Don't create .desktop entries with the executable permission, as it's not needed

steamclosed
ValveSoftware/steam-for-linux#6405 · opened 2019-07-20 by braiam · updated 2021-12-10 · 11 comments · github
Bbraiam 2019-07-20 github

Your system information

  • Steam client version (build number or date): 2019-07-17
  • Distribution (e.g. Ubuntu): Debian
  • Opted into Steam client beta?: [Yes/No] No
  • Have you checked for system updates?: [Yes/No] Yes

Please describe your issue in as much detail as possible:

When I install a game using the Steam client, a .desktop file is created in ~/.local/share/applications. This entry works fine, but it's created with eXecutable permissions. This is not up to spec since the file can not be executed, only read by compliant implementations as series of lines. This file isn't interpreted as script. Setting the execution bit doesn't serve any purpose and can be best avoided.

Steps for reproducing this issue:

  1. Install a game using the steam client
  2. Check ~/.local/share/applications with ls -l
  3. Note that only files created by the client have the executable bits

Additional information

Wine, Chrome apps, Discord, manual installations of firefox don't set the executable bit when installed/run.

MMyrddin-Wyllt 2019-07-20 github

Don't most desktop environments demand the executable bit for security reasons on .desktop files?
XFCE, LXQt, KDE, & GNOME all require the executable bit for running .desktop files on click/double-click as far as I know. Go to your desktop, remove the executable property from a .desktop file and try to use it. It will introduce a prompt to nag you; a primitive security.

I just tested this in ~/.local/share/applications; it is for allowing a user to execute the program from a file manager. Without being executable, you will be nagged.

Bbraiam 2019-07-23 github

@Myrddin-Wyllt I'm using XFCE, none is nagging.

total 156
-rw-r--r-- 1 braiam braiam 215 Feb 20 19:54 "Broken Sword 1 - Shadow of the Templars Director's Cut.desktop"
-rw-r--r-- 1 braiam braiam 207 Feb 20 19:54 'Broken Sword 2 - the Smoking Mirror Remastered.desktop'
-rw------- 1 braiam braiam 329 Feb 20 19:54  chrome-aohghmighlieiainnegkcijnfilokake-Default.desktop
-rw------- 1 braiam braiam 330 Feb 20 19:54  chrome-apdfllckaahabafndbhieahigkjlhalf-Default.desktop
-rw------- 1 braiam braiam 325 Feb 20 19:54  chrome-blpcfgokakmgnkcojhhkbfbldkacnbeo-Default.desktop
-rw------- 1 braiam braiam 331 Feb 20 19:54  chrome-coobgpohoikkiipiblmjeljniedjpjpf-Default.desktop
-rw------- 1 braiam braiam 318 Feb 20 19:54  chrome-hmpigflbjeapnknladcfphgkemopofig-Default.desktop
-rw------- 1 braiam braiam 343 Feb 20 19:54  chrome-nmmhkkegccagdldgiimedpiccmgmieda-Default.desktop
-rw------- 1 braiam braiam 323 Feb 20 19:54  chrome-pjkljhegncpnkpknbcohdijeoejaedia-Default.desktop
-rw-r--r-- 1 braiam braiam 473 May 30 23:38  citra-canary.desktop
-rw-r--r-- 1 braiam braiam 468 May 30 23:38  citra.desktop
-rw-r--r-- 1 braiam braiam 188 Jun 23 17:49 'Counter-Strike Global Offensive.desktop'
-rw-r--r-- 1 braiam braiam 202 May 30 23:38  discord-461729900748079114.desktop
-rw-r--r-- 1 braiam braiam 221 Feb 20 19:54  discord-471872241299226636.desktop
-rw-r--r-- 1 braiam braiam 216 Feb 20 19:54  dwarftherapist.desktop
-rw-r--r-- 1 braiam braiam 179 Feb 25 16:39  factorio.desktop
-rw-r--r-- 1 braiam braiam 160 Feb 20 19:54 'Left 4 Dead 2.desktop'
-rw-r--r-- 1 braiam braiam 180 Feb 20 19:54 'Life is Strange.desktop'
-rw-r--r-- 1 braiam braiam 105 Feb 20 19:54  mimeapps.list
-rw-r--r-- 1 braiam braiam 784 Feb 20 19:54  mimeinfo.cache
-rw-r--r-- 1 braiam braiam 163 Jul 13 15:45 'Rocket League.desktop'
-rw-r--r-- 1 braiam braiam 159 Feb 20 19:54  userapp-Firefox-YMMDMY.desktop
-rw-r--r-- 1 braiam braiam 159 Feb 20 19:54  userapp-Icedove-7NIUFY.desktop
drw-r--r-- 1 braiam braiam  16 Feb 20 19:54  wine
-rw-r--r-- 1 braiam braiam 208 Feb 20 19:54  wine-extension-chm.desktop
-rw-r--r-- 1 braiam braiam 215 Feb 20 19:54  wine-extension-gif.desktop
-rw-r--r-- 1 braiam braiam 210 Feb 20 19:54  wine-extension-hlp.desktop
-rw-r--r-- 1 braiam braiam 233 Feb 20 19:54  wine-extension-htm.desktop
-rw-r--r-- 1 braiam braiam 234 Feb 20 19:54  wine-extension-html.desktop
-rw-r--r-- 1 braiam braiam 222 Feb 20 19:54  wine-extension-ini.desktop
-rw-r--r-- 1 braiam braiam 218 Feb 20 19:54  wine-extension-jfif.desktop
-rw-r--r-- 1 braiam braiam 217 Feb 20 19:54  wine-extension-jpe.desktop
-rw-r--r-- 1 braiam braiam 231 Feb 20 19:54  wine-extension-msp.desktop
-rw-r--r-- 1 braiam braiam 215 Feb 20 19:54  wine-extension-png.desktop
-rw-r--r-- 1 braiam braiam 205 Feb 20 19:54  wine-extension-rtf.desktop
-rw-r--r-- 1 braiam braiam 200 Feb 20 19:54  wine-extension-txt.desktop
-rw-r--r-- 1 braiam braiam 223 Feb 20 19:54  wine-extension-url.desktop
-rw-r--r-- 1 braiam braiam 213 Feb 20 19:54  wine-extension-vbs.desktop
-rw-r--r-- 1 braiam braiam 211 Feb 20 19:54  wine-extension-wri.desktop
-rw-r--r-- 1 braiam braiam 213 Feb 20 19:54  wine-extension-xml.desktop

This is also reinforced by Debian system directory:

      1 total
     19 -rw-r--r--
      1 lrwxrwxrwx
     64 -rw-r--r--
      1 -rw-rw-r--
     45 -rw-r--r--

The only with x permission is the symlink to discord.

MMyrddin-Wyllt 2019-07-23 github

Open ~/.local/share/applications with Thunar & click on those desktop files to open them.

image

This is the nagging I am talking about.

You won't be nagged in the application menu though as this is not done through the file manager.

Bbraiam 2019-07-23 github

Do you really want to go through the file browser on a hidden directory to run a .desktop file which is already on the Applications Menu? I think that would be a pretty unlikely scenario.

I mean, every other application is like that, and I haven't seen any bug report about users wanting to run applications like that.

Bbraiam 2019-07-23 github

I think this answer offers a explanation to the message you are seeing.

MMyrddin-Wyllt 2019-07-23 github

@braiam I think you're misunderstanding my meaning. I never advocated for this as a security measure, but the developers seem to believe it is regardless of whether or not that's true (i.e., I personally don't think it adds any security). I'm rather quite critical of the executable bit design myself in file managers today. I don't use the executable .desktop files in ~/.local/share/applications; but why hinder someone who does?

There are times you might not want a program cluttering your application menu & have thus concealed it (i.e., NoDisplay or Hidden); and you don't want it on your desktop. For these instances, it is necessary to have an executable bit to avoid the aforementioned nag; however unlikely a scenario it may be.

Additionally, the users of other software probably aren't the same demographic as gamers specifically. This demographic likely has far more people who used to use Windows (i.e., as gaming wasn't as viable as it is now on Linux), & explaining why a .desktop shortcut won't run without nagging you won't bode well with this inexperienced crowd. The ex-Windows crowd expects things to work without intervention; thus I don't expect this to change in Steam.

?ghost 2019-07-24 github

After 4 days no one from Valve has said anything so... me thinks they are going to ignore this and let you argue lol.

Iitaranto 2020-07-09 github

In fact, every file that Steam creates has "wrong" permissions.
See https://github.com/ValveSoftware/steam-for-linux/issues/6096

Kkisak-valve maintainer 2021-12-10 github

Closing because this is required for some desktop environments before using the shortcut is allowed.

Iitaranto 2021-12-10 github

Closing because this is required for some desktop environments before using the shortcut is allowed.

Wait, what? where did you get that from? .desktop files don't need execution permissions...

Bbraiam 2021-12-10 github

@kisak-valve if desktop environments require execution permissions for files in the XDG_DATA_DIRS/applications to allow execution from the desktop menu that would be out of spec. I don't know a single desktop environment that Debian supports that requires such.