mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
r26272: Remove global_loadparm in some more places.
This commit is contained in:
committed by
Stefan Metzmacher
parent
e9875fcd56
commit
1ab76ecc53
@ -346,7 +346,8 @@ NTSTATUS cli_credentials_set_machine_account(struct cli_credentials *cred)
|
|||||||
* @param cred Credentials structure to fill in
|
* @param cred Credentials structure to fill in
|
||||||
* @retval NTSTATUS error detailing any failure
|
* @retval NTSTATUS error detailing any failure
|
||||||
*/
|
*/
|
||||||
NTSTATUS cli_credentials_set_krbtgt(struct cli_credentials *cred)
|
NTSTATUS cli_credentials_set_krbtgt(struct cli_credentials *cred,
|
||||||
|
struct loadparm_context *lp_ctx)
|
||||||
{
|
{
|
||||||
char *filter;
|
char *filter;
|
||||||
/* Bleh, nasty recursion issues: We are setting a machine
|
/* Bleh, nasty recursion issues: We are setting a machine
|
||||||
@ -356,7 +357,7 @@ NTSTATUS cli_credentials_set_krbtgt(struct cli_credentials *cred)
|
|||||||
filter = talloc_asprintf(cred, SECRETS_KRBTGT_SEARCH,
|
filter = talloc_asprintf(cred, SECRETS_KRBTGT_SEARCH,
|
||||||
cli_credentials_get_realm(cred),
|
cli_credentials_get_realm(cred),
|
||||||
cli_credentials_get_domain(cred));
|
cli_credentials_get_domain(cred));
|
||||||
return cli_credentials_set_secrets(cred, global_loadparm, NULL,
|
return cli_credentials_set_secrets(cred, lp_ctx, NULL,
|
||||||
SECRETS_PRINCIPALS_DN,
|
SECRETS_PRINCIPALS_DN,
|
||||||
filter);
|
filter);
|
||||||
}
|
}
|
||||||
|
@ -426,10 +426,10 @@ static int copy_files(struct loadparm_context *lp_ctx)
|
|||||||
return(EOM_EXIT_CODE);
|
return(EOM_EXIT_CODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_max_xmit(global_loadparm, MAX(ibs, obs));
|
set_max_xmit(lp_ctx, MAX(ibs, obs));
|
||||||
|
|
||||||
DEBUG(4, ("IO buffer size is %llu, max xmit is %d\n",
|
DEBUG(4, ("IO buffer size is %llu, max xmit is %d\n",
|
||||||
(unsigned long long)iomax, lp_max_xmit(global_loadparm)));
|
(unsigned long long)iomax, lp_max_xmit(lp_ctx)));
|
||||||
|
|
||||||
if (!(ifile = open_file("if"))) {
|
if (!(ifile = open_file("if"))) {
|
||||||
return(FILESYS_EXIT_CODE);
|
return(FILESYS_EXIT_CODE);
|
||||||
@ -443,7 +443,7 @@ static int copy_files(struct loadparm_context *lp_ctx)
|
|||||||
ifile->io_seek(ifile, check_arg_numeric("skip") * ibs);
|
ifile->io_seek(ifile, check_arg_numeric("skip") * ibs);
|
||||||
ofile->io_seek(ofile, check_arg_numeric("seek") * obs);
|
ofile->io_seek(ofile, check_arg_numeric("seek") * obs);
|
||||||
|
|
||||||
DEBUG(4, ("max xmit was negotiated to be %d\n", lp_max_xmit(global_loadparm)));
|
DEBUG(4, ("max xmit was negotiated to be %d\n", lp_max_xmit(lp_ctx)));
|
||||||
|
|
||||||
for (data_size = 0;;) {
|
for (data_size = 0;;) {
|
||||||
|
|
||||||
|
@ -274,7 +274,8 @@ _PUBLIC_ ssize_t convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_
|
|||||||
if (descriptor == (smb_iconv_t)-1 || descriptor == (smb_iconv_t)0) {
|
if (descriptor == (smb_iconv_t)-1 || descriptor == (smb_iconv_t)0) {
|
||||||
/* conversion not supported, return -1*/
|
/* conversion not supported, return -1*/
|
||||||
DEBUG(3, ("convert_string_talloc: conversion from %s to %s not supported!\n",
|
DEBUG(3, ("convert_string_talloc: conversion from %s to %s not supported!\n",
|
||||||
charset_name(global_loadparm, from), charset_name(global_loadparm, to)));
|
charset_name(global_loadparm, from),
|
||||||
|
charset_name(global_loadparm, to)));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,9 @@
|
|||||||
#include "param/share.h"
|
#include "param/share.h"
|
||||||
#include "param/param.h"
|
#include "param/param.h"
|
||||||
|
|
||||||
static NTSTATUS sclassic_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, struct share_context **ctx)
|
static NTSTATUS sclassic_init(TALLOC_CTX *mem_ctx,
|
||||||
|
const struct share_ops *ops,
|
||||||
|
struct share_context **ctx)
|
||||||
{
|
{
|
||||||
*ctx = talloc(mem_ctx, struct share_context);
|
*ctx = talloc(mem_ctx, struct share_context);
|
||||||
if (!*ctx) {
|
if (!*ctx) {
|
||||||
@ -37,7 +39,9 @@ static NTSTATUS sclassic_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops,
|
|||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *sclassic_string_option(struct share_config *scfg, const char *opt_name, const char *defval)
|
static const char *sclassic_string_option(struct share_config *scfg,
|
||||||
|
const char *opt_name,
|
||||||
|
const char *defval)
|
||||||
{
|
{
|
||||||
struct loadparm_service *s = talloc_get_type(scfg->opaque,
|
struct loadparm_service *s = talloc_get_type(scfg->opaque,
|
||||||
struct loadparm_service);
|
struct loadparm_service);
|
||||||
|
@ -38,8 +38,9 @@
|
|||||||
/*
|
/*
|
||||||
samr_ChangePasswordUser
|
samr_ChangePasswordUser
|
||||||
*/
|
*/
|
||||||
NTSTATUS dcesrv_samr_ChangePasswordUser(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
|
NTSTATUS dcesrv_samr_ChangePasswordUser(struct dcesrv_call_state *dce_call,
|
||||||
struct samr_ChangePasswordUser *r)
|
TALLOC_CTX *mem_ctx,
|
||||||
|
struct samr_ChangePasswordUser *r)
|
||||||
{
|
{
|
||||||
struct dcesrv_handle *h;
|
struct dcesrv_handle *h;
|
||||||
struct samr_account_state *a_state;
|
struct samr_account_state *a_state;
|
||||||
|
@ -334,7 +334,8 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
|
|||||||
}
|
}
|
||||||
|
|
||||||
DEBUG(0,("%s: using '%s' process model\n", binary_name, model));
|
DEBUG(0,("%s: using '%s' process model\n", binary_name, model));
|
||||||
status = server_service_startup(event_ctx, global_loadparm, model, lp_server_services(global_loadparm));
|
status = server_service_startup(event_ctx, global_loadparm, model,
|
||||||
|
lp_server_services(global_loadparm));
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
DEBUG(0,("Starting Services failed - %s\n", nt_errstr(status)));
|
DEBUG(0,("Starting Services failed - %s\n", nt_errstr(status)));
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -254,7 +254,8 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data,
|
|||||||
|
|
||||||
talloc_free(s->ldb);
|
talloc_free(s->ldb);
|
||||||
|
|
||||||
DEBUG(0,("Open the SAM LDB with system credentials: %s\n", s->path.samdb_ldb));
|
DEBUG(0,("Open the SAM LDB with system credentials: %s\n",
|
||||||
|
s->path.samdb_ldb));
|
||||||
|
|
||||||
s->ldb = ldb_wrap_connect(s, global_loadparm, s->path.samdb_ldb,
|
s->ldb = ldb_wrap_connect(s, global_loadparm, s->path.samdb_ldb,
|
||||||
system_session(s, global_loadparm),
|
system_session(s, global_loadparm),
|
||||||
|
@ -105,7 +105,8 @@ static struct record *recorded;
|
|||||||
/*****************************************************
|
/*****************************************************
|
||||||
return a connection to a server
|
return a connection to a server
|
||||||
*******************************************************/
|
*******************************************************/
|
||||||
static struct smbcli_state *connect_one(char *share, int snum, int conn)
|
static struct smbcli_state *connect_one(struct loadparm_context *lp_ctx,
|
||||||
|
char *share, int snum, int conn)
|
||||||
{
|
{
|
||||||
struct smbcli_state *c;
|
struct smbcli_state *c;
|
||||||
fstring server, myname;
|
fstring server, myname;
|
||||||
@ -124,7 +125,7 @@ static struct smbcli_state *connect_one(char *share, int snum, int conn)
|
|||||||
char **unc_list = NULL;
|
char **unc_list = NULL;
|
||||||
int num_unc_names;
|
int num_unc_names;
|
||||||
const char *p;
|
const char *p;
|
||||||
p = lp_parm_string(global_loadparm, NULL, "torture", "unclist");
|
p = lp_parm_string(lp_ctx, NULL, "torture", "unclist");
|
||||||
if (p) {
|
if (p) {
|
||||||
char *h, *s;
|
char *h, *s;
|
||||||
unc_list = file_lines_load(p, &num_unc_names, NULL);
|
unc_list = file_lines_load(p, &num_unc_names, NULL);
|
||||||
@ -183,7 +184,8 @@ static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS], int fnum
|
|||||||
}
|
}
|
||||||
talloc_free(cli[server][conn]);
|
talloc_free(cli[server][conn]);
|
||||||
}
|
}
|
||||||
cli[server][conn] = connect_one(share[server], server, conn);
|
cli[server][conn] = connect_one(global_loadparm, share[server],
|
||||||
|
server, conn);
|
||||||
if (!cli[server][conn]) {
|
if (!cli[server][conn]) {
|
||||||
DEBUG(0,("Failed to connect to %s\n", share[server]));
|
DEBUG(0,("Failed to connect to %s\n", share[server]));
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -719,7 +719,7 @@ bool torture_rpc_drsuapi(struct torture_context *torture)
|
|||||||
#endif
|
#endif
|
||||||
ret &= test_DsGetDomainControllerInfo(p, torture, &priv);
|
ret &= test_DsGetDomainControllerInfo(p, torture, &priv);
|
||||||
|
|
||||||
ret &= test_DsCrackNames(p, torture, &priv);
|
ret &= test_DsCrackNames(torture, p, torture, &priv);
|
||||||
|
|
||||||
ret &= test_DsWriteAccountSpn(p, torture, &priv);
|
ret &= test_DsWriteAccountSpn(p, torture, &priv);
|
||||||
|
|
||||||
@ -771,7 +771,7 @@ bool torture_rpc_drsuapi_cracknames(struct torture_context *torture)
|
|||||||
/* We don't care if this fails, we just need some info from it */
|
/* We don't care if this fails, we just need some info from it */
|
||||||
test_DsGetDomainControllerInfo(p, torture, &priv);
|
test_DsGetDomainControllerInfo(p, torture, &priv);
|
||||||
|
|
||||||
ret &= test_DsCrackNames(p, torture, &priv);
|
ret &= test_DsCrackNames(torture, p, torture, &priv);
|
||||||
|
|
||||||
ret &= test_DsUnbind(p, torture, &priv);
|
ret &= test_DsUnbind(p, torture, &priv);
|
||||||
}
|
}
|
||||||
|
@ -204,8 +204,9 @@ static bool test_DsCrackNamesMatrix(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool test_DsCrackNames(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
bool test_DsCrackNames(struct torture_context *tctx,
|
||||||
struct DsPrivate *priv)
|
struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
||||||
|
struct DsPrivate *priv)
|
||||||
{
|
{
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
struct drsuapi_DsCrackNames r;
|
struct drsuapi_DsCrackNames r;
|
||||||
@ -589,7 +590,7 @@ bool test_DsCrackNames(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
|||||||
.comment = "display name for Microsoft Support Account",
|
.comment = "display name for Microsoft Support Account",
|
||||||
.status = DRSUAPI_DS_NAME_STATUS_OK,
|
.status = DRSUAPI_DS_NAME_STATUS_OK,
|
||||||
.alternate_status = DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE,
|
.alternate_status = DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE,
|
||||||
.skip = lp_parm_bool(global_loadparm, NULL, "torture", "samba4", false)
|
.skip = torture_setting_bool(tctx, "samba4", false)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.format_offered = DRSUAPI_DS_NAME_FORMAT_GUID,
|
.format_offered = DRSUAPI_DS_NAME_FORMAT_GUID,
|
||||||
|
@ -139,7 +139,8 @@ static int http_readFile(EspHandle handle,
|
|||||||
const char *path,
|
const char *path,
|
||||||
const char *base_dir)
|
const char *base_dir)
|
||||||
{
|
{
|
||||||
struct websrv_context *web = talloc_get_type(handle, struct websrv_context);
|
struct websrv_context *web = talloc_get_type(handle,
|
||||||
|
struct websrv_context);
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
*buf = NULL;
|
*buf = NULL;
|
||||||
@ -169,12 +170,11 @@ failed:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int http_readFileFromSwatDir(EspHandle handle,
|
static int http_readFileFromSwatDir(EspHandle handle, char **buf, int *len,
|
||||||
char **buf,
|
|
||||||
int *len,
|
|
||||||
const char *path)
|
const char *path)
|
||||||
{
|
{
|
||||||
return http_readFile(handle, buf, len, path, lp_swat_directory(global_loadparm));
|
return http_readFile(handle, buf, len, path,
|
||||||
|
lp_swat_directory(global_loadparm));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ static void wbsrv_accept(struct stream_connection *conn)
|
|||||||
}
|
}
|
||||||
wbconn->conn = conn;
|
wbconn->conn = conn;
|
||||||
wbconn->listen_socket = listen_socket;
|
wbconn->listen_socket = listen_socket;
|
||||||
wbconn->lp_ctx = global_loadparm;
|
wbconn->lp_ctx = listen_socket->service->task->lp_ctx;
|
||||||
conn->private = wbconn;
|
conn->private = wbconn;
|
||||||
|
|
||||||
wbconn->packet = packet_init(wbconn);
|
wbconn->packet = packet_init(wbconn);
|
||||||
|
Reference in New Issue
Block a user