Repository navigation
fix(data-transfer): launch via deepin-security-loader to avoid polkit… #784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+140
−3
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #!/bin/bash | ||
| # SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. | ||
| # | ||
| # SPDX-License-Identifier: GPL-3.0-or-later | ||
| # Deepin Data Transfer launcher | ||
| # 参照 deepin-home-appstore-client:满足条件时经 deepin-security-loader | ||
| # 附加 deepin-daemon 组启动,使 lastore 免鉴权接口调用可行; | ||
| # 否则直接启动,鉴权回退为系统 polkit 弹窗(等同历史行为)。 | ||
|
|
||
| REAL_BIN=/usr/libexec/deepin/deepin-data-transfer | ||
|
|
||
| # Check if /usr/bin/deepin-security-loader is executable and dbus version meets | ||
| # requirement(用 -x 而非 -f:exec 失败时 bash 会直接退出 127,无法走 || 回退, | ||
| # 须在 exec 前排除不可执行的 loader) | ||
| if [ -x "/usr/bin/deepin-security-loader" ]; then | ||
| # Check dbus version | ||
| if DBUS_VERSION=$(dpkg-query -W -f='${Version}' dbus 2>/dev/null); then | ||
| # Compare dbus version with 1.12.20.17-deepin1 | ||
| if dpkg --compare-versions "$DBUS_VERSION" ge "1.12.20.17-deepin1"; then | ||
| # Use security loader with deepin-daemon group | ||
| exec /usr/bin/deepin-security-loader --group deepin-daemon -- "$REAL_BIN" "$@" | ||
| fi | ||
| fi | ||
| fi | ||
|
|
||
| # Fallback to direct launch | ||
| exec "$REAL_BIN" "$@" |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick (bug_risk): The parser accepts fd value 0 even though the comment says standard input must be rejected; an invocation containing
--fd1 0therefore treats stdin as the loader report pipe and writes the JSON handshake to it instead of rejecting the malformed loader arguments.Triggers: When the process receives a malformed or user-supplied
--fd1 0argument.Suggested fix: Require the parsed descriptor to be a valid non-standard descriptor, for example by rejecting values less than 3 before assigning fd1 or fd2.