r26226: Avoid more uses of global_loadparm.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 2 Dec 2007 16:09:43 +0000 (17:09 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:47:02 +0000 (05:47 +0100)
13 files changed:
source/auth/auth_unix.c
source/auth/gensec/gensec.c
source/auth/gensec/gensec.h
source/client/cifsdd.c
source/client/client.c
source/lib/ldb/tools/cmdline.c
source/librpc/rpc/dcerpc.c
source/scripting/ejs/smbscript.c
source/smbd/server.c
source/torture/gentest.c
source/torture/locktest.c
source/torture/masktest.c
source/utils/ntlm_auth.c

index d06c73cc3424a74f83c76fe957d77f4904076004..4cbe3723a8b6ae75f424e43065bda45f384a01ff 100644 (file)
@@ -427,7 +427,8 @@ static NTSTATUS smb_pam_setcred(pam_handle_t *pamh, const char * user)
        return pam_to_nt_status(pam_error);
 }
 
-static NTSTATUS check_unix_password(TALLOC_CTX *ctx, const struct auth_usersupplied_info *user_info, struct passwd **pws)
+static NTSTATUS check_unix_password(TALLOC_CTX *ctx, struct loadparm_context *lp_ctx, 
+                                   const struct auth_usersupplied_info *user_info, struct passwd **pws)
 {
        struct smb_pam_user_info *info;
        struct pam_conv *pamconv;
@@ -590,7 +591,8 @@ static NTSTATUS password_check(const char *username, const char *password,
 #endif /* HAVE_BIGCRYPT && HAVE_CRYPT && USE_BOTH_CRYPT_CALLS */
 }
 
-static NTSTATUS check_unix_password(TALLOC_CTX *ctx, const struct auth_usersupplied_info *user_info, struct passwd **ret_passwd)
+static NTSTATUS check_unix_password(TALLOC_CTX *ctx, struct loadparm_context *lp_ctx,
+                                   const struct auth_usersupplied_info *user_info, struct passwd **ret_passwd)
 {
        char *username;
        char *password;
@@ -599,7 +601,7 @@ static NTSTATUS check_unix_password(TALLOC_CTX *ctx, const struct auth_usersuppl
        char *crypted;
        struct passwd *pws;
        NTSTATUS nt_status;
-       int level = lp_passwordlevel(global_loadparm);
+       int level = lp_passwordlevel(lp_ctx);
 
        *ret_passwd = NULL;
 
@@ -702,7 +704,7 @@ static NTSTATUS check_unix_password(TALLOC_CTX *ctx, const struct auth_usersuppl
 #endif
 
        if (crypted[0] == '\0') {
-               if (!lp_null_passwords(global_loadparm)) {
+               if (!lp_null_passwords(lp_ctx)) {
                        DEBUG(2, ("Disallowing %s with null password\n", username));
                        return NT_STATUS_LOGON_FAILURE;
                }
@@ -802,7 +804,7 @@ static NTSTATUS authunix_check_password(struct auth_method_context *ctx,
                return NT_STATUS_NO_MEMORY;
        }
 
-       nt_status = check_unix_password(check_ctx, user_info, &pwd);
+       nt_status = check_unix_password(check_ctx, global_loadparm, user_info, &pwd);
        if (!NT_STATUS_IS_OK(nt_status)) {
                talloc_free(check_ctx);
                return nt_status;
index 4821e6a19bd39ef3e32789144fdd86cce76c6046..1da0cf631be980435132a2152bef41dfbd18de62 100644 (file)
@@ -1259,7 +1259,7 @@ static int sort_gensec(struct gensec_security_ops **gs1, struct gensec_security_
 /*
   initialise the GENSEC subsystem
 */
-NTSTATUS gensec_init(void)
+NTSTATUS gensec_init(struct loadparm_context *lp_ctx)
 {
        static bool initialized = false;
 
@@ -1269,7 +1269,7 @@ NTSTATUS gensec_init(void)
        if (initialized) return NT_STATUS_OK;
        initialized = true;
        
-       shared_init = load_samba_modules(NULL, global_loadparm, "gensec");
+       shared_init = load_samba_modules(NULL, lp_ctx, "gensec");
 
        run_init_functions(static_init);
        run_init_functions(shared_init);
index bda740cc86229e70998f9f1f23455ea64e5742c0..6263edd687d02acb8daed65f08e4f823befafa77 100644 (file)
@@ -165,6 +165,8 @@ struct gensec_critical_sizes {
        int sizeof_gensec_security;
 };
 
+struct loadparm_context;
+
 #include "auth/gensec/gensec_proto.h"
 
 #endif /* __GENSEC_H__ */
index 5735d127e4f0146a80a8d8c921dd30afce01d367..a48235d047862ce33bf441c5b4c1cfb6fde07799 100644 (file)
@@ -574,7 +574,7 @@ int main(int argc, const char ** argv)
                }
        }
 
-       gensec_init();
+       gensec_init(global_loadparm);
        dump_args();
 
        if (check_arg_numeric("ibs") == 0 || check_arg_numeric("ibs") == 0) {
index 44153616028c300a05bf54d0b0aed0e8d2883389..571caa68dbd5887861ea1bfb6338603c7b16941e 100644 (file)
@@ -3180,7 +3180,7 @@ static int do_message_op(const char *desthost, const char *destip, int name_type
                }
        }
 
-       gensec_init();
+       gensec_init(global_loadparm);
 
        if(poptPeekArg(pc)) {
                char *s = strdup(poptGetArg(pc)); 
index 01ef04f5d2d230737a1d53f51ee8cf76029d5240..5e3013600a2e949693dd083b271deb50d105c3c4 100644 (file)
 #include "auth/gensec/gensec.h"
 #include "auth/auth.h"
 #include "ldb_wrap.h"
+#include "param/param.h"
 #endif
 
 
 
-/*
+/**
   process command line options
 */
 struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, int argc, const char **argv,
@@ -208,7 +209,7 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, int argc, const
 
 #if (_SAMBA_BUILD_ >= 4)
        /* Must be after we have processed command line options */
-       gensec_init(); 
+       gensec_init(global_loadparm); 
        
        if (ldb_set_opaque(ldb, "sessionInfo", system_session(ldb))) {
                goto failed;
index ef63cb381bb839f739f155745ac2289a779023a9..74dc2562ed11bfad396d3ed21b97d07412415c5a 100644 (file)
 #include "librpc/gen_ndr/ndr_dcerpc.h"
 #include "libcli/composite/composite.h"
 #include "auth/gensec/gensec.h"
+#include "param/param.h"
 
 NTSTATUS dcerpc_init(void)
 {
-       gensec_init();
+       gensec_init(global_loadparm);
 
        return NT_STATUS_OK;
 }
index 29ce763f96667931cd72a97e1613cfcfeb142674..db6e0eeb10d95ba86dabac79fb1a06051fc21d3d 100644 (file)
@@ -60,7 +60,7 @@ int main(int argc, const char **argv)
 
        ldb_global_init();
 
-       gensec_init();
+       gensec_init(global_loadparm);
        mprSetCtx(mem_ctx);
 
 
index 8f5c3b66ecd8311d094a6eb801511d23a259076f..5dac250ee85fc818b3883a2a96a37eb9616b7049 100644 (file)
@@ -286,7 +286,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
 
        share_init();
 
-       gensec_init(); /* FIXME: */
+       gensec_init(global_loadparm); /* FIXME: */
 
        ntptr_init();   /* FIXME: maybe run this in the initialization function 
                                                of the spoolss RPC server instead? */
index 79eb7eb0e900b1c44c75117ab9b31a9b268c407e..132cfd61343b94953c0725b0fcc32cfbb4dccdf1 100644 (file)
@@ -2265,7 +2265,7 @@ static bool split_unc_name(const char *unc, char **server, char **share)
                }
        }
 
-       gensec_init();
+       gensec_init(global_loadparm);
 
        if (username_count == 0) {
                usage();
index 24b960696104c7a4407a0803cc662dd5dec65606..810a21cb9e6b0cf74405b8f93430bd9a5a2321af 100644 (file)
@@ -637,7 +637,7 @@ static void usage(void)
                servers[1] = servers[0];
        }
 
-       gensec_init();
+       gensec_init(global_loadparm);
 
        argc -= optind;
        argv += optind;
index fec7657afea1da7b7f9c309c673931546cdcd6db..d9ac27111954f7cc977d618e59a0efcd7c0e4ff6 100644 (file)
@@ -358,7 +358,7 @@ static void usage(void)
                }
        }
 
-       gensec_init();
+       gensec_init(global_loadparm);
 
        argc -= optind;
        argv += optind;
index c51b35aa0309aab4272a9ca0945ee1eba282a9cd..80ecfff572a3d866cf6777297b72eaf2647e12bb 100644 (file)
@@ -1081,7 +1081,7 @@ int main(int argc, const char **argv)
                return 1;
        }
 
-       gensec_init();
+       gensec_init(global_loadparm);
 
        if (opt_domain == NULL) {
                opt_domain = lp_workgroup(global_loadparm);