Skip to content

fix: add audio group permission to sound theme player service#150

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
wyu71:master
Sep 10, 2025
Merged

fix: add audio group permission to sound theme player service#150
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
wyu71:master

Conversation

@wyu71
Copy link
Copy Markdown
Contributor

@wyu71 wyu71 commented Sep 10, 2025

  • Added SupplementaryGroups=audio to ensure proper audio device access

Log: add audio group permission to sound theme player service
pms: BUG-333303

Summary by Sourcery

Bug Fixes:

  • Grant audio group permission to the deepin sound theme player service to fix audio device access issues

- Added SupplementaryGroups=audio to ensure proper audio device access

Log: add audio group permission to sound theme player service
pms: BUG-333303
@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

我对这个systemd服务文件进行了审查,以下是改进意见:

  1. 代码逻辑:
  • 添加SupplementaryGroups=audio是正确的,这允许deepin-daemon用户访问音频设备,而无需将其加入audio主组
  • 保持了原有的服务依赖关系和启动顺序
  1. 代码质量:
  • 服务文件格式规范,遵循systemd服务文件的语法规则
  • 权限设置合理,通过User和SupplementaryGroups精细控制了用户权限
  1. 代码性能:
  • 没有发现性能相关的问题,服务配置合理
  1. 代码安全:
  • 安全性改进显著:
    • 使用专门的deepin-daemon用户运行服务,而非root
    • 通过SupplementaryGroups=audio精确控制音频设备访问权限
    • 设置了HOME目录为/var/lib/deepin-sound-player,限制用户主目录
    • 使用绝对路径指定可执行文件
  1. 建议补充:
  • 可以考虑添加Restart=on-failureRestartSec=5来增强服务的健壮性,在服务失败时自动重启
  • 建议添加ProtectSystem=strictPrivateTmp=true进一步增强安全性

改进后的建议版本:

[Unit]
Description=Deepin Sound Theme Player
After=dbus.socket

[Service]
Type=dbus
BusName=org.deepin.dde.SoundThemePlayer1
User=deepin-daemon
SupplementaryGroups=audio
Environment=HOME=/var/lib/deepin-sound-player
ExecStart=/usr/lib/deepin-api/sound-theme-player
Restart=on-failure
RestartSec=5
ProtectSystem=strict
PrivateTmp=true

[Install]
WantedBy=multi-user.target

这些改进将使服务更加安全、可靠,同时保持原有的功能完整性。

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey there - 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.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Sep 10, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Add audio group membership to the deepin-sound-theme-player systemd service to grant it access to audio devices at runtime by inserting the SupplementaryGroups directive

File-Level Changes

Change Details Files
Grant sound theme player access to audio devices via group permissions
  • Add 'SupplementaryGroups=audio' under the [Service] section
misc/systemd/system/deepin-sound-theme-player.service

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

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@wyu71
Copy link
Copy Markdown
Contributor Author

wyu71 commented Sep 10, 2025

/forcemerge

@deepin-bot deepin-bot Bot merged commit 6233fdd into linuxdeepin:master Sep 10, 2025
16 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