Skip to content

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

Open
calsys456 wants to merge 1 commit intolinuxdeepin:masterfrom
calsys456:fix-wayland
Open

fix: avoid mistakenly create seat group on debian-based systems#84
calsys456 wants to merge 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

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: calsys456

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

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

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.

2 participants