Skip to content

fix: avoid mistakenly create seat group on debian-based systems#84

Merged
zccrs merged 1 commit intolinuxdeepin:masterfrom
calsys456:fix-wayland
Feb 10, 2026
Merged

fix: avoid mistakenly create seat group on debian-based systems#84
zccrs merged 1 commit intolinuxdeepin:masterfrom
calsys456:fix-wayland

Conversation

@calsys456
Copy link
Contributor

@calsys456 calsys456 commented Feb 5, 2026

seatd uses video group instead of seat group on debian-based systems, so we need a specified version of sysuser.conf to avoid creating seat group mistakenly.

Summary by Sourcery

Adjust systemd sysusers configuration to avoid creating an incorrect seat group on Debian-based systems.

Bug Fixes:

  • Ensure Debian-based systems use a dedicated sysusers configuration aligned with seatd's use of the video group instead of creating a seat group.
  • Preserve the original sysusers configuration for non-Debian systems while separating Debian-specific behavior.

seatd uses video group instead of seat group on debian-based systems, so
we need a specified version of sysuser.conf to avoid creating seat group
mistakenly.
@deepin-ci-robot
Copy link

Hi @calsys456. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@sourcery-ai
Copy link

sourcery-ai bot commented Feb 5, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR adjusts how systemd sysusers configuration is installed so that Debian-based systems use a Debian-specific sysusers config that avoids creating an incorrect seat group, while non-Debian systems keep using the original config.

File-Level Changes

Change Details Files
Make sysusers configuration conditional on Debian detection, using a Debian-specific sysusers template on Debian-based systems and the original template elsewhere.
  • Remove unconditional configure/install of ddm-sysuser.conf at the top of services/CMakeLists.txt
  • Within the Debian branch, add configure_file for debian.ddm-sysuser.conf.in and install the generated debian.ddm-sysuser.conf to SYSTEMD_SYSUSERS_DIR as dde.conf
  • Within the non-Debian branch, add back configure_file for ddm-sysuser.conf.in and install the generated ddm-sysuser.conf to SYSTEMD_SYSUSERS_DIR as dde.conf
services/CMakeLists.txt
Introduce a Debian-specific sysusers configuration template to align group usage with seatd on Debian-based systems.
  • Add debian.ddm-sysuser.conf.in as a new sysusers configuration template tailored for Debian-based systems
services/debian.ddm-sysuser.conf.in

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

Copy link

@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 - I've found 1 issue, and left some high level feedback:

  • Relying on if(EXISTS "/etc/debian_version") at configure time couples the build behavior to the host system rather than the target; consider exposing an explicit CMake option or distro flag instead of probing the build machine’s filesystem.
  • The configure_file/install logic for the sysuser config is now duplicated in both branches of the Debian check; consider factoring this into a small helper or variable to reduce duplication and keep the Debian-specific difference (file name) more obvious.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Relying on `if(EXISTS "/etc/debian_version")` at configure time couples the build behavior to the host system rather than the target; consider exposing an explicit CMake option or distro flag instead of probing the build machine’s filesystem.
- The `configure_file`/`install` logic for the sysuser config is now duplicated in both branches of the Debian check; consider factoring this into a small helper or variable to reduce duplication and keep the Debian-specific difference (file name) more obvious.

## Individual Comments

### Comment 1
<location> `services/CMakeLists.txt:13-15` </location>
<code_context>
 if(EXISTS "/etc/debian_version")
     install(FILES debian.ddm.pam DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/pam.d RENAME ddm)
+
+    # In debian-based systems, seatd uses video group instead of seat
+    # group, avoid creating seat group mistakenly by specifying
+    # different sysuser.conf
+    configure_file(debian.ddm-sysuser.conf.in debian.ddm-sysuser.conf)
+    install(FILES "${CMAKE_CURRENT_BINARY_DIR}/debian.ddm-sysuser.conf" DESTINATION "${SYSTEMD_SYSUSERS_DIR}" RENAME dde.conf)
</code_context>

<issue_to_address>
**suggestion (typo):** Fix capitalization and comma splice in the new comment about Debian-based systems.

The current comment is a single run-on sentence: `In debian-based systems, seatd uses video group instead of seat group, avoid creating seat group mistakenly by specifying different sysuser.conf`. Please capitalize "Debian-based" and split it into two sentences, e.g.
`# In Debian-based systems, seatd uses the video group instead of the seat group.`
`# Avoid creating the seat group mistakenly by specifying a different sysuser.conf.`

```suggestion
    # In Debian-based systems, seatd uses the video group instead of the seat group.
    # Avoid creating the seat group mistakenly by specifying a different sysuser.conf.
```
</issue_to_address>

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.

@@ -12,6 +9,14 @@ endif()

if(EXISTS "/etc/debian_version")
Copy link
Member

Choose a reason for hiding this comment

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

不应该这样做,应该添加一个cmake参数,在debian/rules 打包时关闭这些能力,而且要在readme里说明。不过这个提交不用改,可以新起一个。

@zccrs zccrs merged commit c5cfe7c into linuxdeepin:master Feb 10, 2026
12 checks passed
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: calsys456, zccrs

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the systemd sysusers configuration installed by ddm so Debian-based systems don’t inadvertently create/use a seat group (seatd uses the video group there), while keeping the existing sysusers behavior for non-Debian systems.

Changes:

  • Add a Debian-specific sysusers template that omits seat group membership.
  • Update services/CMakeLists.txt to install the Debian vs non-Debian sysusers config based on Debian detection.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
services/debian.ddm-sysuser.conf.in New Debian-specific sysusers template without seat group membership.
services/CMakeLists.txt Installs Debian-specific sysusers config on Debian-based systems; keeps existing config elsewhere.

Comment on lines +1 to +2
#Type Name ID GECOS Home directory Shell
u dde - "DDM Greeter Account" ${STATE_DIR} -
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

New file debian.ddm-sysuser.conf.in doesn’t include an SPDX license identifier header. Project guidelines require newly added files to carry an SPDX line (typically GPL-2.0-or-later), so please add it at the top of this file.

中文:新添加的文件 debian.ddm-sysuser.conf.in 缺少 SPDX 许可证标识头。项目规范要求新增文件包含 SPDX 行(通常为 GPL-2.0-or-later),请在文件开头补充。

Copilot uses AI. Check for mistakes.
Comment on lines 10 to +17
if(EXISTS "/etc/debian_version")
install(FILES debian.ddm.pam DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/pam.d RENAME ddm)

# In debian-based systems, seatd uses video group instead of seat
# group, avoid creating seat group mistakenly by specifying
# different sysuser.conf
configure_file(debian.ddm-sysuser.conf.in debian.ddm-sysuser.conf)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/debian.ddm-sysuser.conf" DESTINATION "${SYSTEMD_SYSUSERS_DIR}" RENAME dde.conf)
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The Debian vs non-Debian selection is based on if(EXISTS "/etc/debian_version"), which is evaluated on the build host. This can produce incorrect install artifacts when cross-compiling or building Debian packages in a non-Debian environment/container. Consider making this an explicit CMake option (overridable by packagers) or using a more target-oriented detection mechanism.

中文:这里用 if(EXISTS "/etc/debian_version") 在构建机上判断 Debian/非 Debian,这在交叉编译或在非 Debian 环境/容器里构建 Debian 包时可能生成错误的安装产物。建议改为可由打包者覆盖的 CMake 选项,或使用更面向目标系统的检测方式。

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants