selftest: fix creation of builtin users in wait_for_start
authorRalph Boehme <slow@samba.org>
Mon, 8 Jan 2018 17:38:08 +0000 (18:38 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 10 Jan 2018 00:01:24 +0000 (01:01 +0100)
commit0f5b1bd9e2d16702a7be674fcd4ba4328d6befc1
tree0e7b8fe6f9d2fe223c38f8e352e8799eeeb777da
parenta206cf2dc11159b0e9ebe4d1d1d23e4365bd2a8c
selftest: fix creation of builtin users in wait_for_start

If "BUILTIN\Users" already exists, attempting to create it would fail,
so we should check for the existence prior to the creation.

It is unclear *why* the mapping sometimes already exist and sometime
not. There are two places where they would have been created:

1. libnet_join_add_dom_rids_to_builtins tries to add the mapping when
joining a domain, but at that point winbindd isn't running

2. when a user is authenticated in smbd, which clearly can't have
happended when in the function wait_for_start

Go figure...

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
selftest/target/Samba3.pm