The Samba-Bugzilla – Bug 11180
Samba standard process model closes random files when forking more than once
Last modified: 2015-04-09 19:23:24 UTC
The Samba standard process model closes random files when forking more than once.
The issue has been found with nss_wrapper debug output running:
In the case here, we fork a child and close the fd without resetting
the pipe fd variable. Then the fd was used to open the nss_wrapper
hosts file which got the same fd. We forked again in the process model
called close() on the re-used fd (of the pipe variable) again without
nss_wrapper noticing. Now Samba opened the secrets tdb and got
the same fd as nss_wrapper was using for the hosts file and next
nss_wrapper tried to parse a TDB ...
Andreas, can you point at any specific source code lines inside source4/ so I can start to investigate and fix this ? Would save me some time.
(In reply to Jeremy Allison from comment #2)
Jeremy we already fixed it:
comment #1 is the commit message from master.
Will attach backported patch...
Ah, I didn't see any attachment or git refspec :-).
Maybe you could add it here ?
Oh, I was about to but it is still in autobuild (by andreas):
After all, it was only fixed today. :)
Will attach stuff once it's through.
Created attachment 10921 [details]
Patch for 4.2, cherry-picked from master.
Created attachment 10922 [details]
Patch for 4.1, cherry-picked from master
Karo, please add the patches to the relevant branches. Thanks!
Pushed to autobuild-v4-[1|2]-test.
(In reply to Karolin Seeger from comment #9)
Pushed to both branches.
Closing out bug report.