RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2059151 - /etc/samba/smbusers erroneously applies unix group memberships to user account entries
Summary: /etc/samba/smbusers erroneously applies unix group memberships to user accoun...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: samba
Version: CentOS Stream
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Pavel Filipensky
QA Contact: Denis Karpelevich
URL:
Whiteboard:
Depends On:
Blocks: 2074891 2078914 2078915 2079303
TreeView+ depends on / blocked
 
Reported: 2022-02-28 10:28 UTC by D. Moens
Modified: 2022-11-08 12:25 UTC (History)
8 users (show)

Fixed In Version: samba-4.15.5-6.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2074891 2078914 2079303 (view as bug list)
Environment:
Last Closed: 2022-11-08 10:45:48 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-113982 0 None None None 2022-02-28 10:29:13 UTC
Red Hat Issue Tracker SSSD-4528 0 None None None 2022-03-30 09:34:15 UTC
Red Hat Product Errata RHBA-2022:7698 0 None None None 2022-11-08 10:46:39 UTC
Samba Project 15041 0 None None None 2022-04-06 08:24:05 UTC

Description D. Moens 2022-02-28 10:28:24 UTC
Description of problem:

Since a recent Samba upgrade (4.14 / 4.15 ?), unix group membership rules are erroneously applied to /etc/samba/smbuser unix user accounts (i.e. entries without the '@' prefix).


Version-Release number of selected component (if applicable):

Tested with latest samba-4.15.5-3.el8.x86_64


How reproducible:

Always


Steps to Reproduce:
1. /etc/samba/smbusers entry : "root = administrator admin"
2. start a Samba session with a Samba user account belonging to the Unix group "admin"


Actual results:

User access is refused


Expected results:

User should be granted access


Additional info:

1. user "didier" is member of the unix group "admin". The user is mapped to the 'root'-account, which does not have a valid Samba account ; hence access is denied.

[2022/02/28 09:53:40.769579,  3, pid=4179984, effective(0, 0), real(0, 0), class=auth] ../../source3/auth/auth.c:202(auth_check_ntlm_password)
  check_ntlm_password:  Checking password for unmapped user [SAMBA]\[didier]@[CP0043] with the new password interface
[2022/02/28 09:53:40.769593,  3, pid=4179984, effective(0, 0), real(0, 0), class=auth] ../../source3/auth/auth.c:205(auth_check_ntlm_password)
  check_ntlm_password:  mapped user is: [SAMBA]\[root]@[CP0043]
[2022/02/28 09:53:40.770828,  3, pid=4179984, effective(0, 0), real(0, 0), class=auth] ../../source3/auth/check_samsec.c:399(check_sam_security)
  check_sam_security: Couldn't find user 'root' in passdb.
[2022/02/28 09:53:40.770854,  2, pid=4179984, effective(0, 0), real(0, 0), class=auth] ../../source3/auth/auth.c:348(auth_check_ntlm_password)
  check_ntlm_password:  Authentication for user [didier] -> [root] FAILED with error NT_STATUS_NO_SUCH_USER, authoritative=1

2. https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html#USERNAMEMAP states : "The list of usernames on the right may contain names of the form @group in which case they will match any UNIX username in that group."

The @-prefix is not present, nevertheless group membership rules are applied.


3. Mitigation : 
3a. accounts which are not a member of unix group "admin" are granted access ;
3b. commenting out the "root = administrator admin" smbusers entry grants access to members of unix group "admin".



4. Summary :
It seems (unwanted) group membership rules are applied *without* the "@" prefix.

Comment 1 Pavel Filipensky 2022-04-06 08:24:05 UTC
Fix is in progress. Bug was created in samba upstream:
https://bugzilla.samba.org/show_bug.cgi?id=15041

Comment 2 Pavel Filipensky 2022-04-13 08:57:43 UTC
Patch for samba-4.15 and samba-4.16 ready. Plan is to fix it in RHEL 8.7 and 9.1 and then to create zstream bugs for 8.6 and 9.0.

Comment 9 errata-xmlrpc 2022-11-08 10:45:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (samba bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:7698


Note You need to log in before you can comment on or make changes to this bug.