diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-07-16 14:32:42 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-07-16 18:24:27 +1000 |
commit | 6b266b85cf34145ac1f03d8f787b81121e4ec92b (patch) | |
tree | 9f6faebdcf58c73e0297bfdf3b905ef256f8e478 /source4/torture/basic | |
parent | e4c35c5a09dd66c9280caa39130b7e3b941b7e51 (diff) | |
download | samba-6b266b85cf34145ac1f03d8f787b81121e4ec92b.tar.gz samba-6b266b85cf34145ac1f03d8f787b81121e4ec92b.tar.bz2 samba-6b266b85cf34145ac1f03d8f787b81121e4ec92b.zip |
s4-loadparm: 2nd half of lp_ to lpcfg_ conversion
this converts all callers that use the Samba4 loadparm lp_ calling
convention to use the lpcfg_ prefix.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/torture/basic')
-rw-r--r-- | source4/torture/basic/base.c | 20 | ||||
-rw-r--r-- | source4/torture/basic/charset.c | 2 | ||||
-rw-r--r-- | source4/torture/basic/misc.c | 58 | ||||
-rw-r--r-- | source4/torture/basic/secleak.c | 6 |
4 files changed, 43 insertions, 43 deletions
diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c index b2d523283a..c9148d1915 100644 --- a/source4/torture/basic/base.c +++ b/source4/torture/basic/base.c @@ -41,7 +41,7 @@ static struct smbcli_state *open_nbt_connection(struct torture_context *tctx) const char *host = torture_setting_string(tctx, "host", NULL); struct smbcli_options options; - make_nbt_name_client(&calling, lp_netbios_name(tctx->lp_ctx)); + make_nbt_name_client(&calling, lpcfg_netbios_name(tctx->lp_ctx)); nbt_choose_called_name(NULL, &called, host, NBT_NAME_SERVER); @@ -51,11 +51,11 @@ static struct smbcli_state *open_nbt_connection(struct torture_context *tctx) goto failed; } - lp_smbcli_options(tctx->lp_ctx, &options); + lpcfg_smbcli_options(tctx->lp_ctx, &options); - if (!smbcli_socket_connect(cli, host, lp_smb_ports(tctx->lp_ctx), tctx->ev, - lp_resolve_context(tctx->lp_ctx), &options, - lp_socket_options(tctx->lp_ctx))) { + if (!smbcli_socket_connect(cli, host, lpcfg_smb_ports(tctx->lp_ctx), tctx->ev, + lpcfg_resolve_context(tctx->lp_ctx), &options, + lpcfg_socket_options(tctx->lp_ctx))) { torture_comment(tctx, "Failed to connect with %s\n", host); goto failed; } @@ -359,7 +359,7 @@ static bool run_negprot_nowait(struct torture_context *tctx) for (i=0;i<100;i++) { struct smbcli_request *req; - req = smb_raw_negotiate_send(cli->transport, lp_unicode(tctx->lp_ctx), PROTOCOL_NT1); + req = smb_raw_negotiate_send(cli->transport, lpcfg_unicode(tctx->lp_ctx), PROTOCOL_NT1); event_loop_once(cli->transport->socket->event.ctx); if (req->state == SMBCLI_REQUEST_ERROR) { if (i > 0) { @@ -1453,9 +1453,9 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx) union smb_open io; NTSTATUS status; - nt_status_support = lp_nt_status_support(tctx->lp_ctx); + nt_status_support = lpcfg_nt_status_support(tctx->lp_ctx); - if (!lp_set_cmdline(tctx->lp_ctx, "nt status support", "yes")) { + if (!lpcfg_set_cmdline(tctx->lp_ctx, "nt status support", "yes")) { torture_comment(tctx, "Could not set 'nt status support = yes'\n"); goto fail; } @@ -1464,7 +1464,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx) goto fail; } - if (!lp_set_cmdline(tctx->lp_ctx, "nt status support", "no")) { + if (!lpcfg_set_cmdline(tctx->lp_ctx, "nt status support", "no")) { torture_comment(tctx, "Could not set 'nt status support = yes'\n"); goto fail; } @@ -1473,7 +1473,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx) goto fail; } - if (!lp_set_cmdline(tctx->lp_ctx, "nt status support", + if (!lpcfg_set_cmdline(tctx->lp_ctx, "nt status support", nt_status_support ? "yes":"no")) { torture_comment(tctx, "Could not reset 'nt status support = yes'"); goto fail; diff --git a/source4/torture/basic/charset.c b/source4/torture/basic/charset.c index 3cfcadcb7a..b4221a75b6 100644 --- a/source4/torture/basic/charset.c +++ b/source4/torture/basic/charset.c @@ -54,7 +54,7 @@ static NTSTATUS unicode_open(struct torture_context *tctx, } SSVAL(ucs_name, i*2, 0); - if (!convert_string_talloc_convenience(ucs_name, lp_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname, &i, false)) { + if (!convert_string_talloc_convenience(ucs_name, lpcfg_iconv_convenience(tctx->lp_ctx), CH_UTF16, CH_UNIX, ucs_name, (1+u_name_len)*2, (void **)&fname, &i, false)) { torture_comment(tctx, "Failed to convert UCS2 Name into unix - convert_string_talloc() failure\n"); talloc_free(ucs_name); return NT_STATUS_NO_MEMORY; diff --git a/source4/torture/basic/misc.c b/source4/torture/basic/misc.c index 24e8e37331..7223272984 100644 --- a/source4/torture/basic/misc.c +++ b/source4/torture/basic/misc.c @@ -485,11 +485,11 @@ struct benchrw_state { unsigned int blocksize; unsigned int writeratio; int num_parallel_requests; - } *lp_params; + } *lpcfg_params; }; /* - init params using lp_parm_xxx + init params using lpcfg_parm_xxx return number of unclist entries */ static int init_benchrw_params(struct torture_context *tctx, @@ -504,7 +504,7 @@ static int init_benchrw_params(struct torture_context *tctx, lpar->writeratio = torture_setting_int(tctx, "writeratio",5); lpar->num_parallel_requests = torture_setting_int( tctx, "parallel_requests", 5); - lpar->workgroup = lp_workgroup(tctx->lp_ctx); + lpar->workgroup = lpcfg_workgroup(tctx->lp_ctx); p = torture_setting_string(tctx, "unclist", NULL); if (p) { @@ -619,7 +619,7 @@ static NTSTATUS benchrw_readwrite(struct torture_context *tctx, union smb_write wr; /* randomize between writes and reads*/ - if (random() % state->lp_params->writeratio == 0) { + if (random() % state->lpcfg_params->writeratio == 0) { torture_comment(tctx, "Callback WRITE file:%d (%d/%d)\n", state->nr,state->completed,torture_numops); wr.generic.level = RAW_WRITE_WRITEX ; @@ -627,7 +627,7 @@ static NTSTATUS benchrw_readwrite(struct torture_context *tctx, wr.writex.in.offset = 0; wr.writex.in.wmode = 0 ; wr.writex.in.remaining = 0; - wr.writex.in.count = state->lp_params->blocksize; + wr.writex.in.count = state->lpcfg_params->blocksize; wr.writex.in.data = state->buffer; state->readcnt=0; req = smb_raw_write_send(state->cli,&wr); @@ -636,16 +636,16 @@ static NTSTATUS benchrw_readwrite(struct torture_context *tctx, torture_comment(tctx, "Callback READ file:%d (%d/%d) Offset:%d\n", state->nr,state->completed,torture_numops, - (state->readcnt*state->lp_params->blocksize)); + (state->readcnt*state->lpcfg_params->blocksize)); rd.generic.level = RAW_READ_READX; rd.readx.in.file.fnum = state->fnum ; - rd.readx.in.offset = state->readcnt*state->lp_params->blocksize; - rd.readx.in.mincnt = state->lp_params->blocksize; + rd.readx.in.offset = state->readcnt*state->lpcfg_params->blocksize; + rd.readx.in.mincnt = state->lpcfg_params->blocksize; rd.readx.in.maxcnt = rd.readx.in.mincnt; rd.readx.in.remaining = 0 ; rd.readx.out.data = state->buffer; rd.readx.in.read_for_execute = false; - if(state->readcnt < state->lp_params->writeblocks){ + if(state->readcnt < state->lpcfg_params->writeblocks){ state->readcnt++; }else{ /*start reading from beginn of file*/ @@ -683,21 +683,21 @@ static NTSTATUS benchrw_open(struct torture_context *tctx, } torture_comment(tctx, "Write initial test file:%d (%d/%d)\n",state->nr, - (state->writecnt+1)*state->lp_params->blocksize, - (state->lp_params->writeblocks*state->lp_params->blocksize)); + (state->writecnt+1)*state->lpcfg_params->blocksize, + (state->lpcfg_params->writeblocks*state->lpcfg_params->blocksize)); wr.generic.level = RAW_WRITE_WRITEX ; wr.writex.in.file.fnum = state->fnum ; wr.writex.in.offset = state->writecnt * - state->lp_params->blocksize; + state->lpcfg_params->blocksize; wr.writex.in.wmode = 0 ; - wr.writex.in.remaining = (state->lp_params->writeblocks * - state->lp_params->blocksize)- + wr.writex.in.remaining = (state->lpcfg_params->writeblocks * + state->lpcfg_params->blocksize)- ((state->writecnt+1)*state-> - lp_params->blocksize); - wr.writex.in.count = state->lp_params->blocksize; + lpcfg_params->blocksize); + wr.writex.in.count = state->lpcfg_params->blocksize; wr.writex.in.data = state->buffer; state->writecnt++; - if(state->writecnt == state->lp_params->writeblocks){ + if(state->writecnt == state->lpcfg_params->writeblocks){ state->mode=READ_WRITE_DATA; } req = smb_raw_write_send(state->cli,&wr); @@ -738,9 +738,9 @@ static NTSTATUS benchrw_mkdir(struct torture_context *tctx, open_parms->openx.in.timeout = 0; open_parms->openx.in.fname = state->fname; - writedata = talloc_size(tctx,state->lp_params->blocksize); + writedata = talloc_size(tctx,state->lpcfg_params->blocksize); NT_STATUS_HAVE_NO_MEMORY(writedata); - generate_random_buffer(writedata,state->lp_params->blocksize); + generate_random_buffer(writedata,state->lpcfg_params->blocksize); state->buffer=writedata; state->writecnt=1; state->readcnt=0; @@ -795,7 +795,7 @@ static void benchrw_callback(struct smbcli_request *req) break; case READ_WRITE_DATA: while (state->num_parallel_requests - < state->lp_params->num_parallel_requests) { + < state->lpcfg_params->num_parallel_requests) { NTSTATUS status; status = benchrw_readwrite(tctx,state); if (!NT_STATUS_IS_OK(status)){ @@ -838,7 +838,7 @@ static void async_open_callback(struct composite_context *con) { struct benchrw_state *state = con->async.private_data; struct torture_context *tctx = state->tctx; - int retry = state->lp_params->retry; + int retry = state->lpcfg_params->retry; if (NT_STATUS_IS_OK(con->status)) { state->cli=((struct smb_composite_connect*) @@ -877,19 +877,19 @@ static struct composite_context *torture_connect_async( torture_comment(tctx, "Open Connection to %s/%s\n",host,share); smb->in.dest_host=talloc_strdup(mem_ctx,host); smb->in.service=talloc_strdup(mem_ctx,share); - smb->in.dest_ports=lp_smb_ports(tctx->lp_ctx); - smb->in.socket_options = lp_socket_options(tctx->lp_ctx); + smb->in.dest_ports=lpcfg_smb_ports(tctx->lp_ctx); + smb->in.socket_options = lpcfg_socket_options(tctx->lp_ctx); smb->in.called_name = strupper_talloc(mem_ctx, host); smb->in.service_type=NULL; smb->in.credentials=cmdline_credentials; smb->in.fallback_to_anonymous=false; - smb->in.gensec_settings = lp_gensec_settings(mem_ctx, tctx->lp_ctx); + smb->in.gensec_settings = lpcfg_gensec_settings(mem_ctx, tctx->lp_ctx); smb->in.workgroup=workgroup; - lp_smbcli_options(tctx->lp_ctx, &smb->in.options); - lp_smbcli_session_options(tctx->lp_ctx, &smb->in.session_options); + lpcfg_smbcli_options(tctx->lp_ctx, &smb->in.options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &smb->in.session_options); return smb_composite_connect_send(smb,mem_ctx, - lp_resolve_context(tctx->lp_ctx),ev); + lpcfg_resolve_context(tctx->lp_ctx),ev); } bool run_benchrw(struct torture_context *tctx) @@ -915,7 +915,7 @@ bool run_benchrw(struct torture_context *tctx) ev = tctx->ev; state = talloc_array(tctx, struct benchrw_state *, torture_nprocs); - /* init params using lp_parm_xxx */ + /* init params using lpcfg_parm_xxx */ num_unc_names = init_benchrw_params(tctx,&lpparams); /* init private data structs*/ @@ -924,7 +924,7 @@ bool run_benchrw(struct torture_context *tctx) state[i]->tctx = tctx; state[i]->completed=0; state[i]->num_parallel_requests=0; - state[i]->lp_params=&lpparams; + state[i]->lpcfg_params=&lpparams; state[i]->nr=i; state[i]->dname=talloc_asprintf(tctx,"benchrw%d",i); state[i]->fname=talloc_asprintf(tctx,"%s%s", diff --git a/source4/torture/basic/secleak.c b/source4/torture/basic/secleak.c index 363b824b66..92dc3508f3 100644 --- a/source4/torture/basic/secleak.c +++ b/source4/torture/basic/secleak.c @@ -36,14 +36,14 @@ static bool try_failed_login(struct torture_context *tctx, struct smbcli_state * struct smbcli_session *session; struct smbcli_session_options options; - lp_smbcli_session_options(tctx->lp_ctx, &options); + lpcfg_smbcli_session_options(tctx->lp_ctx, &options); session = smbcli_session_init(cli->transport, cli, false, options); setup.in.sesskey = cli->transport->negotiate.sesskey; setup.in.capabilities = cli->transport->negotiate.capabilities; - setup.in.workgroup = lp_workgroup(tctx->lp_ctx); + setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); setup.in.credentials = cli_credentials_init(session); - setup.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx); + setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx); cli_credentials_set_conf(setup.in.credentials, tctx->lp_ctx); cli_credentials_set_domain(setup.in.credentials, "INVALID-DOMAIN", CRED_SPECIFIED); |