Refactor arguments escaping#333
Conversation
94fdb71 to
d5973b5
Compare
…onment variable expansion - Replace wordexp-based parsing with custom two-phase argument splitting - Remove escapeForWordexp() function as it's no longer needed - Refactor unescape() to unescapeValue() using QStringView for better performance - Add unescapeEnvs() function to handle environment variable escaping safely - Replace ut_escapeexec.cpp with comprehensive ut_escape.cpp test cases - Reorganize header includes to follow project conventions - Use const references and std::move for performance optimizations Security: wordexp executes shell commands and performs environment variable substitution, which could lead to command injection vulnerabilities in .desktop files. Signed-off-by: ComixHe <heyuming@deepin.org>
…e argument parsing - Add systemd argument escaping for '$' and ';' characters - Replace VariantValue class hierarchy with std::variant-based handlers - Use std::string_view to reduce string copies - Use std::optional instead of magic string return values - Refactor processExecStart to use iterators instead of deque - Improve cmdParse argument parsing logic - Enhance error handling and logging - Optimize DBus message construction Pms: BUG-325155 Signed-off-by: ComixHe <heyuming@deepin.org>
deepin pr auto reviewGit Diff 代码审查报告总体评价这次提交主要涉及应用启动器(app-launch-helper)和应用管理器(dde-application-manager)的代码重构,重点改进了参数解析、命令行转义、DBus通信和代码结构。整体上代码质量有所提升,使用了更现代的C++特性,但仍有部分细节可以进一步优化。 详细审查1. 语法逻辑1.1
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, ComixHe The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
No description provided.