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 2074891 - /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 9
Classification: Red Hat
Component: samba
Version: 9.1
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Andreas Schneider
QA Contact: Denis Karpelevich
URL:
Whiteboard:
Depends On: 2059151 2078914
Blocks: 2078915 2079302
TreeView+ depends on / blocked
 
Reported: 2022-04-13 09:39 UTC by Pavel Filipensky
Modified: 2022-11-15 13:05 UTC (History)
10 users (show)

Fixed In Version: samba-4.15.5-105.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2059151
: 2078915 2079302 (view as bug list)
Environment:
Last Closed: 2022-11-15 11:16:46 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-118785 0 None None None 2022-04-13 09:47:53 UTC
Red Hat Issue Tracker SSSD-4568 0 None None None 2022-04-13 12:08:37 UTC
Red Hat Product Errata RHSA-2022:8317 0 None None None 2022-11-15 11:17:10 UTC
Samba Project 15041 0 None None None 2022-04-13 09:39:38 UTC

Description Pavel Filipensky 2022-04-13 09:39:39 UTC
+++ This bug was initially created as a clone of Bug #2059151 +++

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.

--- Additional comment from Pavel Filipensky on 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

--- Additional comment from Pavel Filipensky on 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-15 11:16:46 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 (Moderate: samba security, 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/RHSA-2022:8317


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