1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-30 19:42:05 +03:00

r26272: Remove global_loadparm in some more places.

This commit is contained in:
Jelmer Vernooij
2007-12-03 23:33:22 +01:00
committed by Stefan Metzmacher
parent e9875fcd56
commit 1ab76ecc53
12 changed files with 38 additions and 26 deletions

View File

@ -346,7 +346,8 @@ NTSTATUS cli_credentials_set_machine_account(struct cli_credentials *cred)
* @param cred Credentials structure to fill in
* @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;
/* 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,
cli_credentials_get_realm(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,
filter);
}

View File

@ -426,10 +426,10 @@ static int copy_files(struct loadparm_context *lp_ctx)
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",
(unsigned long long)iomax, lp_max_xmit(global_loadparm)));
(unsigned long long)iomax, lp_max_xmit(lp_ctx)));
if (!(ifile = open_file("if"))) {
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);
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;;) {

View File

@ -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) {
/* conversion not supported, return -1*/
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;
}

View File

@ -23,7 +23,9 @@
#include "param/share.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);
if (!*ctx) {
@ -37,7 +39,9 @@ static NTSTATUS sclassic_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops,
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);

View File

@ -38,8 +38,9 @@
/*
samr_ChangePasswordUser
*/
NTSTATUS dcesrv_samr_ChangePasswordUser(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct samr_ChangePasswordUser *r)
NTSTATUS dcesrv_samr_ChangePasswordUser(struct dcesrv_call_state *dce_call,
TALLOC_CTX *mem_ctx,
struct samr_ChangePasswordUser *r)
{
struct dcesrv_handle *h;
struct samr_account_state *a_state;

View File

@ -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));
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)) {
DEBUG(0,("Starting Services failed - %s\n", nt_errstr(status)));
return 1;

View File

@ -254,7 +254,8 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data,
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,
system_session(s, global_loadparm),

View File

@ -105,7 +105,8 @@ static struct record *recorded;
/*****************************************************
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;
fstring server, myname;
@ -124,7 +125,7 @@ static struct smbcli_state *connect_one(char *share, int snum, int conn)
char **unc_list = NULL;
int num_unc_names;
const char *p;
p = lp_parm_string(global_loadparm, NULL, "torture", "unclist");
p = lp_parm_string(lp_ctx, NULL, "torture", "unclist");
if (p) {
char *h, *s;
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]);
}
cli[server][conn] = connect_one(share[server], server, conn);
cli[server][conn] = connect_one(global_loadparm, share[server],
server, conn);
if (!cli[server][conn]) {
DEBUG(0,("Failed to connect to %s\n", share[server]));
exit(1);

View File

@ -719,7 +719,7 @@ bool torture_rpc_drsuapi(struct torture_context *torture)
#endif
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);
@ -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 */
test_DsGetDomainControllerInfo(p, torture, &priv);
ret &= test_DsCrackNames(p, torture, &priv);
ret &= test_DsCrackNames(torture, p, torture, &priv);
ret &= test_DsUnbind(p, torture, &priv);
}

View File

@ -204,8 +204,9 @@ static bool test_DsCrackNamesMatrix(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return ret;
}
bool test_DsCrackNames(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct DsPrivate *priv)
bool test_DsCrackNames(struct torture_context *tctx,
struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct DsPrivate *priv)
{
NTSTATUS status;
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",
.status = DRSUAPI_DS_NAME_STATUS_OK,
.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,

View File

@ -139,7 +139,8 @@ static int http_readFile(EspHandle handle,
const char *path,
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;
struct stat st;
*buf = NULL;
@ -169,12 +170,11 @@ failed:
return -1;
}
static int http_readFileFromSwatDir(EspHandle handle,
char **buf,
int *len,
static int http_readFileFromSwatDir(EspHandle handle, char **buf, int *len,
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));
}

View File

@ -60,7 +60,7 @@ static void wbsrv_accept(struct stream_connection *conn)
}
wbconn->conn = conn;
wbconn->listen_socket = listen_socket;
wbconn->lp_ctx = global_loadparm;
wbconn->lp_ctx = listen_socket->service->task->lp_ctx;
conn->private = wbconn;
wbconn->packet = packet_init(wbconn);