Skip to content

chore: add airplane mode interface permission declaration - #602

Merged
fly602 merged 1 commit into
linuxdeepin:masterfrom
fly602:master
Aug 17, 2026
Merged

chore: add airplane mode interface permission declaration#602
fly602 merged 1 commit into
linuxdeepin:masterfrom
fly602:master

Conversation

@fly602

@fly602 fly602 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor
  1. Register org.deepin.dde.AirplaneMode1 for security-loader access
  2. Install the permission config with the control center network plugin
  3. Include the permission interface directory in the Debian package

Log: Allow control center to switch airplane mode through security-loader

Influence:

  1. Verify the control center network panel opens normally
  2. Verify airplane mode can be enabled and disabled
  3. Verify Wi-Fi and Bluetooth follow airplane mode state changes

chore: 添加网络模块飞行模式接口权限声明

  1. 为 security-loader 注册 org.deepin.dde.AirplaneMode1
  2. 随控制中心网络插件安装权限配置文件
  3. 在 Debian 软件包中包含权限接口配置目录

Log: 允许控制中心通过 security-loader 切换飞行模式

Influence:

  1. 验证控制中心网络面板可以正常打开
  2. 验证飞行模式可以正常开启和关闭
  3. 验证 Wi-Fi 和蓝牙状态随飞行模式正确变化

PMS: TASK-393313

Summary by Sourcery

Build:

  • Install the org.deepin.dcc-network permission interface JSON with the dcc-network plugin and include its directory in the Debian package.

@sourcery-ai

sourcery-ai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a security-loader permission interface configuration for the network plugin so control center can toggle airplane mode, and ensures it is installed and packaged with the plugin.

File-Level Changes

Change Details Files
Add and install security-loader permission interface configuration for the network plugin to enable airplane mode control from the control center.
  • Extend CMake installation to install the org.deepin.dcc-network.json permission interface file into the dde-control-center/permission-interfaces data directory.
  • Introduce a new misc/permission-interfaces/org.deepin.dcc-network.json file declaring the airplane mode D-Bus interface permission (org.deepin.dde.AirplaneMode1) for the network module.
  • Ensure the Debian dcc-network-plugin package installs/includes the permission-interfaces directory so the config file is available at runtime.
dcc-network/CMakeLists.txt
dcc-network/misc/permission-interfaces/org.deepin.dcc-network.json
debian/dcc-network-plugin.install

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

1. Register org.deepin.dde.AirplaneMode1 for security-loader access
2. Install the permission config with the control center network plugin
3. Include the permission interface directory in the Debian package

Log: Allow control center to switch airplane mode through security-loader

Influence:
1. Verify the control center network panel opens normally
2. Verify airplane mode can be enabled and disabled
3. Verify Wi-Fi and Bluetooth follow airplane mode state changes

chore: 添加网络模块飞行模式接口权限声明

1. 为 security-loader 注册 org.deepin.dde.AirplaneMode1
2. 随控制中心网络插件安装权限配置文件
3. 在 Debian 软件包中包含权限接口配置目录

Log: 允许控制中心通过 security-loader 切换飞行模式

Influence:
1. 验证控制中心网络面板可以正常打开
2. 验证飞行模式可以正常开启和关闭
3. 验证 Wi-Fi 和蓝牙状态随飞行模式正确变化

PMS: TASK-393313
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:95分

■ 【总体评价】

代码实现了网络插件对飞行模式D-Bus接口的权限声明与依赖管理,变更规范合理
逻辑正确且无安全漏洞,因debian/control中依赖格式存在轻微不一致扣5分

■ 【详细分析】

  • 1.语法逻辑(完全正确)✓

CMakeLists.txt中新增的install指令路径拼接正确,使用${CMAKE_INSTALL_DATAROOTDIR}变量符合CMake标准实践;org.deepin.dcc-network.json的JSON语法完全合法,字段层级结构正确;debian/control中包依赖声明的逗号分隔与版本号约束语法(>=)正确;debian/dcc-network-plugin.install中新增的路径条目符合debhelper安装文件规范。

  • 2.代码质量(良好)✓

CMakeLists.txt中添加了清晰的注释说明配置用途;JSON文件包含了version和description元数据,可读性好;四个网络相关包统一添加了dde-daemon版本依赖,保证了接口兼容性。但debian/control文件中依赖格式存在不一致:dcc-network-plugin包的Depends字段采用多行书写并在行尾使用逗号,而dock-network-plugin、dss-network-plugin、deepin-service-plugin-network三个包的Depends字段均压缩在单行内且逗号紧跟前一项无空格。
潜在问题:依赖声明格式在同一个文件内不统一,降低可维护性
建议:统一debian/control中所有包的Depends字段为多行缩进格式,保持风格一致

  • 3.代码性能(无性能问题)✓

本次变更为纯配置文件添加与包依赖声明,不涉及运行时代码、算法逻辑或系统调用,对运行时性能无任何影响。install指令仅在构建打包阶段执行,JSON文件由权限加载器按需读取,开销可忽略。

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次变更为声明式权限配置,通过JSON文件向权限加载器注册所需的D-Bus系统服务接口,遵循最小权限声明原则;依赖版本锚定dde-daemon (>= 6.1.102)确保了飞行模式接口的可用性与安全性;配置文件中不包含任何硬编码凭证、敏感路径或动态执行逻辑,不存在命令注入、权限绕过等信息安全风险。

  • 建议:后续若需新增其他D-Bus接口权限,应继续沿用此JSON声明机制,避免在C++业务代码中绕过权限检查直接调用系统级D-Bus接口

■ 【改进建议代码示例】

--- a/debian/control
+++ b/debian/control
@@ -59,7 +59,9 @@ Package: dock-network-plugin
 Architecture: any
-Depends: ${misc:Depends},${shlibs:Depends},libdde-network-core (= ${binary:Version}),dde-daemon (>= 6.1.102)
+Depends: ${misc:Depends},
+         ${shlibs:Depends},
+         libdde-network-core (= ${binary:Version}),
+         dde-daemon (>= 6.1.102)
 Description: the plugin of network for dde-dock
  dock-plugin module
 
@@ -67,7 +69,9 @@ Package: dss-network-plugin
 Architecture: any
-Depends: ${misc:Depends},${shlibs:Depends},libdde-network-core (= ${binary:Version}),dde-daemon (>= 6.1.102)
+Depends: ${misc:Depends},
+         ${shlibs:Depends},
+         libdde-network-core (= ${binary:Version}),
+         dde-daemon (>= 6.1.102)
 Description: the plugin of network for dde-lock
  dss-network-plugin module
 
@@ -75,7 +79,9 @@ Package: deepin-service-plugin-network
 Architecture: any
-Depends: ${misc:Depends},${shlibs:Depends},curl,dde-daemon (>= 6.1.102)
+Depends: ${misc:Depends},
+         ${shlibs:Depends},
+         curl,
+         dde-daemon (>= 6.1.102)
 Breaks: dde-daemon (<<6.1.58)
 Replaces: dde-daemon (<<6.1.58)
 Description: the plugin of network service for deepin-service-manager

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caixr23, fly602

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fly602
fly602 merged commit ad4f89b into linuxdeepin:master Aug 17, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants