mirror of
https://github.com/samba-team/samba.git
synced 2025-11-05 04:23:51 +03:00
r26226: Avoid more uses of global_loadparm.
This commit is contained in:
committed by
Stefan Metzmacher
parent
98c29e090f
commit
6cbce47a3e
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -165,6 +165,8 @@ struct gensec_critical_sizes {
|
||||
int sizeof_gensec_security;
|
||||
};
|
||||
|
||||
struct loadparm_context;
|
||||
|
||||
#include "auth/gensec/gensec_proto.h"
|
||||
|
||||
#endif /* __GENSEC_H__ */
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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 @@ 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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ int main(int argc, const char **argv)
|
||||
|
||||
ldb_global_init();
|
||||
|
||||
gensec_init();
|
||||
gensec_init(global_loadparm);
|
||||
mprSetCtx(mem_ctx);
|
||||
|
||||
|
||||
|
||||
@@ -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? */
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -637,7 +637,7 @@ static void usage(void)
|
||||
servers[1] = servers[0];
|
||||
}
|
||||
|
||||
gensec_init();
|
||||
gensec_init(global_loadparm);
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
@@ -358,7 +358,7 @@ static void usage(void)
|
||||
}
|
||||
}
|
||||
|
||||
gensec_init();
|
||||
gensec_init(global_loadparm);
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user