PHP does not hide command line arguments
未关闭
还没有人认领这个 Issue。
Bug
Status: Needs Triage
- 主要语言
- C
- 星标
- 40.4k
- 派生
- 8.1k
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 96
描述
Description
Run php-cli with argument -H, then check process list:
php -H -e & ps ax
Expected ps output (command line arguments vanished):
...
13088 pts/2 R 0:00 php
...
Actual ps output:
...
13088 pts/2 R 0:00 php -H -e
...
The problem is that this fragment of code works not on original argv, but on argv that was modified by save_ps_args:
/*
* Do not move this initialization. It needs to happen before argv is used
* in any way.
*/
argv = save_ps_args(argc, argv);
PHP Version
PHP 8.2.10
Operating System
No response
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 sapi/cli/php_cli.c 大约第 949 行开始,检查 save_ps_args 如何在参数隐藏逻辑运行之前更改 argv。使用 php -H -e & ps ax 重现该问题,然后确认进程列表只显示 php,而不显示其命令行参数。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- c, php
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 45/100