Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LFRon 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 |
Reviewer's GuideAPIDefine the shared NetworkManager compatibility helpers and implement the build-selected standard or Deepin activation behavior, including option and Reapply-flag filtering.
Uses of the APIRoute activation and Reapply callers through the compatibility helpers, preserving asynchronous error reporting where applicable.
Use the corrected session network service identifiers when checking connectivity and issuing the portal connectivity request.
UILeave the password field empty for a renewed secret request and use a regular dialog on Wayland so Treeland can map the prompt.
ConfigurationExpose the Deepin NetworkManager build option and link the network service plugin to the compatibility helpers.
Record the Debian build-option change and updated session network plugin metadata.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Hi @LFRon. Thanks for your PR. 😃 |
|
Hi @LFRon. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Hey - I've found 6 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="network-service-plugin/src/session/sessioncontainer.cpp" line_range="53" />
<code_context>
{
// 检测初始化的状态是否为门户认证,这种情况下需要先打开Url
- QDBusInterface dbusInter("org.deepin.service.SystemNetwork", "/org/deepin/service/SystemNetwork", "org.deepin.service.SystemNetwork", QDBusConnection::systemBus());
+ QDBusInterface dbusInter(networkService, networkPath, networkInterface, QDBusConnection::systemBus());
network::service::Connectivity connectivity = static_cast<network::service::Connectivity>(dbusInter.property("Connectivity").toInt());
if (connectivity == network::service::Connectivity::Portal) {
</code_context>
<issue_to_address>
**Captive portal launches arbitrary URI handlers**
When a connected network returns a captive-portal redirect using a non-HTTP URI scheme, `HttpReply` accepts the response’s `Location` as the portal URL, and `SessionContainer` passes it through `UrlHelper::openUrl` to `xdg-open` without restricting the scheme. A hostile portal can therefore trigger desktop URI handlers or open local resources for the logged-in user.
Validate portal URLs before opening them, allowing only explicitly supported schemes such as HTTP and HTTPS.
</issue_to_address>
### Comment 2
<location path="src/impl/networkmanager/nmnetworkmanager.cpp" line_range="23" />
<code_context>
- if (extra_connection_parameter.isEmpty()) {
- extra_connection_parameter = QLatin1String("/");
+ QVariantMap result = options;
+ if constexpr (USE_DEEPIN_NM == 0)
+ result.remove(QStringLiteral("flags"));
+ return result;
</code_context>
<issue_to_address>
**Core fails strict C++14 builds**
When the project is built with a strict C++14 compiler, `if constexpr` requires C++17, but `src/CMakeLists.txt:10` sets the core target to C++14. A compiler that rejects this C++17 extension fails to build the core library.
Replace these `if constexpr` statements with C++14-compatible `if` statements or raise the core target's standard to C++17.
</issue_to_address>
### Comment 3
<location path="network-service-plugin/src/session/sessioncontainer.cpp" line_range="53" />
<code_context>
{
// 检测初始化的状态是否为门户认证,这种情况下需要先打开Url
- QDBusInterface dbusInter("org.deepin.service.SystemNetwork", "/org/deepin/service/SystemNetwork", "org.deepin.service.SystemNetwork", QDBusConnection::systemBus());
+ QDBusInterface dbusInter(networkService, networkPath, networkInterface, QDBusConnection::systemBus());
network::service::Connectivity connectivity = static_cast<network::service::Connectivity>(dbusInter.property("Connectivity").toInt());
if (connectivity == network::service::Connectivity::Portal) {
</code_context>
<issue_to_address>
**Portal and connectivity checks fail**
When sessionContainer performs portal or connectivity checks, sessionContainer sends the system-bus calls to `org.deepin.dde.Network1`, but the system-service factory registers `org.deepin.dde.Network10`, so the calls do not reach the service and portal handling and connectivity checks fail.
Use the registered system-service name consistently for these calls and the related signal subscriptions.
Also at `network-service-plugin/src/session/sessioncontainer.cpp:118`.
</issue_to_address>
### Comment 4
<location path="net-view/operation/private/netmanagerthreadprivate.cpp" line_range="1762" />
<code_context>
+ NetworkManager::activateConnection(connection->path(), devPath, QString());
+ break;
+ }
+ [[fallthrough]];
}
// case ConnectionSettings::Wired:
</code_context>
<issue_to_address>
**Connections receive duplicate activation requests**
When `USE_DEEPIN_NM` is enabled and the wireless or PPPoE branch executes, the Deepin branch completes `activateConnection2()` and falls through to the standard `activateConnection()` call for the same connection, causing a redundant activation request that can interrupt or restart the connection.
Stop the Deepin branch from falling through to the standard activation call.
</issue_to_address>
### Comment 5
<location path="net-view/operation/private/netmanagerthreadprivate.cpp" line_range="1759" />
<code_context>
+ if (reply.isError())
+ qCWarning(DNC) << "Failed to activate connection:" << reply.error().message();
+ } else {
+ NetworkManager::activateConnection(connection->path(), devPath, QString());
+ break;
+ }
</code_context>
<issue_to_address>
**Failed activations go unreported**
When the stock NetworkManager activation request fails, the standard branch discards the asynchronous reply from `NetworkManager::activateConnection()` without waiting or checking it, so the failure is not logged or reported to the caller.
Wait for or watch the activation reply, then log and report any error.
</issue_to_address>
### Comment 6
<location path="net-view/operation/private/netmanagerthreadprivate.cpp" line_range="1061" />
<code_context>
options.insert("flags", MANULCONNECTION);
applyDadTimeout(settings);
- QDBusPendingReply<QDBusObjectPath, QDBusObjectPath> reply = NetworkManager::addAndActivateConnection2(settings->toMap(), devPath, ap->path(), options);
+ QDBusPendingReply<QDBusObjectPath, QDBusObjectPath> reply = NetworkManager::addAndActivateConnection2Compat(settings->toMap(), devPath, ap->path(), options);
if (reply.isError()) {
qCWarning(DNC) << "activateConnection fiald:" << reply.error().message();
</code_context>
<issue_to_address>
**Activation errors remain silent**
When the compatibility call returns before NetworkManager has replied and then fails, the pending reply is checked with `isError()` immediately, without waiting for completion. An asynchronous D-Bus failure therefore passes the check and is not logged, leaving this activation path silent on failure.
Wait for the reply or attach a completion watcher before checking and logging its error.
</issue_to_address>| { | ||
| // 检测初始化的状态是否为门户认证,这种情况下需要先打开Url | ||
| QDBusInterface dbusInter("org.deepin.service.SystemNetwork", "/org/deepin/service/SystemNetwork", "org.deepin.service.SystemNetwork", QDBusConnection::systemBus()); | ||
| QDBusInterface dbusInter(networkService, networkPath, networkInterface, QDBusConnection::systemBus()); |
There was a problem hiding this comment.
🟡 Medium · Captive portal launches arbitrary URI handlers
When a connected network returns a captive-portal redirect using a non-HTTP URI scheme, HttpReply accepts the response’s Location as the portal URL, and SessionContainer passes it through UrlHelper::openUrl to xdg-open without restricting the scheme. A hostile portal can therefore trigger desktop URI handlers or open local resources for the logged-in user.
Validate portal URLs before opening them, allowing only explicitly supported schemes such as HTTP and HTTPS.
Prompt for AI agents
In `network-service-plugin/src/session/sessioncontainer.cpp` at line 53:
**Captive portal launches arbitrary URI handlers**
When a connected network returns a captive-portal redirect using a non-HTTP URI scheme, `HttpReply` accepts the response’s `Location` as the portal URL, and `SessionContainer` passes it through `UrlHelper::openUrl` to `xdg-open` without restricting the scheme. A hostile portal can therefore trigger desktop URI handlers or open local resources for the logged-in user.
Validate portal URLs before opening them, allowing only explicitly supported schemes such as HTTP and HTTPS.| { | ||
| // 检测初始化的状态是否为门户认证,这种情况下需要先打开Url | ||
| QDBusInterface dbusInter("org.deepin.service.SystemNetwork", "/org/deepin/service/SystemNetwork", "org.deepin.service.SystemNetwork", QDBusConnection::systemBus()); | ||
| QDBusInterface dbusInter(networkService, networkPath, networkInterface, QDBusConnection::systemBus()); |
There was a problem hiding this comment.
🟠 High · Portal and connectivity checks fail
When sessionContainer performs portal or connectivity checks, sessionContainer sends the system-bus calls to org.deepin.dde.Network1, but the system-service factory registers org.deepin.dde.Network10, so the calls do not reach the service and portal handling and connectivity checks fail.
Use the registered system-service name consistently for these calls and the related signal subscriptions.
Also at network-service-plugin/src/session/sessioncontainer.cpp:118.
Prompt for AI agents
In `network-service-plugin/src/session/sessioncontainer.cpp` at line 53:
**Portal and connectivity checks fail**
When sessionContainer performs portal or connectivity checks, sessionContainer sends the system-bus calls to `org.deepin.dde.Network1`, but the system-service factory registers `org.deepin.dde.Network10`, so the calls do not reach the service and portal handling and connectivity checks fail.
Use the registered system-service name consistently for these calls and the related signal subscriptions.
Also at `network-service-plugin/src/session/sessioncontainer.cpp:118`.| if (reply.isError()) | ||
| qCWarning(DNC) << "Failed to activate connection:" << reply.error().message(); | ||
| } else { | ||
| NetworkManager::activateConnection(connection->path(), devPath, QString()); |
There was a problem hiding this comment.
🟡 Medium · Failed activations go unreported
When the stock NetworkManager activation request fails, the standard branch discards the asynchronous reply from NetworkManager::activateConnection() without waiting or checking it, so the failure is not logged or reported to the caller.
Wait for or watch the activation reply, then log and report any error.
Prompt for AI agents
In `net-view/operation/private/netmanagerthreadprivate.cpp` at line 1759:
**Failed activations go unreported**
When the stock NetworkManager activation request fails, the standard branch discards the asynchronous reply from `NetworkManager::activateConnection()` without waiting or checking it, so the failure is not logged or reported to the caller.
Wait for or watch the activation reply, then log and report any error.| options.insert("flags", MANULCONNECTION); | ||
| applyDadTimeout(settings); | ||
| QDBusPendingReply<QDBusObjectPath, QDBusObjectPath> reply = NetworkManager::addAndActivateConnection2(settings->toMap(), devPath, ap->path(), options); | ||
| QDBusPendingReply<QDBusObjectPath, QDBusObjectPath> reply = NetworkManager::addAndActivateConnection2Compat(settings->toMap(), devPath, ap->path(), options); |
There was a problem hiding this comment.
🟡 Medium · Activation errors remain silent
When the compatibility call returns before NetworkManager has replied and then fails, the pending reply is checked with isError() immediately, without waiting for completion. An asynchronous D-Bus failure therefore passes the check and is not logged, leaving this activation path silent on failure.
Wait for the reply or attach a completion watcher before checking and logging its error.
Prompt for AI agents
In `net-view/operation/private/netmanagerthreadprivate.cpp` at line 1061:
**Activation errors remain silent**
When the compatibility call returns before NetworkManager has replied and then fails, the pending reply is checked with `isError()` immediately, without waiting for completion. An asynchronous D-Bus failure therefore passes the check and is not logged, leaving this activation path silent on failure.
Wait for the reply or attach a completion watcher before checking and logging its error.1. Restore the existing ENABLE_DEEPIN_NMQT CMake option and its USE_DEEPIN_NMQT definition instead of adding a second ABI switch. Fedora builds pass -DENABLE_DEEPIN_NMQT=OFF; Deepin's debian/rules already passes ON. OFF calls the standard activation methods, drops the private flags option, masks the Reapply PRESERVE_DHCP bit, and logs activation and Reapply errors. ON keeps ActivateConnection2 and the flags option unchanged. 2. Route every activation call through activateConnection2() and addAndActivateConnection2Compat(). Keep the original asynchronous D-Bus behavior by reporting errors through QDBusPendingCallWatcher instead of blocking with waitForFinished(). 3. Watch Reapply replies and link the network service plugin against dde-network-core6 for the compat helpers. 4. Correct the session network D-Bus service name and hook object path: use org.deepin.dde.Network1 and prefix the hook path with a slash. 5. Do not prefill the previous secret when NetworkManager requests a new one after an authentication failure; remove the now-unreachable prefill branch. Use a regular Qt::Dialog on Wayland so Treeland can map the password prompt. Log: Wi-Fi and VPN activation works against Fedora's stock NetworkManager; Deepin builds keep the private activation path through the existing ENABLE_DEEPIN_NMQT switch. PMS: None Influence: 1. On stock NetworkManager, connect to a Wi-Fi network and verify the standard ActivateConnection path is used without "Unknown method" or "Invalid flags specified" errors. 2. On Deepin's NetworkManager, build with -DENABLE_DEEPIN_NMQT=ON and verify ActivateConnection2 receives the flags option and Reapply keeps PRESERVE_DHCP. 3. Retry a wrong Wi-Fi password and verify the dialog is empty; check that the dialog is visible on Wayland/Treeland and connects with the correct password. fix: 适配原版 NetworkManager 的 D-Bus API 1. 恢复原有 ENABLE_DEEPIN_NMQT CMake 选项及其 USE_DEEPIN_NMQT 宏, 不再新增第二套 ABI 开关。Fedora 构建传 -DENABLE_DEEPIN_NMQT=OFF;Deepin 的 debian/rules 已传 ON。OFF 使用标准激活接口,去掉私有 flags 参数,屏蔽 Reapply 的 PRESERVE_DHCP 位,并记录激活与 Reapply 错误;ON 保留 ActivateConnection2 与 flags 参数。 2. 所有激活调用统一走 activateConnection2() 与 addAndActivateConnection2Compat()。保留原有异步 D-Bus 行为,用 QDBusPendingCallWatcher 记录错误,不再用 waitForFinished() 阻塞。 3. 监听 Reapply 回复,并让网络服务插件链接 dde-network-core6 以复用 兼容函数。 4. 修正会话网络 D-Bus 服务名与 hook 对象路径:使用 org.deepin.dde.Network1,并给 hook 路径补上前导斜杠。 5. NetworkManager 在认证失败后请求新密码时不再预填旧密码,并删除已经 不可达的预填分支;Wayland 下改用普通 Qt::Dialog,确保 Treeland 能正常映射密码框。 Log: 原版 NetworkManager 下 Wi-Fi/VPN 可正常激活;Deepin 构建通过 现有 ENABLE_DEEPIN_NMQT 开关保留私有激活路径。 PMS: None Influence: 1. 在原版 NetworkManager 上连接 Wi-Fi,确认走标准 ActivateConnection,且不再出现 "Unknown method" 或 "Invalid flags specified"。 2. 在 Deepin NetworkManager 上以 -DENABLE_DEEPIN_NMQT=ON 构建,确认 ActivateConnection2 收到 flags,Reapply 保留 PRESERVE_DHCP。 3. 输错 Wi-Fi 密码后重试,确认密码框为空;在 Wayland/Treeland 下 确认密码框可见,输入正确密码后连接成功。
Keep the CMake option OFF by default so standard GNU/Linux builds use the stock NetworkManager API. The Debian packaging targets Deepin 25 and its NetworkManagerQt private extensions, so enable the option unconditionally in debian/rules instead of probing lsb_release. Fedora packages still pass -DENABLE_DEEPIN_NMQT=OFF. Log: Deepin 25 Debian builds enable the private NetworkManager ABI; other builds default to the stock API. PMS: None
|
针对研发大佬们指出的问题, 回复如下:
|
Log: Wi-Fi and VPN activation works against Fedora's stock NetworkManager; Deepin builds keep the private activation path by passing -DUSE_DEEPIN_NM=ON.
PMS: None
Influence:
fix: 适配原版 NetworkManager 的 D-Bus API
Log: 原版 NetworkManager 下 Wi-Fi/VPN 可正常激活;Deepin 构建传入 -DUSE_DEEPIN_NM=ON 后保留私有激活路径。
PMS: None
Influence:
Summary by Sourcery
Support stock NetworkManager while retaining an opt-in path for Deepin-specific NetworkManager behavior.
New Features:
Bug Fixes:
Build: