Bug 15838 - samba-tool group removemembers returns success even if it should fail
Summary: samba-tool group removemembers returns success even if it should fail
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Python (show other bugs)
Version: 4.22.0
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Douglas Bagnall
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-21 11:26 UTC by Kacper
Modified: 2025-03-21 11:26 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kacper 2025-03-21 11:26:16 UTC
samba-tool group removemembers returns success even if it should fail if the primary group of the member to remove is also the group from which we try to remove the member from.

Steps to Reproduce:
Create a user using samba-tool (eg. samba-tool user add test01), that user will get the group "Domain Users" as it's primary group by default.

Try to remove the user from the "Domain Users" group (eg. samba-tool group removemembers "Domain Users" test01)

Expected Result:
samba-tool should refuse to remove the user from it's primary group with an error message.

Actual Result:
samba-tool claims the user has been removed (eg. "Removed members from group Domain Users") but in fact it has not.