Author: jelmer Date: 2007-12-02 17:09:43 +0000 (Sun, 02 Dec 2007) New Revision: 26226
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26226 Log: Avoid more uses of global_loadparm. Modified: branches/SAMBA_4_0/ branches/SAMBA_4_0/source/auth/auth_unix.c branches/SAMBA_4_0/source/auth/gensec/gensec.c branches/SAMBA_4_0/source/auth/gensec/gensec.h branches/SAMBA_4_0/source/client/cifsdd.c branches/SAMBA_4_0/source/client/client.c branches/SAMBA_4_0/source/lib/ldb/tools/cmdline.c branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c branches/SAMBA_4_0/source/scripting/ejs/smbscript.c branches/SAMBA_4_0/source/smbd/server.c branches/SAMBA_4_0/source/torture/gentest.c branches/SAMBA_4_0/source/torture/locktest.c branches/SAMBA_4_0/source/torture/masktest.c branches/SAMBA_4_0/source/utils/ntlm_auth.c Changeset: Property changes on: branches/SAMBA_4_0 ___________________________________________________________________ Name: bzr:revision-info ...skipped... Name: bzr:revision-id:v3-trunk0 ...skipped... Modified: branches/SAMBA_4_0/source/auth/auth_unix.c =================================================================== --- branches/SAMBA_4_0/source/auth/auth_unix.c 2007-12-02 16:20:41 UTC (rev 26225) +++ branches/SAMBA_4_0/source/auth/auth_unix.c 2007-12-02 17:09:43 UTC (rev 26226) @@ -427,7 +427,8 @@ 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 @@ #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 @@ 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 @@ #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 @@ 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; Modified: branches/SAMBA_4_0/source/auth/gensec/gensec.c =================================================================== --- branches/SAMBA_4_0/source/auth/gensec/gensec.c 2007-12-02 16:20:41 UTC (rev 26225) +++ branches/SAMBA_4_0/source/auth/gensec/gensec.c 2007-12-02 17:09:43 UTC (rev 26226) @@ -1259,7 +1259,7 @@ /* initialise the GENSEC subsystem */ -NTSTATUS gensec_init(void) +NTSTATUS gensec_init(struct loadparm_context *lp_ctx) { static bool initialized = false; @@ -1269,7 +1269,7 @@ 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); Modified: branches/SAMBA_4_0/source/auth/gensec/gensec.h =================================================================== --- branches/SAMBA_4_0/source/auth/gensec/gensec.h 2007-12-02 16:20:41 UTC (rev 26225) +++ branches/SAMBA_4_0/source/auth/gensec/gensec.h 2007-12-02 17:09:43 UTC (rev 26226) @@ -165,6 +165,8 @@ int sizeof_gensec_security; }; +struct loadparm_context; + #include "auth/gensec/gensec_proto.h" #endif /* __GENSEC_H__ */ Modified: branches/SAMBA_4_0/source/client/cifsdd.c =================================================================== --- branches/SAMBA_4_0/source/client/cifsdd.c 2007-12-02 16:20:41 UTC (rev 26225) +++ branches/SAMBA_4_0/source/client/cifsdd.c 2007-12-02 17:09:43 UTC (rev 26226) @@ -574,7 +574,7 @@ } } - gensec_init(); + gensec_init(global_loadparm); dump_args(); if (check_arg_numeric("ibs") == 0 || check_arg_numeric("ibs") == 0) { Modified: branches/SAMBA_4_0/source/client/client.c =================================================================== --- branches/SAMBA_4_0/source/client/client.c 2007-12-02 16:20:41 UTC (rev 26225) +++ branches/SAMBA_4_0/source/client/client.c 2007-12-02 17:09:43 UTC (rev 26226) @@ -3180,7 +3180,7 @@ } } - gensec_init(); + gensec_init(global_loadparm); if(poptPeekArg(pc)) { char *s = strdup(poptGetArg(pc)); Modified: branches/SAMBA_4_0/source/lib/ldb/tools/cmdline.c =================================================================== --- branches/SAMBA_4_0/source/lib/ldb/tools/cmdline.c 2007-12-02 16:20:41 UTC (rev 26225) +++ branches/SAMBA_4_0/source/lib/ldb/tools/cmdline.c 2007-12-02 17:09:43 UTC (rev 26226) @@ -31,11 +31,12 @@ #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 @@ #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; Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c =================================================================== --- branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c 2007-12-02 16:20:41 UTC (rev 26225) +++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c 2007-12-02 17:09:43 UTC (rev 26226) @@ -28,10 +28,11 @@ #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; } Modified: branches/SAMBA_4_0/source/scripting/ejs/smbscript.c =================================================================== --- branches/SAMBA_4_0/source/scripting/ejs/smbscript.c 2007-12-02 16:20:41 UTC (rev 26225) +++ branches/SAMBA_4_0/source/scripting/ejs/smbscript.c 2007-12-02 17:09:43 UTC (rev 26226) @@ -60,7 +60,7 @@ ldb_global_init(); - gensec_init(); + gensec_init(global_loadparm); mprSetCtx(mem_ctx); Modified: branches/SAMBA_4_0/source/smbd/server.c =================================================================== --- branches/SAMBA_4_0/source/smbd/server.c 2007-12-02 16:20:41 UTC (rev 26225) +++ branches/SAMBA_4_0/source/smbd/server.c 2007-12-02 17:09:43 UTC (rev 26226) @@ -286,7 +286,7 @@ 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? */ Modified: branches/SAMBA_4_0/source/torture/gentest.c =================================================================== --- branches/SAMBA_4_0/source/torture/gentest.c 2007-12-02 16:20:41 UTC (rev 26225) +++ branches/SAMBA_4_0/source/torture/gentest.c 2007-12-02 17:09:43 UTC (rev 26226) @@ -2265,7 +2265,7 @@ } } - gensec_init(); + gensec_init(global_loadparm); if (username_count == 0) { usage(); Modified: branches/SAMBA_4_0/source/torture/locktest.c =================================================================== --- branches/SAMBA_4_0/source/torture/locktest.c 2007-12-02 16:20:41 UTC (rev 26225) +++ branches/SAMBA_4_0/source/torture/locktest.c 2007-12-02 17:09:43 UTC (rev 26226) @@ -637,7 +637,7 @@ servers[1] = servers[0]; } - gensec_init(); + gensec_init(global_loadparm); argc -= optind; argv += optind; Modified: branches/SAMBA_4_0/source/torture/masktest.c =================================================================== --- branches/SAMBA_4_0/source/torture/masktest.c 2007-12-02 16:20:41 UTC (rev 26225) +++ branches/SAMBA_4_0/source/torture/masktest.c 2007-12-02 17:09:43 UTC (rev 26226) @@ -358,7 +358,7 @@ } } - gensec_init(); + gensec_init(global_loadparm); argc -= optind; argv += optind; Modified: branches/SAMBA_4_0/source/utils/ntlm_auth.c =================================================================== --- branches/SAMBA_4_0/source/utils/ntlm_auth.c 2007-12-02 16:20:41 UTC (rev 26225) +++ branches/SAMBA_4_0/source/utils/ntlm_auth.c 2007-12-02 17:09:43 UTC (rev 26226) @@ -1081,7 +1081,7 @@ return 1; } - gensec_init(); + gensec_init(global_loadparm); if (opt_domain == NULL) { opt_domain = lp_workgroup(global_loadparm);