Backslashes are not escaped when running processes through Reaper

未关闭
#731 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
shell
领域
cli

调研方向

首先使用 /usr/bin/cat 和列出的启动选项,通过 Reaper 重现启动过程,然后使用 pgrep 和 ps 检查生成的命令。跟踪 Reaper 如何传递启动选项参数,并确保字面反斜杠得以保留;当观察到的参数与预期命令一致(包括单个和成对的反斜杠)时,即可完成。

由索引模型根据 Issue 内容生成。

描述

Your system information
  • Steam Version: 1733265492
  • Steam Runtime Version: 0.20241024.105847
  • Distribution (e.g. Ubuntu 18.04): Manjaro
  • Link to your full system information: ---
  • Have you checked for system updates?: No
  • What compatibility tool are you using?: None / Proton 9.0 (both tested, this is minimal repro)
  • What versions are listed in steamapps/common/SteamLinuxRuntime/VERSIONS.txt:
depot	0.20240806.0			# Overall version number
LD_LIBRARY_PATH	-	scout	-	# see ~/.steam/root/ubuntu12_32/steam-runtime/version.txt
scripts	0.20240806.0			# from steam-runtime-tools
  • What versions are listed in steamapps/common/SteamLinuxRuntime_soldier/VERSIONS.txt:
depot	0.20241118.108551			# Overall version number
pressure-vessel	0.20241118.0	scout		# pressure-vessel-bin.tar.gz
scripts	0.20241118.0			# from steam-runtime-tools
soldier	0.20241118.108551	soldier	0.20241118.108551	# soldier_platform_0.20241118.108551/
  • What versions are listed in steamapps/common/SteamLinuxRuntime_sniper/VERSIONS.txt:
depot	0.20241118.108552			# Overall version number
pressure-vessel	0.20241118.0	scout		# pressure-vessel-bin.tar.gz
scripts	0.20241118.0			# from steam-runtime-tools
sniper	0.20241118.108552	sniper	0.20241118.108552	# sniper_platform_0.20241118.108552/
Please describe your issue in as much detail as possible:

Launch Options should escape backslashes to pass them through properly. Mostly used for Wine/Proton apps when a file path needs to be specified.

Bash's printf "%q" would do, but it's not part of POSIX (man printf.1p). Does Steam care about POSIX shells?

PS: I hope this is in the correct repository

Steps for reproducing this issue:
  1. Add non-steam game: /usr/bin/cat
  2. Launch options (GNU cat) to make it stall but also showcase the args: -- /dev/zero --doubledash forward/slash back\slash double\\backslash
  3. Observe the args:
pgrep cat
# shows PID
ps -ewwo pid,etime,cmd $PID
  17962       01:50 /home/HOME/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=3378455283 -- /usr/bin/cat -- /dev/zero --doubledash forward/slash backslash double\backslash
  17963       01:49 /usr/bin/cat -- /dev/zero --doubledash forward/slash backslash double\backslash

Expected:

/usr/bin/cat -- /dev/zero --doubledash forward/slash back\slash double\\backslash

Actual:

/usr/bin/cat -- /dev/zero --doubledash forward/slash backslash double\backslash

主要语言
Shell
星标
1.5k
派生
98
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ValveSoftware/steam-runtime 的其他 Issue

查看 ValveSoftware/steam-runtime 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。