fix(log): remove write to read-only system directory in initLog#727
Merged
re2zero merged 1 commit intolinuxdeepin:masterfrom Apr 28, 2026
Merged
Conversation
|
Warning
|
|
Warning
|
On Linux, config.conf is now installed by deb package as read-only. Only create the file on Windows where logDir() is user-writable. Linux端日志配置改为deb包预装只读文件,不再运行时写入系统目录。 Windows端保留原有的自动创建逻辑。 Log: 日志初始化不再写入系统只读目录 PMS: BUG-347813 Influence: 修复磐石系统拦截通知,启动时不再尝试写入/usr/share/目录
7885e89 to
62da81a
Compare
|
Warning
|
deepin pr auto review这份代码 diff 主要涉及为项目添加统一的日志级别配置文件 1. 语法逻辑与代码质量
2. 代码性能
3. 代码安全
4. 其他建议
总结这段代码的主要目的是为了规范化日志配置管理,区分 Linux 和 Windows 的处理方式。
总体来说,这是一次合理的重构,主要改进点在于使用 |
pppanghu77
approved these changes
Apr 28, 2026
liujianqiang-niu
approved these changes
Apr 28, 2026
|
Warning
|
liujianqiang-niu
approved these changes
Apr 28, 2026
lzwind
approved these changes
Apr 28, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: liujianqiang-niu, lzwind, pppanghu77, re2zero 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/usr/share/<appName>/config.confon Linux, use deb-installed read-only config insteadsrc/common/config.confwith default log level, installed via CMake to each app's share directoryRoot Cause
Both
commonutils.cppimplementations hardcoded/usr/share/<appName>/config.confon Linux and attempted to write when the file didn't exist (setValue + sync). The file was never installed by any CMake rule or deb package, so it was always missing on a fresh install, triggering the write attempt on every startup. On immutable/read-only filesystems (磐石系统), this was blocked with a security notification.Test Plan
/usr/share/dde-cooperation/,/usr/share/dde-cooperation-daemon/,/usr/share/deepin-data-transfer/