s3-auth Use loadparm_init_s3() to get an lp_ctx for auth_samba4
authorAndrew Bartlett <abartlet@samba.org>
Mon, 6 Jun 2011 23:09:16 +0000 (09:09 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 6 Jun 2011 23:11:01 +0000 (09:11 +1000)
This avoids loading the smb.conf twice.

Andrew Bartlett

source3/auth/auth_samba4.c

index 57c07dd7165b2ad5c1a7212eb55a2d32ecfcbc5b..a4673db3c9236d110e71d189feb410268e5e4df7 100644 (file)
@@ -42,22 +42,9 @@ static NTSTATUS check_samba4_security(const struct auth_context *auth_context,
        struct loadparm_context *lp_ctx;
        const char *config_file;
 
-       lp_ctx = loadparm_init(frame);
+       lp_ctx = loadparm_init_s3(frame, loadparm_s3_context());
        if (lp_ctx == NULL) {
-               DEBUG(10, ("loadparm_init failed\n"));
-               talloc_free(frame);
-               return NT_STATUS_INVALID_SERVER_STATE;
-       }
-
-       if (lp_loaded()) {
-               config_file = lp_configfile();
-       }
-       if (!config_file || !config_file[0]) {
-               config_file = get_dyn_CONFIGFILE();
-       }
-
-       if (!lpcfg_load(lp_ctx, config_file)) {
-               DEBUG(1, ("s4 lpcfg_load() of s3 config file %s failed", config_file));
+               DEBUG(10, ("loadparm_init_s3 failed\n"));
                talloc_free(frame);
                return NT_STATUS_INVALID_SERVER_STATE;
        }