Assume we are in a domain 'pet.net',we have a domain controller named 'cat.pet.net', pre-win2k domain name is 'pet' Config samba to access this domain. Start winbind. Run cmd 'wbinfo -D pet', we got: --------------------8<--------------------------------------- Name : PET Alt_Name : cat.pet.net SID : S-1-5-21-309666555-3165270563-1912345678 Active Directory : YES Native : No Primary : No -------------------->8--------------------------------------- Turn off domain controler or disconect domain controller, run the command again. Sometime the result will filp over randanmly. --------------------8<--------------------------------------- Name : PET Alt_Name : cat.pet.net SID : S-1-5-21-309666555-3165270563-1912345678 Active Directory : NO Native : YES Primary : YES -------------------->8--------------------------------------- The following three bits will have random output --------------------8<--------------------------------------- Active Directory : YES Native : No Primary : No -------------------->8--------------------------------------- The root cause is the domain flag is not zeroed out properly before we use it. The fix is: (in function 'wbcDomainInfo', line number may not be accurate) --------------------8<--------------------------------------- source/nsswitch/libwbclient/wbc_util.c @@ -169,6 +169,7 @@ &info->sid); BAIL_ON_WBC_ERROR(wbc_status); + info->domain_flags = 0; if (response.data.domain_info.native_mode) info->domain_flags |= WBC_DOMINFO_DOMAIN_NATIVE; if (response.data.domain_info.active_directory) -------------------->8--------------------------------------- This bug exists in all current samba branches. Please port the fix to all branches. I believe it is the root cause of bug #4872.
Additional code review: We have the same issue in the function 'process_domain_info_string'. + info->domain_flags = 0; if ( strcmp(r, "Offline") == 0) { info->domain_flags |= WBC_DOMINFO_DOMAIN_OFFLINE; } Further suggestion: Review all talloc callings to make sure we did not leave uninitialized struct alone. Also we should have a tcalloc function to prevent any similar problems.
This same bug happens when wbinfo -D is run against a Samba PDC running 3.4.0.
Created attachment 4611 [details] Patch for 3.4 Can you try the attached patch for 3.4? Thanks, Volker
Created attachment 4612 [details] Patch for 3.3
I tried very hard to reproduce this but couldnt. Given that the patch surely does the right thing, I'd say we pick it for 3.4/3.3.
Pushed. Closing out bug report. Please reopen if it's still an issue. Thanks!
Karolin, This is a totally reproducible problem in every site I have worked at in the last month. I can reproduce it on my own network at will. If you need access to my network let me know - I will gladly give you root-level access. Here is the result of running "wbinfo -D MIDEARTH" in rapid succession. You will see that wbinfo sometimes thinks that Samba 3.4.1 is ADS and it can not make up its mind (not that it has one!) whether or not Samba 3.4.1 is native mode. Here we go: atastore:~ # wbinfo -D MIDEARTH Name : MIDEARTH Alt_Name : SID : S-1-5-21-726309263-4128913605-1168186429 Active Directory : Yes Native : Yes Primary : Yes datastore:~ # wbinfo -D MIDEARTH Name : MIDEARTH Alt_Name : SID : S-1-5-21-726309263-4128913605-1168186429 Active Directory : No Native : No Primary : Yes datastore:~ # wbinfo -D MIDEARTH Name : MIDEARTH Alt_Name : SID : S-1-5-21-726309263-4128913605-1168186429 Active Directory : Yes Native : No Primary : Yes datastore:~ # wbinfo -D MIDEARTH Name : MIDEARTH Alt_Name : SID : S-1-5-21-726309263-4128913605-1168186429 Active Directory : No Native : No Primary : Yes datastore:~ # wbinfo -D MIDEARTH Name : MIDEARTH Alt_Name : SID : S-1-5-21-726309263-4128913605-1168186429 Active Directory : Yes Native : Yes Primary : Yes
Günther, any ideas?
looking...
John, could you please describe a little more your setup. Is that really running 3.4.1 (and also 3.4.1 libwbclient) running ? Does this happen with winbindd on a samba pdc? Or with winbindd on a member ?
At least here with 3.4.1 winbind on a pdc (with two w2k8 trusts) and 3.4.1 winbindd on a member server in the 3.4.1 domain I cannot reproduce this.
(In reply to comment #10) > John, could you please describe a little more your setup. Is that really > running 3.4.1 (and also 3.4.1 libwbclient) running ? It really is running 3.4.1 (from the OpenSUSE site). I recompiled the SRPM and have the same problem with the RPMs I built on this system. Yes, all files built are up to date. > Does this happen with winbindd on a samba pdc? Or with winbindd on a member ? This is on the PDC where winbindd is running. I can not reproduce this on a member. The PDC is running 3.4.1. - John T.
Created attachment 4680 [details] smb.conf from PDC - output of 'net conf list'
Fix (from volker) has been pushed to master, 3.4 and 3.3. Closing as fixed, please reopen if still an issue.