Originally posted by: iGadget
Hi Ayappan,
I hope you can help here.
I hit the same "getgrset returned (NULL)" with ADS security option.
I'm trying with Samba 4.10.6 and 4.6.11 on AIX 7.1
We also have VAS integration (OneIdentity) which provides access to AD users on UNIX systems.
But to share AIX files to Windows clients I need also SAMBA which is integrated with VAS.
All users from all domains are correctly authenticated over SAMBA winbind:
[2019/12/03 12:46:59.361732, 3] ../source3/auth/auth.c:249(auth_check_ntlm_password)
check_ntlm_password: winbind authentication for user [***] succeeded
[2019/12/03 12:46:59.361809, 2] ../source3/auth/auth.c:305(auth_check_ntlm_password)
check_ntlm_password: authentication for user [***] -> [***] -> [domain\***] succeeded
Bust just the users which are local UNIX or UNIX-enabled over VAS (means both have UID/GID) are able to browse the defined shares.
All pure AD users are not able to. Winbind assigns them ID from the idmap range, but as you mentioned in your other post seems the connection between smb and winbind gets broken.
[2019/12/03 12:46:59.816463, 0] ../source3/lib/system_smbd.c:226(getgroups_unix_user)
get_user_groups: failed to get the unix group list
[2019/12/03 12:46:59.816579, 1] ../source3/auth/token_util.c:463(add_local_groups)
getgroups_unix_user for user *** failed
If I add the above AD user in /etc/passwd (having UID/GID) - it is working, but it makes no sense do the same for thousands of users.
wbinfo is working just fine.
"wbinfo -r *** " works fine, most of the time.
What I noticed when running "smbd -b" is that all SAMBA 4 versions are compiled with HAVE_* Defines: HAVE_GETGRSET
While on SAMBA 3 version from PWARE it is not there and the access to shares by pure AD users is fine.
The same is missing also on SAMBA 4.9.x RedHat package and also no issue.
Is it possible that this HAVE_GETGRSET compiled for AIX can cause that issue "getgrset returned (NULL)" for AD accounts without UID/GID?
Is it possible to compile a SAMBA version without it? Or this is essential, but it is a bug?
In the example below we see that if "getgrset" returns NULL then it is not binding "domain users" (GID 60000) at all while if it returns one UNIX group then if says 2 groups are found and performs the mapping GID to SID. Bug?
Thanks in advance.
log.smbd v4.6.11 debug log for the same pure AD user added locally on AIX in /etc/passwd and then removed locally.
GID 1 is "staff" group on AIX. UID/GID 60083 / 60000 are the ones mapped by WINBIND for the user ***
Working one with AD user *** in /etc/passwd:
[2019/12/03 13:23:56.707310, 5, pid=9502938, effective(0, 0), real(0, 0)] ../libcli/security/security_token.c:53(security_token_debug)
Security token: (NULL)
[2019/12/03 13:23:56.707353, 5, pid=9502938, effective(0, 0), real(0, 0)] ../source3/auth/token_util.c:640(debug_unix_user_token)
UNIX token of user 0
Primary group is 0 and contains 0 supplementary groups
[2019/12/03 13:23:56.707430, 4, pid=9502938, effective(0, 0), real(0, 0)] ../source3/smbd/sec_ctx.c:438(pop_sec_ctx)
pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0
[2019/12/03 13:23:56.709167, 10, pid=9502938, effective(0, 0), real(0, 0)] ../source3/auth/token_util.c:225(create_local_nt_token_from_info3)
Create local NT token for ***
[2019/12/03 13:23:56.727424, 10, pid=9502938, effective(0, 0), real(0, 0)] ../source3/lib/idmap_cache.c:56(idmap_cache_find_sid2unixid)
Parsing value for key [IDMAP/SID2XID/S-1-5-21-4153117351-1444607597-2867050581-531324]: value=[60083:U]
[2019/12/03 13:23:56.727487, 10, pid=9502938, effective(0, 0), real(0, 0)] ../source3/lib/idmap_cache.c:75(idmap_cache_find_sid2unixid)
Parsing value for key [IDMAP/SID2XID/S-1-5-21-4153117351-1444607597-2867050581-531324]: id=[60083], endptr=[:U]
[2019/12/03 13:23:56.727610, 10, pid=9502938, effective(0, 0), real(0, 0)] ../source3/passdb/lookup_sid.c:1503(sid_to_uid)
sid S-1-5-21-4153117351-1444607597-2867050581-531324 -> uid 60083
[2019/12/03 13:23:56.780444, 10, pid=9502938, effective(0, 0), real(0, 0)] ../source3/lib/system_smbd.c:176(sys_getgrouplist)
sys_getgrouplist: user [***]
[2019/12/03 13:23:56.781951, 10, pid=9502938, effective(0, 0), real(0, 0)] ../source3/lib/system_smbd.c:46(getgrouplist_getgrset)
getgrset returned 1
[2019/12/03 13:23:56.782004, 10, pid=9502938, effective(0, 0), real(0, 0)] ../source3/lib/system_smbd.c:76(getgrouplist_getgrset)
Found 2 groups for user ***
[2019/12/03 13:23:56.782544, 10, pid=9502938, effective(0, 0), real(0, 0)] ../source3/passdb/lookup_sid.c:1335(gid_to_sid)
gid 60000 -> sid S-1-5-21-4153117351-1444607597-2867050581-513
[2019/12/03 13:23:56.782663, 10, pid=9502938, effective(0, 0), real(0, 0)] ../source3/passdb/lookup_sid.c:1335(gid_to_sid)
gid 1 -> sid S-1-22-2-1
Not working one without AD user in /etc/passwd:
[2019/12/03 13:32:50.003937, 5, pid=23003374, effective(0, 0), real(0, 0)] ../libcli/security/security_token.c:53(security_token_debug)
Security token: (NULL)
[2019/12/03 13:32:50.003982, 5, pid=23003374, effective(0, 0), real(0, 0)] ../source3/auth/token_util.c:640(debug_unix_user_token)
UNIX token of user 0
Primary group is 0 and contains 0 supplementary groups
[2019/12/03 13:32:50.004061, 4, pid=23003374, effective(0, 0), real(0, 0)] ../source3/smbd/sec_ctx.c:438(pop_sec_ctx)
pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0
[2019/12/03 13:32:50.014387, 10, pid=23003374, effective(0, 0), real(0, 0)] ../source3/auth/token_util.c:225(create_local_nt_token_from_info3)
Create local NT token for ***
[2019/12/03 13:32:50.016774, 10, pid=23003374, effective(0, 0), real(0, 0)] ../source3/lib/idmap_cache.c:56(idmap_cache_find_sid2unixid)
Parsing value for key [IDMAP/SID2XID/S-1-5-21-4153117351-1444607597-2867050581-531324]: value=[60083:U]
[2019/12/03 13:32:50.016836, 10, pid=23003374, effective(0, 0), real(0, 0)] ../source3/lib/idmap_cache.c:75(idmap_cache_find_sid2unixid)
Parsing value for key [IDMAP/SID2XID/S-1-5-21-4153117351-1444607597-2867050581-531324]: id=[60083], endptr=[:U]
[2019/12/03 13:32:50.016897, 10, pid=23003374, effective(0, 0), real(0, 0)] ../source3/passdb/lookup_sid.c:1503(sid_to_uid)
sid S-1-5-21-4153117351-1444607597-2867050581-531324 -> uid 60083
[2019/12/03 13:32:50.051292, 10, pid=23003374, effective(0, 0), real(0, 0)] ../source3/lib/system_smbd.c:176(sys_getgrouplist)
sys_getgrouplist: user [***]
[2019/12/03 13:32:50.564092, 10, pid=23003374, effective(0, 0), real(0, 0)] ../source3/lib/system_smbd.c:46(getgrouplist_getgrset)
getgrset returned (NULL)
[2019/12/03 13:32:50.564182, 10, pid=23003374, effective(0, 0), real(0, 0)] ../source3/lib/system_smbd.c:176(sys_getgrouplist)
sys_getgrouplist: user [***]
[2019/12/03 13:32:50.566302, 10, pid=23003374, effective(0, 0), real(0, 0)] ../source3/lib/system_smbd.c:46(getgrouplist_getgrset)
getgrset returned (NULL)
[2019/12/03 13:32:50.566357, 0, pid=23003374, effective(0, 0), real(0, 0)] ../source3/lib/system_smbd.c:226(getgroups_unix_user)
get_user_groups: failed to get the unix group list
[2019/12/03 13:32:50.566465, 1, pid=23003374, effective(0, 0), real(0, 0)] ../source3/auth/token_util.c:463(add_local_groups)
getgroups_unix_user for user *** failed
[2019/12/03 13:32:50.566545, 3, pid=23003374, effective(0, 0), real(0, 0)] ../source3/auth/token_util.c:317(create_local_nt_token_from_info3)
Failed to finalize nt token
[2019/12/03 13:32:50.566590, 10, pid=23003374, effective(0, 0), real(0, 0)] ../source3/auth/auth_ntlmssp.c:86(auth3_generate_session_info)
create_local_token failed: NT_STATUS_UNSUCCESSFUL