Repository navigation
feat: expose recursive DConfig subpaths in daemon and clients - #178
18202781743 wants to merge 1 commit into
Conversation
Reviewer's GuideData structuresNormalize nested metadata and override subpaths to the shared leading-slash representation used by recursive enumeration.
APIExpose the read-only Manager subpaths property and its change signal in the D-Bus contract and connection object.
Add subpath retrieval to the configuration getter abstraction used by clients.
Extend
Uses of the APIRead subpaths through the configuration getter so command-line clients can enumerate paths from the Manager.
Use discovered subpaths to refresh the editor’s resource tree when opening an app or reselecting a resource.
Add an example mode that reads the initial subpaths property and watches for updates over D-Bus.
ImplementationCalculate each connection’s recursive subpaths and emit D-Bus property notifications when that list changes.
Expose resource-local prefix and notify its connections when subpath sources change.
Refresh affected connections after cache synchronization and reloads, including refreshing all connections for global-cache updates.
ConfigurationEnable Qt DBus and automatic MOC support required by the example’s monitoring mode.
DocumentationDocument recursive subpath queries, shell completion, editor discovery, and the Manager property and signal.
TestsVerify normalized nested path parsing and recursive enumeration, plus change notifications for overrides and cache synchronization.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="dconfig-center/dde-dconfig-daemon/dconfigconn.cpp" line_range="84" />
<code_context>
result << meta()->subpaths(localPrefix);
// Global cache subpaths (global shared)
- result << file()->globalCache()->subpathList(localPrefix);
</code_context>
<issue_to_address>
**Other users’ paths are exposed**
When an unprivileged local D-Bus caller requests a manager for another existing user’s UID and reads `subpaths`, `DSGConfigConn::subpaths()` includes the selected UID’s cache paths without calling `hasPermissionByUid`; the caller can read recursive subpath names from another user’s manager object.
Restrict cross-UID manager acquisition or enforce the caller-UID check before returning per-user subpaths.
</issue_to_address>
### Comment 2
<location path="dconfig-center/dde-dconfig-daemon/services/org.desktopspec.ConfigManager.Manager.xml" line_range="4" />
<code_context>
<property access="read" type="s" name="version"/>
<property access="read" type="as" name="keyList"/>
- <property access="read" type="as" name="subpathList"/>
+ <property access="read" type="as" name="subpaths"/>
<method name='value'>
<arg type='s' name='key' direction='in'/>
</code_context>
<issue_to_address>
**Older clients lose subpath access**
When an older client remains during a staggered upgrade and reads `subpathList` or subscribes to `subpathListChanged`, the Manager interface exports only `subpaths` and `subpathsChanged`, with no compatibility alias, so reads of `subpathList` fail with `UnknownProperty` and subscriptions to `subpathListChanged` receive no updates; existing clients lose subpath data and change notifications.
Keep compatibility aliases for the old property and signal on the Manager interface.
Also at `dconfig-center/dde-dconfig-daemon/services/org.desktopspec.ConfigManager.Manager.xml:45`.
</issue_to_address>| // Current user cache subpaths (per-user) | ||
| result << cache()->subpathList(localPrefix); | ||
| result << cache()->subpaths(localPrefix); | ||
|
|
There was a problem hiding this comment.
🟡 Medium · Other users’ paths are exposed
When an unprivileged local D-Bus caller requests a manager for another existing user’s UID and reads subpaths, DSGConfigConn::subpaths() includes the selected UID’s cache paths without calling hasPermissionByUid; the caller can read recursive subpath names from another user’s manager object.
Restrict cross-UID manager acquisition or enforce the caller-UID check before returning per-user subpaths.
Prompt for AI agents
In `dconfig-center/dde-dconfig-daemon/dconfigconn.cpp` at line 84:
**Other users’ paths are exposed**
When an unprivileged local D-Bus caller requests a manager for another existing user’s UID and reads `subpaths`, `DSGConfigConn::subpaths()` includes the selected UID’s cache paths without calling `hasPermissionByUid`; the caller can read recursive subpath names from another user’s manager object.
Restrict cross-UID manager acquisition or enforce the caller-UID check before returning per-user subpaths.ff1e9c6 to
884f755
Compare
The Manager now provides a read-only subpaths property that reports recursively discovered subpaths and emits change notifications when they update. The CLI, shell completion, and editor consume this property to discover subpaths instead of relying on the leading slash alone. feat: 在守护进程和客户端中暴露递归 DConfig 子路径 Manager 现在提供只读的 subpaths 属性,用于报告递归发现的子路径,并在更新 时发出变更通知。CLI、Shell 补全和编辑器使用该属性来发现子路径,而不再仅 依赖开头的斜杠。 PMS: TASK-398893
884f755 to
afc1b3e
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743 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 |
DConfig Manager 提供递归
subpaths属性和变更通知。属性合并 override、全局缓存和当前用户缓存中的路径,返回相对于当前连接起点的结果。dde-dconfig list支持按资源和起点查询,Bash 和 Zsh 补全从资源根查询。递归枚举依赖配套的 linuxdeepin/dtkcore#602。本 PR 汇总 #177 中的 Manager 功能和客户端适配,直接以
master为基线。PMS TASK-398893
Qt 6 构建通过,CTest 207 项通过、6 项跳过,Bash 和 Zsh 补全脚本通过语法检查。
Summary by Sourcery
Expose recursive configuration subpaths and their change notifications across the daemon, command-line client, completions, editor, documentation, examples, and tests.
New Features:
dde-dconfig listand shell completions to query and complete subpaths by resource, starting path, and user.Bug Fixes:
Enhancements:
Build:
Documentation:
Tests: