已合并
fix(build): harden shell command invocation #884
liu-wei创建于 5月23日
fix(build): harden shell command invocation #884
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 liu-wei 的贡献)CANN-robot
5月23日 评论:
5月23日 评论:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/ops-cv | ✅ 张磊, 徐鲁威 (2/2) | ✅ 张磊 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
liu-wei, thanks for your pull request. All authors of the commits have signed the CLA. 👍


5月23日 添加了label:cann-cla/yes
5月23日 将zhou-qilong,rxtfeng,loov1,zl_hw,llimwang,gubaocheng设为评审人
5月23日 将zhou-qilong,rxtfeng,loov1,zl_hw,llimwang,gubaocheng设为审查人
5月23日 修改了pull request 的描述
liu-wei
5月23日 评论:
5月23日 评论:
compile


5月23日 update merge request[project id: 7657293, iid: 884, commit_id: 46f0b1a9ac267f19104c7706973a306be48fe98c] virtual merging success
5月23日 update merge request[project id: 7657293, iid: 884, commit_id: 46f0b1a9ac267f19104c7706973a306be48fe98c] virtual merging success
5月23日 修改了pull request 的描述
5月23日 添加了label:ci-pipeline-running
CANN-robot
5月23日 评论:
5月23日 评论:
流水线任务触发成功
任务链接 [4f50b0142b39446c81185f44f3c6b229][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Pre | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-05-23 15:27:15] CI执行结束


CANN-robot
5月23日 评论:
5月23日 评论:
流水线任务触发成功
任务链接 [1c67a9004cec445d83471678892eb62c][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_codestyle | ✅ SUCCESS | ||
| codecheck_precommit | ✅ SUCCESS | >>>>> | >>>>> |
[2026-05-23 15:18:09] CI执行结束


5月23日 添加了label:api-check-pass
5月23日 删除了label:ci-pipeline-running
5月23日 添加了label:ci-pipeline-passed
liu-wei
5月25日 评论:
5月25日 评论:
compile


5月25日 update merge request[project id: 7657293, iid: 884, commit_id: 21a7b545696c5a8d1ecefa1a3e05f5219123a927] virtual merging success
5月25日 update merge request[project id: 7657293, iid: 884, commit_id: 21a7b545696c5a8d1ecefa1a3e05f5219123a927] virtual merging success
5月25日 删除了label:ci-pipeline-passedapi-check-pass
5月25日 添加了label:ci-pipeline-running
CANN-robot
5月25日 评论:
5月25日 评论:
流水线任务触发成功
任务链接 [0e96b06536324e459155c8c221c895d2][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Pre | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-05-25 09:46:50] CI执行结束


CANN-robot
5月25日 评论:
5月25日 评论:
流水线任务触发成功
任务链接 [97ba779d605f4c41b9621b87fe5bae1f][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_codestyle | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ✅ SUCCESS | >>>>> | >>>>> |
[2026-05-25 09:37:40] CI执行结束


5月25日 添加了label:api-check-pass
5月25日 删除了label:ci-pipeline-running
5月25日 添加了label:ci-pipeline-passed
5月26日 添加了label:approved
5月26日 添加了label:lgtm
CANN-robot
5月26日 评论:
5月26日 评论:
5月26日 关闭了关联的issue
5月26日 合入了pull request
描述
加固 build 脚本中的 shell 命令调用,防止特殊字符导致的注入和误解析问题。
主要改动
变量加引号 - 防止文件名含空格/特殊字符时产生 word splitting 和 globbing
cat $CHANGED_FILES→cat "$CHANGED_FILES"rm -rf ${BUILD_PATH}/*→rm -rf "${BUILD_PATH}"/*移除不必要的
bash -c- 直接执行命令,减少 shell 解析复杂度bash -c "find ${SRC_DIR} ..."→find "${SRC_DIR}" ...bash -c "python3 script.py $arg"→python3 "script.py" "$arg"修复 install.sh 的 bug
$0rntypo →$orn影响范围
安全收益
关联的Issue
关联 Issue: https://gitcode.com/cann/ops-cv/issues/391
测试
类型标签