s3:schannel Open the schannel_state.tdb at startup
authorAndrew Bartlett <abartlet@samba.org>
Wed, 23 Jun 2010 00:36:32 +0000 (10:36 +1000)
committerJeremy Allison <jra@samba.org>
Fri, 25 Jun 2010 18:58:28 +0000 (11:58 -0700)
This will allow future TDB_CLEAR_IF_FIRST behaviour

Signed-off-by: Jeremy Allison <jra@samba.org>
source3/smbd/server.c

index 2bb0bb87fe99d31682b290d8c4cf0e9efa31db3a..03fd9aa79de6f156f9e70bbe68aa6beb96c8ae5f 100644 (file)
@@ -25,6 +25,7 @@
 #include "smbd/globals.h"
 #include "librpc/gen_ndr/messaging.h"
 #include "registry.h"
+#include "libcli/auth/schannel.h"
 
 static_decl_rpc;
 
@@ -1023,6 +1024,13 @@ extern void build_options(bool screen);
                exit(1);
        }
 
+       if (lp_server_role() == ROLE_DOMAIN_BDC || lp_server_role() == ROLE_DOMAIN_PDC) {
+               if (!open_schannel_session_store(talloc_autofree_context(), lp_private_dir())) {
+                       DEBUG(0,("ERROR: Samba cannot open schannel store for secured NETLOGON operations.\n"));
+                       exit(1);
+               }
+       }
+
        if(!get_global_sam_sid()) {
                DEBUG(0,("ERROR: Samba cannot create a SAM SID.\n"));
                exit(1);