pam_winbind: Fix CID 242274 Time of check time of use
commitfd364b01e2defb5f48238db64d3ef7f6d828c517
authorChristof Schmitt <cs@samba.org>
Thu, 9 Jul 2020 03:03:44 +0000 (8 20:03 -0700)
committerChristof Schmitt <cs@samba.org>
Fri, 17 Jul 2020 17:12:33 +0000 (17 17:12 +0000)
tree2c58e58d93662379ca7c1d4487ecdf983bb07d15
parent71b7140fd0a33e7e8c5bf37c2897cea8224b3f01
pam_winbind: Fix CID 242274 Time of check time of use

Always issue the mkdir call to avoid the TOCTOU issue. Only if there is
already an object with the requested name, check whether it is a
directory.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
nsswitch/pam_winbind.c