Bug 14141 - getpwnam and getpwuid need to return data for ID_TYPE_BOTH group
Summary: getpwnam and getpwuid need to return data for ID_TYPE_BOTH group
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Winbind (show other bugs)
Version: 4.6.0
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-25 17:15 UTC by Christof Schmitt
Modified: 2019-10-17 07:53 UTC (History)
1 user (show)

See Also:


Attachments
Patches for 4.10 (8.23 KB, patch)
2019-09-27 22:07 UTC, Christof Schmitt
metze: review+
Details
Patches for 4.11 (8.23 KB, patch)
2019-09-27 22:07 UTC, Christof Schmitt
metze: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christof Schmitt 2019-09-25 17:15:49 UTC
This was working in Samba 4.5:

$ getent passwd "$DOMAIN/Domain Users"
ADDOMAIN/domain users:*:2000513:2000513::/home/ADDOMAIN/domain users:/bin/false
$ echo $?
0

$ getent passwd 2000513
ADDOMAIN/domain users:*:2000513:2000513::/home/ADDOMAIN/domain users:/bin/false
$ echo $?
0

$ ls -l testfile\
-rw-rw-r--. 1 ADDOMAIN/domain users ADDOMAIN/domain admins 0 Sep 23 12:24 testfile

And stopped working in Samba 4.6 and newer versions:

$ getent passwd "$DOMAIN/Domain Users"
$ echo $?
2

$ getent passwd 2000513
$ echo $?
2

$ ls -l testfile
-rw-r--r--. 1 2000513 ADDOMAIN/domain admins 0 Sep 23 12:30 testfile

It looks like the behavior was introduced for Samba 4.5 through commit
394622ef8c916cf361f8596dba4664dc8d6bfc9e
    s3:winbindd: change getpwsid() to return a passwd struct for a group sid id-mapped with ID_TYPE_BOTH

and then changed for Samba 4.6 through the patches around
bce19a6efe11980933531f0349c8f5212419366a
    winbind: Restructure wb_getpwsid
Comment 1 Christof Schmitt 2019-09-27 22:07:34 UTC
Created attachment 15500 [details]
Patches for 4.10
Comment 2 Christof Schmitt 2019-09-27 22:07:57 UTC
Created attachment 15501 [details]
Patches for 4.11
Comment 3 Karolin Seeger 2019-10-01 07:24:42 UTC
Pushed to autobuild-v4-{11,10}-test.
Comment 4 Karolin Seeger 2019-10-17 07:53:32 UTC
(In reply to Karolin Seeger from comment #3)
Pushed to both branches.
Closing out bug report.

Thanks!