mirror of
https://github.com/samba-team/samba.git
synced 2025-03-05 20:58:40 +03:00
s4:torture: Migrate smbtorture to new cmdline option parser
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
092d26af6a
commit
a40bc1d0ee
@ -32,7 +32,7 @@
|
||||
#include "lib/param/param.h"
|
||||
#include "lib/util/samba_util.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
|
||||
#include <gnutls/gnutls.h>
|
||||
#include <gnutls/crypto.h>
|
||||
@ -756,16 +756,17 @@ static bool test_wbc_authenticate_user_int(struct torture_context *tctx,
|
||||
struct wbcAuthUserInfo *info = NULL;
|
||||
struct wbcAuthErrorInfo *error = NULL;
|
||||
wbcErr ret;
|
||||
struct cli_credentials *creds = samba_cmdline_get_creds();
|
||||
|
||||
ret = wbcAuthenticateUser(cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials()), correct_password);
|
||||
creds), correct_password);
|
||||
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
|
||||
"wbcAuthenticateUser of %s failed",
|
||||
cli_credentials_get_username(popt_get_cmdline_credentials()));
|
||||
cli_credentials_get_username(creds));
|
||||
|
||||
ZERO_STRUCT(params);
|
||||
params.account_name =
|
||||
cli_credentials_get_username(popt_get_cmdline_credentials());
|
||||
cli_credentials_get_username(creds);
|
||||
params.level = WBC_AUTH_USER_LEVEL_PLAIN;
|
||||
params.password.plaintext = correct_password;
|
||||
|
||||
@ -794,15 +795,18 @@ static bool test_wbc_authenticate_user_int(struct torture_context *tctx,
|
||||
|
||||
static bool test_wbc_authenticate_user(struct torture_context *tctx)
|
||||
{
|
||||
struct cli_credentials *creds = samba_cmdline_get_creds();
|
||||
|
||||
return test_wbc_authenticate_user_int(tctx,
|
||||
cli_credentials_get_password(popt_get_cmdline_credentials()));
|
||||
cli_credentials_get_password(creds));
|
||||
}
|
||||
|
||||
static bool test_wbc_change_password(struct torture_context *tctx)
|
||||
{
|
||||
wbcErr ret;
|
||||
struct cli_credentials *creds = samba_cmdline_get_creds();
|
||||
const char *oldpass =
|
||||
cli_credentials_get_password(popt_get_cmdline_credentials());
|
||||
cli_credentials_get_password(creds);
|
||||
const char *newpass = "Koo8irei%$";
|
||||
|
||||
struct samr_CryptPassword new_nt_password;
|
||||
@ -891,9 +895,9 @@ static bool test_wbc_change_password(struct torture_context *tctx)
|
||||
|
||||
params.level = WBC_CHANGE_PASSWORD_LEVEL_RESPONSE;
|
||||
params.account_name =
|
||||
cli_credentials_get_username(popt_get_cmdline_credentials());
|
||||
cli_credentials_get_username(creds);
|
||||
params.domain_name =
|
||||
cli_credentials_get_domain(popt_get_cmdline_credentials());
|
||||
cli_credentials_get_domain(creds);
|
||||
|
||||
ret = wbcChangeUserPasswordEx(¶ms, NULL, NULL, NULL);
|
||||
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
|
||||
@ -904,14 +908,14 @@ static bool test_wbc_change_password(struct torture_context *tctx)
|
||||
}
|
||||
|
||||
ret = wbcChangeUserPassword(
|
||||
cli_credentials_get_username(popt_get_cmdline_credentials()),
|
||||
cli_credentials_get_username(creds),
|
||||
newpass,
|
||||
cli_credentials_get_password(popt_get_cmdline_credentials()));
|
||||
cli_credentials_get_password(creds));
|
||||
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
|
||||
"wbcChangeUserPassword for %s failed", params.account_name);
|
||||
|
||||
return test_wbc_authenticate_user_int(tctx,
|
||||
cli_credentials_get_password(popt_get_cmdline_credentials()));
|
||||
cli_credentials_get_password(creds));
|
||||
}
|
||||
|
||||
static bool test_wbc_logon_user(struct torture_context *tctx)
|
||||
@ -925,6 +929,7 @@ static bool test_wbc_logon_user(struct torture_context *tctx)
|
||||
enum wbcSidType sidtype;
|
||||
char *sidstr;
|
||||
wbcErr ret;
|
||||
struct cli_credentials *creds = samba_cmdline_get_creds();
|
||||
|
||||
ZERO_STRUCT(params);
|
||||
|
||||
@ -934,9 +939,9 @@ static bool test_wbc_logon_user(struct torture_context *tctx)
|
||||
"have failed");
|
||||
|
||||
params.username =
|
||||
cli_credentials_get_username(popt_get_cmdline_credentials());
|
||||
cli_credentials_get_username(creds);
|
||||
params.password =
|
||||
cli_credentials_get_password(popt_get_cmdline_credentials());
|
||||
cli_credentials_get_password(creds);
|
||||
|
||||
ret = wbcAddNamedBlob(¶ms.num_blobs, ¶ms.blobs,
|
||||
"foo", 0, discard_const_p(uint8_t, "bar"), 4);
|
||||
@ -967,7 +972,7 @@ static bool test_wbc_logon_user(struct torture_context *tctx)
|
||||
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
|
||||
"%s", "wbcAddNamedBlob failed");
|
||||
params.password =
|
||||
cli_credentials_get_password(popt_get_cmdline_credentials());
|
||||
cli_credentials_get_password(creds);
|
||||
ret = wbcLogonUser(¶ms, &info, &error, &policy);
|
||||
torture_assert_wbc_equal(tctx, ret, WBC_ERR_AUTH_ERROR,
|
||||
"wbcLogonUser for %s should have failed with "
|
||||
@ -983,13 +988,13 @@ static bool test_wbc_logon_user(struct torture_context *tctx)
|
||||
"%s", "wbcInterfaceDetails failed");
|
||||
|
||||
ret = wbcLookupName(iface->netbios_domain,
|
||||
cli_credentials_get_username(popt_get_cmdline_credentials()),
|
||||
cli_credentials_get_username(creds),
|
||||
&sid,
|
||||
&sidtype);
|
||||
wbcFreeMemory(iface);
|
||||
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
|
||||
"wbcLookupName for %s failed",
|
||||
cli_credentials_get_username(popt_get_cmdline_credentials()));
|
||||
cli_credentials_get_username(creds));
|
||||
|
||||
ret = wbcSidToString(&sid, &sidstr);
|
||||
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
|
||||
@ -1002,7 +1007,7 @@ static bool test_wbc_logon_user(struct torture_context *tctx)
|
||||
"%s", "wbcAddNamedBlob failed");
|
||||
wbcFreeMemory(sidstr);
|
||||
params.password =
|
||||
cli_credentials_get_password(popt_get_cmdline_credentials());
|
||||
cli_credentials_get_password(creds);
|
||||
ret = wbcLogonUser(¶ms, &info, &error, &policy);
|
||||
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
|
||||
"wbcLogonUser for %s failed", params.username);
|
||||
@ -1020,14 +1025,15 @@ static bool test_wbc_getgroups(struct torture_context *tctx)
|
||||
wbcErr ret;
|
||||
uint32_t num_groups;
|
||||
gid_t *groups;
|
||||
struct cli_credentials *creds = samba_cmdline_get_creds();
|
||||
|
||||
ret = wbcGetGroups(
|
||||
cli_credentials_get_username(popt_get_cmdline_credentials()),
|
||||
cli_credentials_get_username(creds),
|
||||
&num_groups,
|
||||
&groups);
|
||||
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
|
||||
"wbcGetGroups for %s failed",
|
||||
cli_credentials_get_username(popt_get_cmdline_credentials()));
|
||||
cli_credentials_get_username(creds));
|
||||
wbcFreeMemory(groups);
|
||||
return true;
|
||||
}
|
||||
|
@ -331,7 +331,7 @@
|
||||
^samba.tests.dns.__main__.TestComplexQueries.test_cname_two_chain_not_matching_qtype
|
||||
# ad_dc requires signing
|
||||
#
|
||||
^samba4.smb.signing.*disabled.*signing=off.*\(ad_dc\)
|
||||
^samba4.smb.signing.*disabled.*client-protection=off.*\(ad_dc\)
|
||||
# fl2000dc doesn't support AES
|
||||
^samba4.krb5.kdc.*as-req-aes.*fl2000dc
|
||||
# nt4_member and ad_member don't support ntlmv1 (not even over SMB1)
|
||||
|
@ -1,2 +1,2 @@
|
||||
# 'raw NTLMv2 auth' is not enabled on ad_member
|
||||
^samba4.smb.signing.disabled.on.with.-k.no.--option=clientusespnego=no.--signing=off.domain-creds.xcopy\(ad_member\)
|
||||
^samba4.smb.signing disabled on with -k no --option=clientusespnego=no --client-protection=off domain-creds.xcopy\(ad_member\)
|
||||
|
@ -40,9 +40,9 @@
|
||||
^samba3.unix.whoami kerberos connection.whoami\(ad_member\)
|
||||
^samba3.unix.whoami anonymous connection.whoami\(ad_member\)
|
||||
^samba3.unix.whoami ntlm user@realm.whoami\(ad_member\)
|
||||
^samba4.smb.signing disabled on with -k no --signing=off domain-creds.xcopy\(ad_member\)
|
||||
^samba4.smb.signing disabled on with -k no --option=gensec:spengo=no --signing=off domain-creds.xcopy\(ad_member\)
|
||||
^samba4.smb.signing disabled on with -k yes --signing=off domain-creds.xcopy\(ad_member\)
|
||||
^samba4.smb.signing disabled on with -k no --client-protection=off domain-creds.xcopy\(ad_member\)
|
||||
^samba4.smb.signing disabled on with -k no --option=gensec:spengo=no --client-protection=off domain-creds.xcopy\(ad_member\)
|
||||
^samba4.smb.signing disabled on with -k yes --client-protection=off domain-creds.xcopy\(ad_member\)
|
||||
^samba4.blackbox.smbclient\(ad_member:local\).Test login with --machine-pass without kerberos\(ad_member:local\)
|
||||
^samba4.blackbox.smbclient\(ad_member:local\).Test login with --machine-pass and kerberos\(ad_member:local\)
|
||||
^samba4.blackbox.smbclient\(chgdcpass:local\).Test login with --machine-pass without kerberos\(chgdcpass:local\)
|
||||
|
@ -856,7 +856,7 @@ for t in tests:
|
||||
if t == "raw.notify" or t == "raw.oplock":
|
||||
tmp_env = "nt4_dc_smb1"
|
||||
# These tests are a little slower so don't duplicate them with ad_dc
|
||||
plansmbtorture4testsuite(t, tmp_env, '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --signing=required')
|
||||
plansmbtorture4testsuite(t, tmp_env, '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --client-protection=sign')
|
||||
elif t == "smb2.dosmode":
|
||||
plansmbtorture4testsuite(t, "simpleserver", '//$SERVER/dosmode -U$USERNAME%$PASSWORD')
|
||||
elif t == "smb2.kernel-oplocks":
|
||||
@ -996,10 +996,10 @@ for s in signseal_options:
|
||||
e = ""
|
||||
a = "smb2"
|
||||
binding_string = "ncacn_np:$SERVER[%s%s%s]" % (a, s, e)
|
||||
options = binding_string + " -k yes --krb5-ccache=$PREFIX/ktest/krb5_ccache-2"
|
||||
options = binding_string + " --use-krb5-ccache=$PREFIX/ktest/krb5_ccache-2"
|
||||
plansmbtorture4testsuite(test, "ktest", options, 'krb5 with old ccache ncacn_np with [%s%s%s] ' % (a, s, e))
|
||||
|
||||
options = binding_string + " -k yes --krb5-ccache=$PREFIX/ktest/krb5_ccache-3"
|
||||
options = binding_string + " --use-krb5-ccache=$PREFIX/ktest/krb5_ccache-3"
|
||||
plansmbtorture4testsuite(test, "ktest", options, 'krb5 ncacn_np with [%s%s%s] ' % (a, s, e))
|
||||
|
||||
auth_options2 = ["krb5", "spnego,krb5"]
|
||||
|
@ -623,7 +623,7 @@ for mech in [
|
||||
"-k no --option=gensec:spengo=no",
|
||||
"-k yes",
|
||||
"-k yes --option=gensec:fake_gssapi_krb5=yes --option=gensec:gssapi_krb5=no"]:
|
||||
for signing in ["--signing=on", "--signing=required"]:
|
||||
for signing in ["--option=clientsigning=desired", "--option=clientsigning=required"]:
|
||||
signoptions = "%s %s" % (mech, signing)
|
||||
name = "smb.signing on with %s" % signoptions
|
||||
plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$USERNAME%$PASSWORD'], modname="samba4.%s" % name)
|
||||
@ -633,7 +633,7 @@ for mech in [
|
||||
"-k no --option=clientusespnego=no",
|
||||
"-k no --option=gensec:spengo=no",
|
||||
"-k yes"]:
|
||||
signoptions = "%s --signing=off" % mech
|
||||
signoptions = "%s --client-protection=off" % mech
|
||||
name = "smb.signing disabled on with %s" % signoptions
|
||||
plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s domain-creds" % name)
|
||||
plansmbtorture4testsuite('base.xcopy', "ad_member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$DC_USERNAME%$DC_PASSWORD'], "samba4.%s domain-creds" % name)
|
||||
@ -646,12 +646,12 @@ for mech in [
|
||||
"-k no",
|
||||
"-k no --option=clientusespnego=no",
|
||||
"-k no --option=gensec:spengo=no"]:
|
||||
signoptions = "%s --signing=off" % mech
|
||||
signoptions = "%s --client-protection=off" % mech
|
||||
plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$NETBIOSNAME/$USERNAME%$PASSWORD'], modname="samba4.smb.signing on with %s local-creds" % signoptions)
|
||||
|
||||
plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=yes', '-U%'], modname="samba4.smb.signing --signing=yes anon")
|
||||
plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=required', '-U%'], modname="samba4.smb.signing --signing=required anon")
|
||||
plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--signing=no', '-U%'], modname="samba4.smb.signing --signing=no anon")
|
||||
plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--option=clientsigning=desired', '-U%'], modname="samba4.smb.signing --option=clientsigning=desired anon")
|
||||
plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--option=clientsigning=required', '-U%'], modname="samba4.smb.signing --option=clientsigning=required anon")
|
||||
plansmbtorture4testsuite('base.xcopy', "s4member", ['//$NETBIOSNAME/xcopy_share', '-k', 'no', '--option=clientsigning=disabled', '-U%'], modname="samba4.smb.signing --option=clientsigning=disabled anon")
|
||||
|
||||
# Test SPNEGO without issuing an optimistic token
|
||||
opt='--option=spnego:client_no_optimistic=yes'
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "auth/gensec/gensec_internal.h"
|
||||
#include "auth/ntlmssp/ntlmssp.h"
|
||||
#include "auth/ntlmssp/ntlmssp_private.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "torture/torture.h"
|
||||
#include "param/param.h"
|
||||
#include "torture/auth/proto.h"
|
||||
@ -41,7 +41,7 @@ static bool torture_ntlmssp_self_check(struct torture_context *tctx)
|
||||
lpcfg_gensec_settings(tctx, tctx->lp_ctx)),
|
||||
"gensec client start");
|
||||
|
||||
gensec_set_credentials(gensec_security, popt_get_cmdline_credentials());
|
||||
gensec_set_credentials(gensec_security, samba_cmdline_get_creds());
|
||||
|
||||
gensec_want_feature(gensec_security, GENSEC_FEATURE_SIGN);
|
||||
gensec_want_feature(gensec_security, GENSEC_FEATURE_SEAL);
|
||||
@ -98,7 +98,7 @@ static bool torture_ntlmssp_self_check(struct torture_context *tctx)
|
||||
lpcfg_gensec_settings(tctx, tctx->lp_ctx)),
|
||||
"Failed to start GENSEC for NTLMSSP");
|
||||
|
||||
gensec_set_credentials(gensec_security, popt_get_cmdline_credentials());
|
||||
gensec_set_credentials(gensec_security, samba_cmdline_get_creds());
|
||||
|
||||
gensec_want_feature(gensec_security, GENSEC_FEATURE_SIGN);
|
||||
gensec_want_feature(gensec_security, GENSEC_FEATURE_SEAL);
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "libcli/composite/composite.h"
|
||||
#include "param/param.h"
|
||||
#include "torture/basic/proto.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
|
||||
static bool wait_lock(struct smbcli_state *c, int fnum, uint32_t offset, uint32_t len)
|
||||
{
|
||||
@ -874,7 +874,7 @@ static struct composite_context *torture_connect_async(
|
||||
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=popt_get_cmdline_credentials();
|
||||
smb->in.credentials = samba_cmdline_get_creds();
|
||||
smb->in.fallback_to_anonymous=false;
|
||||
smb->in.gensec_settings = lpcfg_gensec_settings(mem_ctx, tctx->lp_ctx);
|
||||
smb->in.workgroup=workgroup;
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "auth/session.h"
|
||||
#include "auth/gensec/gensec.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
|
||||
/* Tests that configure multiple DLZs will use this. Increase to add stress. */
|
||||
#define NUM_DLZS_TO_CONFIGURE 4
|
||||
@ -288,7 +288,7 @@ static bool test_dlz_bind9_gensec(struct torture_context *tctx, const char *mech
|
||||
torture_assert_ntstatus_ok(tctx, status, "gensec_set_target_service failed");
|
||||
|
||||
status = gensec_set_credentials(gensec_client_context,
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
torture_assert_ntstatus_ok(tctx, status, "gensec_set_credentials (client) failed");
|
||||
|
||||
status = gensec_start_mech_by_sasl_name(gensec_client_context, mech);
|
||||
@ -304,7 +304,7 @@ static bool test_dlz_bind9_gensec(struct torture_context *tctx, const char *mech
|
||||
|
||||
torture_assert_int_equal(tctx, dlz_ssumatch(
|
||||
cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials()),
|
||||
samba_cmdline_get_creds()),
|
||||
lpcfg_dnsdomain(tctx->lp_ctx),
|
||||
"127.0.0.1", "type", "key",
|
||||
client_to_server.length,
|
||||
@ -780,7 +780,7 @@ static bool test_dlz_bind9_update01(struct torture_context *tctx)
|
||||
torture_assert_ntstatus_ok(tctx, status, "gensec_set_target_service failed");
|
||||
|
||||
status = gensec_set_credentials(gensec_client_context,
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
torture_assert_ntstatus_ok(tctx, status, "gensec_set_credentials (client) failed");
|
||||
|
||||
status = gensec_start_mech_by_sasl_name(gensec_client_context, "GSS-SPNEGO");
|
||||
@ -796,7 +796,7 @@ static bool test_dlz_bind9_update01(struct torture_context *tctx)
|
||||
|
||||
torture_assert_int_equal(tctx, dlz_ssumatch(
|
||||
cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials()),
|
||||
samba_cmdline_get_creds()),
|
||||
name,
|
||||
"127.0.0.1",
|
||||
expected1->records[0].type,
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "librpc/gen_ndr/ndr_drsuapi_c.h"
|
||||
#include "librpc/gen_ndr/ndr_drsblobs.h"
|
||||
#include "libcli/cldap/cldap.h"
|
||||
@ -126,7 +126,7 @@ static struct DsSyncTest *test_create_context(struct torture_context *tctx)
|
||||
}
|
||||
|
||||
/* ctx->admin ...*/
|
||||
ctx->admin.credentials = popt_get_cmdline_credentials();
|
||||
ctx->admin.credentials = samba_cmdline_get_creds();
|
||||
|
||||
our_bind_info28 = &ctx->admin.drsuapi.our_bind_info28;
|
||||
our_bind_info28->supported_extensions = 0xFFFFFFFF;
|
||||
@ -146,7 +146,7 @@ static struct DsSyncTest *test_create_context(struct torture_context *tctx)
|
||||
ctx->admin.drsuapi.req.out.bind_handle = &ctx->admin.drsuapi.bind_handle;
|
||||
|
||||
/* ctx->new_dc ...*/
|
||||
ctx->new_dc.credentials = popt_get_cmdline_credentials();
|
||||
ctx->new_dc.credentials = samba_cmdline_get_creds();
|
||||
|
||||
our_bind_info28 = &ctx->new_dc.drsuapi.our_bind_info28;
|
||||
our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_BASE;
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "librpc/gen_ndr/ndr_drsuapi_c.h"
|
||||
#include "librpc/gen_ndr/ndr_drsblobs.h"
|
||||
#include "libcli/cldap/cldap.h"
|
||||
@ -186,7 +186,7 @@ static struct DsIntIdTestCtx *_dsintid_create_context(struct torture_context *tc
|
||||
}
|
||||
|
||||
/* populate test suite context */
|
||||
ctx->creds = popt_get_cmdline_credentials();
|
||||
ctx->creds = samba_cmdline_get_creds();
|
||||
ctx->dsa_bind.server_binding = server_binding;
|
||||
|
||||
ctx->ldap_url = talloc_asprintf(ctx, "ldap://%s",
|
||||
|
@ -5,7 +5,7 @@ bld.SAMBA_MODULE('TORTURE_DRS',
|
||||
autoproto='proto.h',
|
||||
subsystem='smbtorture',
|
||||
init_function='torture_drs_init',
|
||||
deps='samba-util ldb POPT_SAMBA samba-errors torture ldbsamba talloc dcerpc ndr NDR_DRSUAPI gensec samba-hostconfig RPC_NDR_DRSUAPI DSDB_MODULE_HELPERS asn1util samdb NDR_DRSBLOBS samba-credentials samdb-common LIBCLI_RESOLVE LP_RESOLVE torturemain',
|
||||
deps='samba-util ldb samba-errors torture ldbsamba talloc dcerpc ndr NDR_DRSUAPI gensec samba-hostconfig RPC_NDR_DRSUAPI DSDB_MODULE_HELPERS asn1util samdb NDR_DRSBLOBS samba-credentials samdb-common LIBCLI_RESOLVE LP_RESOLVE torturemain',
|
||||
internal_module=True,
|
||||
enabled=bld.PYTHON_BUILD_IS_ENABLED()
|
||||
)
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "torture/smbtorture.h"
|
||||
#include "torture/krb5/proto.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "source4/auth/kerberos/kerberos.h"
|
||||
#include "source4/auth/kerberos/kerberos_util.h"
|
||||
#include "lib/util/util_net.h"
|
||||
@ -1513,7 +1513,7 @@ static bool torture_krb5_as_req_canon(struct torture_context *tctx, const void *
|
||||
char *got_principal_string;
|
||||
char *assertion_message;
|
||||
const char *password = cli_credentials_get_password(
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
krb5_context k5_context;
|
||||
struct torture_krb5_context *test_context;
|
||||
bool ok;
|
||||
@ -2090,7 +2090,7 @@ static bool torture_krb5_as_req_canon(struct torture_context *tctx, const void *
|
||||
|
||||
torture_assert(tctx,
|
||||
test_accept_ticket(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
spn_real_realm,
|
||||
client_to_server),
|
||||
"test_accept_ticket failed - failed to accept the ticket we just created");
|
||||
@ -2101,7 +2101,7 @@ static bool torture_krb5_as_req_canon(struct torture_context *tctx, const void *
|
||||
|
||||
torture_assert(tctx,
|
||||
test_accept_ticket(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
spn,
|
||||
client_to_server),
|
||||
"test_accept_ticket failed - failed to accept the ticket we just created");
|
||||
@ -2113,7 +2113,7 @@ static bool torture_krb5_as_req_canon(struct torture_context *tctx, const void *
|
||||
|
||||
torture_assert(tctx,
|
||||
test_accept_ticket(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
principal_string,
|
||||
client_to_server),
|
||||
"test_accept_ticket failed - failed to accept the ticket we just created");
|
||||
@ -2131,7 +2131,7 @@ static bool torture_krb5_as_req_canon(struct torture_context *tctx, const void *
|
||||
|
||||
torture_assert(tctx,
|
||||
test_accept_ticket(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
accept_expected_principal_string,
|
||||
client_to_server),
|
||||
"test_accept_ticket failed - failed to accept the ticket we just created");
|
||||
@ -2139,7 +2139,7 @@ static bool torture_krb5_as_req_canon(struct torture_context *tctx, const void *
|
||||
|
||||
torture_assert(tctx,
|
||||
test_accept_ticket(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
expected_unparse_principal_string,
|
||||
client_to_server),
|
||||
"test_accept_ticket failed - failed to accept the ticket we just created");
|
||||
@ -2501,13 +2501,13 @@ struct torture_suite *torture_krb5_canon(TALLOC_CTX *mem_ctx)
|
||||
test_data->real_realm
|
||||
= strupper_talloc(test_data,
|
||||
cli_credentials_get_realm(
|
||||
popt_get_cmdline_credentials()));
|
||||
samba_cmdline_get_creds()));
|
||||
test_data->real_domain = cli_credentials_get_domain(
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
test_data->username = cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
test_data->real_username = cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
test_data->canonicalize = (i & TEST_CANONICALIZE) != 0;
|
||||
test_data->enterprise = (i & TEST_ENTERPRISE) != 0;
|
||||
test_data->upper_realm = (i & TEST_UPPER_REALM) != 0;
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "torture/winbind/proto.h"
|
||||
#include "torture/krb5/proto.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "source4/auth/kerberos/kerberos.h"
|
||||
#include "source4/auth/kerberos/kerberos_util.h"
|
||||
#include "lib/util/util_net.h"
|
||||
@ -870,7 +870,7 @@ static bool torture_krb5_as_req_creds(struct torture_context *tctx,
|
||||
|
||||
static bool torture_krb5_as_req_cmdline(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx, popt_get_cmdline_credentials(),
|
||||
return torture_krb5_as_req_creds(tctx, samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_PLAIN);
|
||||
}
|
||||
|
||||
@ -879,40 +879,40 @@ static bool torture_krb5_as_req_pac_request(struct torture_context *tctx)
|
||||
if (torture_setting_bool(tctx, "expect_rodc", false)) {
|
||||
torture_skip(tctx, "This test needs further investigation in the RODC case against a Windows DC, in particular with non-cached users");
|
||||
}
|
||||
return torture_krb5_as_req_creds(tctx, popt_get_cmdline_credentials(),
|
||||
return torture_krb5_as_req_creds(tctx, samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_PAC_REQUEST);
|
||||
}
|
||||
|
||||
static bool torture_krb5_as_req_break_pw(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx, popt_get_cmdline_credentials(),
|
||||
return torture_krb5_as_req_creds(tctx, samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_BREAK_PW);
|
||||
}
|
||||
|
||||
static bool torture_krb5_as_req_clock_skew(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx, popt_get_cmdline_credentials(),
|
||||
return torture_krb5_as_req_creds(tctx, samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_CLOCK_SKEW);
|
||||
}
|
||||
|
||||
static bool torture_krb5_as_req_aes(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_AES);
|
||||
}
|
||||
|
||||
static bool torture_krb5_as_req_rc4(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_RC4);
|
||||
}
|
||||
|
||||
static bool torture_krb5_as_req_aes_rc4(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_AES_RC4);
|
||||
}
|
||||
|
||||
@ -920,21 +920,21 @@ static bool torture_krb5_as_req_aes_rc4(struct torture_context *tctx)
|
||||
static bool torture_krb5_as_req_change_server_out(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_CHANGE_SERVER_OUT);
|
||||
}
|
||||
|
||||
static bool torture_krb5_as_req_change_server_in(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_CHANGE_SERVER_IN);
|
||||
}
|
||||
|
||||
static bool torture_krb5_as_req_change_server_both(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_CHANGE_SERVER_BOTH);
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "torture/winbind/proto.h"
|
||||
#include "torture/krb5/proto.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "source4/auth/kerberos/kerberos.h"
|
||||
#include "source4/auth/kerberos/kerberos_util.h"
|
||||
#include "lib/util/util_net.h"
|
||||
@ -691,7 +691,7 @@ static bool torture_krb5_as_req_creds(struct torture_context *tctx,
|
||||
static bool torture_krb5_as_req_cmdline(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_PLAIN);
|
||||
}
|
||||
|
||||
@ -707,7 +707,7 @@ static bool torture_krb5_as_req_pac_request(struct torture_context *tctx)
|
||||
"RODC case against a Windows DC, in particular "
|
||||
"with non-cached users");
|
||||
}
|
||||
return torture_krb5_as_req_creds(tctx, popt_get_cmdline_credentials(),
|
||||
return torture_krb5_as_req_creds(tctx, samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_PAC_REQUEST);
|
||||
}
|
||||
#endif /* HAVE_KRB5_GET_INIT_CREDS_OPT_SET_PAC_REQUEST */
|
||||
@ -715,35 +715,35 @@ static bool torture_krb5_as_req_pac_request(struct torture_context *tctx)
|
||||
static bool torture_krb5_as_req_break_pw(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_BREAK_PW);
|
||||
}
|
||||
|
||||
static bool torture_krb5_as_req_clock_skew(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_CLOCK_SKEW);
|
||||
}
|
||||
|
||||
static bool torture_krb5_as_req_aes(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_AES);
|
||||
}
|
||||
|
||||
static bool torture_krb5_as_req_rc4(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_RC4);
|
||||
}
|
||||
|
||||
static bool torture_krb5_as_req_aes_rc4(struct torture_context *tctx)
|
||||
{
|
||||
return torture_krb5_as_req_creds(tctx,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
TORTURE_KRB5_TEST_AES_RC4);
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
|
||||
autoproto='proto.h',
|
||||
subsystem='smbtorture',
|
||||
init_function='torture_krb5_init',
|
||||
deps='authkrb5 popt POPT_CREDENTIALS torture KERBEROS_UTIL',
|
||||
deps='authkrb5 torture KERBEROS_UTIL',
|
||||
internal_module=True)
|
||||
else:
|
||||
bld.SAMBA_MODULE('TORTURE_KRB5',
|
||||
@ -15,5 +15,5 @@ if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
|
||||
autoproto='proto.h',
|
||||
subsystem='smbtorture',
|
||||
init_function='torture_krb5_init',
|
||||
deps='authkrb5 popt POPT_CREDENTIALS torture KERBEROS_UTIL',
|
||||
deps='authkrb5 torture KERBEROS_UTIL',
|
||||
internal_module=True)
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "includes.h"
|
||||
#include "ldb_wrap.h"
|
||||
#include "libcli/ldap/ldap_client.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
|
||||
#include "torture/torture.h"
|
||||
#include "torture/ldap/proto.h"
|
||||
@ -721,7 +721,7 @@ static bool test_referrals(struct torture_context *tctx, TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
ldb = ldb_wrap_connect(mem_ctx, tctx->ev, tctx->lp_ctx, url,
|
||||
NULL, popt_get_cmdline_credentials(), 0);
|
||||
NULL, samba_cmdline_get_creds(), 0);
|
||||
|
||||
/* "partitions[i]" are the partitions for which we search the parents */
|
||||
for (i = 1; partitions[i] != NULL; i++) {
|
||||
@ -965,7 +965,7 @@ bool torture_ldap_basic(struct torture_context *torture)
|
||||
ret = false;
|
||||
}
|
||||
|
||||
if (!test_bind_sasl(torture, conn, popt_get_cmdline_credentials())) {
|
||||
if (!test_bind_sasl(torture, conn, samba_cmdline_get_creds())) {
|
||||
ret = false;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <ldb_errors.h>
|
||||
#include "ldb_wrap.h"
|
||||
#include "param/param.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libcli/ldap/ldap_client.h"
|
||||
#include "torture/smbtorture.h"
|
||||
#include "torture/ldap/proto.h"
|
||||
@ -61,7 +61,7 @@ bool torture_ldap_sort(struct torture_context *torture)
|
||||
|
||||
ldb = ldb_wrap_connect(torture, torture->ev, torture->lp_ctx, url,
|
||||
NULL,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0);
|
||||
torture_assert(torture, ldb, "Failed to make LDB connection to target");
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "includes.h"
|
||||
#include "ldb.h"
|
||||
#include "ldb_wrap.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libcli/ldap/ldap_client.h"
|
||||
#include "torture/torture.h"
|
||||
#include "torture/ldap/proto.h"
|
||||
@ -162,7 +162,7 @@ bool test_ldap_nested_search(struct torture_context *tctx)
|
||||
torture_comment(tctx, "Connecting to: %s\n", url);
|
||||
sctx->ldb = ldb_wrap_connect(sctx, tctx->ev, tctx->lp_ctx, url,
|
||||
NULL,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0);
|
||||
torture_assert(tctx, sctx->ldb, "Failed to create ldb connection");
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include "libcli/ldap/ldap_client.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "ldb_wrap.h"
|
||||
#include "dsdb/samdb/samdb.h"
|
||||
#include "../lib/util/dlinklist.h"
|
||||
@ -388,7 +388,7 @@ bool torture_ldap_schema(struct torture_context *torture)
|
||||
|
||||
ldb = ldb_wrap_connect(torture, torture->ev, torture->lp_ctx, url,
|
||||
NULL,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0);
|
||||
if (!ldb) goto failed;
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <ldb_errors.h>
|
||||
#include "ldb_wrap.h"
|
||||
#include "param/param.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "libcli/ldap/ldap_client.h"
|
||||
#include "torture/smbtorture.h"
|
||||
@ -35,7 +35,7 @@
|
||||
bool torture_ldap_session_expiry(struct torture_context *torture)
|
||||
{
|
||||
const char *host = torture_setting_string(torture, "host", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
struct ldb_context *ldb = NULL;
|
||||
const char *url = NULL;
|
||||
bool ret = false;
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include "libcli/ldap/ldap_client.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "ldb_wrap.h"
|
||||
#include "dsdb/samdb/samdb.h"
|
||||
|
||||
@ -159,7 +159,7 @@ bool torture_ldap_uptodatevector(struct torture_context *torture)
|
||||
|
||||
ldb = ldb_wrap_connect(torture, torture->ev, torture->lp_ctx, url,
|
||||
NULL,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0);
|
||||
if (!ldb) goto failed;
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
#include "libnet/libnet.h"
|
||||
#include "dsdb/samdb/samdb.h"
|
||||
@ -92,7 +92,7 @@ bool torture_net_become_dc(struct torture_context *torture)
|
||||
torture_assert(torture, s, "libnet_vampire_cb_state_init");
|
||||
|
||||
ctx = libnet_context_init(torture->ev, torture->lp_ctx);
|
||||
ctx->cred = popt_get_cmdline_credentials();
|
||||
ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
ZERO_STRUCT(b);
|
||||
b.in.domain_dns_name = torture_join_dom_dns_name(tj);
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libnet/libnet.h"
|
||||
#include "librpc/gen_ndr/ndr_samr_c.h"
|
||||
#include "librpc/gen_ndr/ndr_lsa_c.h"
|
||||
@ -141,7 +141,7 @@ bool torture_domain_open_lsa(struct torture_context *torture)
|
||||
return false;
|
||||
}
|
||||
|
||||
ctx->cred = popt_get_cmdline_credentials();
|
||||
ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
ZERO_STRUCT(r);
|
||||
r.in.type = DOMAIN_LSA;
|
||||
@ -196,11 +196,11 @@ bool torture_domain_close_lsa(struct torture_context *torture)
|
||||
goto done;
|
||||
}
|
||||
|
||||
ctx->cred = popt_get_cmdline_credentials();
|
||||
ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
mem_ctx = talloc_init("torture_domain_close_lsa");
|
||||
status = dcerpc_pipe_connect_b(mem_ctx, &p, binding, &ndr_table_lsarpc,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
torture->ev, torture->lp_ctx);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
torture_comment(torture, "failed to connect to server: %s\n", nt_errstr(status));
|
||||
@ -252,7 +252,7 @@ bool torture_domain_open_samr(struct torture_context *torture)
|
||||
mem_ctx = talloc_init("test_domainopen_lsa");
|
||||
|
||||
ctx = libnet_context_init(torture->ev, torture->lp_ctx);
|
||||
ctx->cred = popt_get_cmdline_credentials();
|
||||
ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
/* we're accessing domain controller so the domain name should be
|
||||
passed (it's going to be resolved to dc name and address) instead
|
||||
@ -323,7 +323,7 @@ bool torture_domain_close_samr(struct torture_context *torture)
|
||||
goto done;
|
||||
}
|
||||
|
||||
ctx->cred = popt_get_cmdline_credentials();
|
||||
ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
mem_ctx = talloc_init("torture_domain_close_samr");
|
||||
status = dcerpc_pipe_connect_b(mem_ctx, &p, binding, &ndr_table_samr,
|
||||
@ -387,7 +387,7 @@ bool torture_domain_list(struct torture_context *torture)
|
||||
goto done;
|
||||
}
|
||||
|
||||
ctx->cred = popt_get_cmdline_credentials();
|
||||
ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
mem_ctx = talloc_init("torture_domain_close_samr");
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libnet/libnet.h"
|
||||
#include "librpc/gen_ndr/ndr_samr_c.h"
|
||||
#include "librpc/gen_ndr/ndr_lsa_c.h"
|
||||
@ -114,7 +114,7 @@ bool torture_grouplist(struct torture_context *torture)
|
||||
int i;
|
||||
|
||||
ctx = libnet_context_init(torture->ev, torture->lp_ctx);
|
||||
ctx->cred = popt_get_cmdline_credentials();
|
||||
ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
domain_name.string = lpcfg_workgroup(torture->lp_ctx);
|
||||
mem_ctx = talloc_init("torture group list");
|
||||
@ -177,7 +177,7 @@ bool torture_creategroup(struct torture_context *torture)
|
||||
mem_ctx = talloc_init("test_creategroup");
|
||||
|
||||
ctx = libnet_context_init(torture->ev, torture->lp_ctx);
|
||||
ctx->cred = popt_get_cmdline_credentials();
|
||||
ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
req.in.group_name = TEST_GROUPNAME;
|
||||
req.in.domain_name = lpcfg_workgroup(torture->lp_ctx);
|
||||
|
@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libnet/libnet.h"
|
||||
#include "libcli/libcli.h"
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
@ -39,7 +39,7 @@ bool torture_lookup(struct torture_context *torture)
|
||||
mem_ctx = talloc_init("test_lookup");
|
||||
|
||||
ctx = libnet_context_init(torture->ev, torture->lp_ctx);
|
||||
ctx->cred = popt_get_cmdline_credentials();
|
||||
ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
lookup.in.hostname = torture_setting_string(torture, "host", NULL);
|
||||
if (lookup.in.hostname == NULL) {
|
||||
@ -83,7 +83,7 @@ bool torture_lookup_host(struct torture_context *torture)
|
||||
mem_ctx = talloc_init("test_lookup_host");
|
||||
|
||||
ctx = libnet_context_init(torture->ev, torture->lp_ctx);
|
||||
ctx->cred = popt_get_cmdline_credentials();
|
||||
ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
lookup.in.hostname = torture_setting_string(torture, "host", NULL);
|
||||
if (lookup.in.hostname == NULL) {
|
||||
@ -126,7 +126,7 @@ bool torture_lookup_pdc(struct torture_context *torture)
|
||||
mem_ctx = talloc_init("test_lookup_pdc");
|
||||
|
||||
ctx = libnet_context_init(torture->ev, torture->lp_ctx);
|
||||
ctx->cred = popt_get_cmdline_credentials();
|
||||
ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
talloc_steal(ctx, mem_ctx);
|
||||
|
||||
@ -171,7 +171,7 @@ bool torture_lookup_sam_name(struct torture_context *torture)
|
||||
bool ret = true;
|
||||
|
||||
ctx = libnet_context_init(torture->ev, torture->lp_ctx);
|
||||
ctx->cred = popt_get_cmdline_credentials();
|
||||
ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
mem_ctx = talloc_init("torture lookup sam name");
|
||||
if (mem_ctx == NULL) return false;
|
||||
|
@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libnet/libnet.h"
|
||||
#include "libcli/security/security.h"
|
||||
#include "librpc/gen_ndr/ndr_lsa.h"
|
||||
@ -90,7 +90,7 @@ static bool torture_rpc_connect(struct torture_context *torture,
|
||||
struct libnet_context *ctx;
|
||||
|
||||
ctx = libnet_context_init(torture->ev, torture->lp_ctx);
|
||||
ctx->cred = popt_get_cmdline_credentials();
|
||||
ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
torture_comment(torture, "Testing connection to LSA interface\n");
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "includes.h"
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
#include "libnet/libnet.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "librpc/gen_ndr/ndr_srvsvc_c.h"
|
||||
#include "torture/libnet/proto.h"
|
||||
|
||||
@ -182,7 +182,7 @@ bool torture_listshares(struct torture_context *torture)
|
||||
goto done;
|
||||
}
|
||||
|
||||
libnetctx->cred = popt_get_cmdline_credentials();
|
||||
libnetctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
torture_comment(torture, "Testing libnet_ListShare\n");
|
||||
|
||||
@ -263,7 +263,7 @@ bool torture_delshare(struct torture_context *torture)
|
||||
torture_assert_ntstatus_ok(torture, status, "Failed to get binding");
|
||||
|
||||
libnetctx = libnet_context_init(torture->ev, torture->lp_ctx);
|
||||
libnetctx->cred = popt_get_cmdline_credentials();
|
||||
libnetctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
status = torture_rpc_connection(torture,
|
||||
&p,
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include "system/time.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libnet/libnet.h"
|
||||
#include "librpc/gen_ndr/ndr_samr_c.h"
|
||||
#include "librpc/gen_ndr/ndr_lsa_c.h"
|
||||
@ -466,7 +466,7 @@ bool torture_userlist(struct torture_context *torture)
|
||||
int i;
|
||||
|
||||
ctx = libnet_context_init(torture->ev, torture->lp_ctx);
|
||||
ctx->cred = popt_get_cmdline_credentials();
|
||||
ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
domain_name.string = lpcfg_workgroup(torture->lp_ctx);
|
||||
mem_ctx = talloc_init("torture user list");
|
||||
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
#include "libnet/libnet.h"
|
||||
#include "librpc/gen_ndr/ndr_samr_c.h"
|
||||
@ -134,7 +134,7 @@ static bool _get_account_name_for_user_rdn(struct torture_context *tctx,
|
||||
|
||||
ldb = ldb_wrap_connect(tmp_ctx,
|
||||
tctx->ev, tctx->lp_ctx,
|
||||
url, NULL, popt_get_cmdline_credentials(), 0);
|
||||
url, NULL, samba_cmdline_get_creds(), 0);
|
||||
torture_assert_goto(tctx, ldb != NULL, test_res, done, "Failed to make LDB connection");
|
||||
|
||||
ldb_ret = ldb_search(ldb, tmp_ctx, &ldb_res,
|
||||
@ -493,7 +493,7 @@ bool test_libnet_context_init(struct torture_context *tctx,
|
||||
torture_assert(tctx, net_ctx != NULL, "Failed to create libnet_context");
|
||||
|
||||
/* Use command line credentials for testing */
|
||||
net_ctx->cred = popt_get_cmdline_credentials();
|
||||
net_ctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
if (rpc_connect) {
|
||||
/* connect SAMR pipe */
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "source3/include/includes.h"
|
||||
#include "torture/smbtorture.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "source3/lib/netapi/netapi.h"
|
||||
#include "source3/lib/netapi/netapi_private.h"
|
||||
#include "lib/param/param.h"
|
||||
@ -48,9 +48,9 @@ bool torture_libnetapi_init_context(struct torture_context *tctx,
|
||||
}
|
||||
|
||||
libnetapi_set_username(ctx,
|
||||
cli_credentials_get_username(popt_get_cmdline_credentials()));
|
||||
cli_credentials_get_username(samba_cmdline_get_creds()));
|
||||
libnetapi_set_password(ctx,
|
||||
cli_credentials_get_password(popt_get_cmdline_credentials()));
|
||||
cli_credentials_get_password(samba_cmdline_get_creds()));
|
||||
|
||||
*ctx_p = ctx;
|
||||
|
||||
|
@ -5,7 +5,7 @@ bld.SAMBA_MODULE('TORTURE_LIBNETAPI',
|
||||
autoproto='proto.h',
|
||||
subsystem='smbtorture',
|
||||
init_function='torture_libnetapi_init',
|
||||
deps='POPT_CREDENTIALS netapi',
|
||||
deps='netapi',
|
||||
internal_module=True,
|
||||
)
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "system/dir.h"
|
||||
#include "torture/smbtorture.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include <libsmbclient.h>
|
||||
#include "torture/libsmbclient/proto.h"
|
||||
#include "lib/param/loadparm.h"
|
||||
@ -49,11 +49,11 @@ static void auth_callback(const char *srv,
|
||||
char *pw, int pwlen)
|
||||
{
|
||||
const char *workgroup =
|
||||
cli_credentials_get_domain(popt_get_cmdline_credentials());
|
||||
cli_credentials_get_domain(samba_cmdline_get_creds());
|
||||
const char *username =
|
||||
cli_credentials_get_username(popt_get_cmdline_credentials());
|
||||
cli_credentials_get_username(samba_cmdline_get_creds());
|
||||
const char *password =
|
||||
cli_credentials_get_password(popt_get_cmdline_credentials());
|
||||
cli_credentials_get_password(samba_cmdline_get_creds());
|
||||
ssize_t ret;
|
||||
|
||||
if (workgroup != NULL) {
|
||||
@ -82,9 +82,9 @@ bool torture_libsmbclient_init_context(struct torture_context *tctx,
|
||||
SMBCCTX **ctx_p)
|
||||
{
|
||||
const char *workgroup =
|
||||
cli_credentials_get_domain(popt_get_cmdline_credentials());
|
||||
cli_credentials_get_domain(samba_cmdline_get_creds());
|
||||
const char *username =
|
||||
cli_credentials_get_username(popt_get_cmdline_credentials());
|
||||
cli_credentials_get_username(samba_cmdline_get_creds());
|
||||
const char *client_proto =
|
||||
torture_setting_string(tctx, "clientprotocol", NULL);
|
||||
SMBCCTX *ctx = NULL;
|
||||
|
@ -6,7 +6,7 @@ bld.SAMBA_MODULE('TORTURE_LIBSMBCLIENT',
|
||||
autoproto='proto.h',
|
||||
subsystem='smbtorture',
|
||||
init_function='torture_libsmbclient_init',
|
||||
deps='POPT_CREDENTIALS smbclient',
|
||||
deps='smbclient',
|
||||
internal_module=True
|
||||
)
|
||||
|
||||
|
@ -31,7 +31,7 @@ TORTURE_LOCAL_SOURCE = '''../../../lib/util/charset/tests/iconv.c
|
||||
fsrvp_state.c
|
||||
smbtorture_fullname.c'''
|
||||
|
||||
TORTURE_LOCAL_DEPS = 'RPC_NDR_ECHO TDR LIBCLI_SMB MESSAGING iconv POPT_CREDENTIALS TORTURE_AUTH TORTURE_UTIL TORTURE_NDR TORTURE_LIBCRYPTO share torture_registry %s ldb samdb replace-test RPC_FSS_STATE util_str_escape' % provision
|
||||
TORTURE_LOCAL_DEPS = 'RPC_NDR_ECHO TDR LIBCLI_SMB MESSAGING iconv TORTURE_AUTH TORTURE_UTIL TORTURE_NDR TORTURE_LIBCRYPTO share torture_registry %s ldb samdb replace-test RPC_FSS_STATE util_str_escape' % provision
|
||||
|
||||
bld.SAMBA_MODULE('TORTURE_LOCAL',
|
||||
source=TORTURE_LOCAL_SOURCE,
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "libcli/composite/composite.h"
|
||||
#include "libcli/smb_composite/smb_composite.h"
|
||||
#include "librpc/gen_ndr/ndr_misc.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "torture/util.h"
|
||||
#include "param/param.h"
|
||||
#include "libcli/resolve/resolve.h"
|
||||
@ -159,7 +159,7 @@ static bool test_fetchfile(struct torture_context *tctx, struct smbcli_state *cl
|
||||
io2.in.service_type = "A:";
|
||||
io2.in.socket_options = lpcfg_socket_options(tctx->lp_ctx);
|
||||
|
||||
io2.in.credentials = popt_get_cmdline_credentials();
|
||||
io2.in.credentials = samba_cmdline_get_creds();
|
||||
io2.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
|
||||
io2.in.filename = fname;
|
||||
lpcfg_smbcli_options(tctx->lp_ctx, &io2.in.options);
|
||||
@ -348,7 +348,7 @@ static bool test_fsinfo(struct torture_context *tctx, struct smbcli_state *cli)
|
||||
io1.in.called_name = torture_setting_string(tctx, "host", NULL);
|
||||
io1.in.service = torture_setting_string(tctx, "share", NULL);
|
||||
io1.in.service_type = "A:";
|
||||
io1.in.credentials = popt_get_cmdline_credentials();
|
||||
io1.in.credentials = samba_cmdline_get_creds();
|
||||
io1.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
|
||||
io1.in.level = RAW_QFS_OBJECTID_INFORMATION;
|
||||
io1.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "libcli/raw/libcliraw.h"
|
||||
#include "libcli/raw/raw_proto.h"
|
||||
#include "libcli/smb_composite/smb_composite.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libcli/libcli.h"
|
||||
#include "torture/util.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
@ -86,7 +86,7 @@ static bool test_session(struct torture_context *tctx,
|
||||
setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
|
||||
setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
|
||||
|
||||
setup.in.credentials = popt_get_cmdline_credentials();
|
||||
setup.in.credentials = samba_cmdline_get_creds();
|
||||
setup.in.gensec_settings = gensec_settings;
|
||||
|
||||
status = smb_composite_sesssetup(session, &setup);
|
||||
@ -114,7 +114,7 @@ static bool test_session(struct torture_context *tctx,
|
||||
setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
|
||||
setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
|
||||
|
||||
setup.in.credentials = popt_get_cmdline_credentials();
|
||||
setup.in.credentials = samba_cmdline_get_creds();
|
||||
|
||||
torture_comment(tctx, "vuid1=%d vuid2=%d vuid3=%d\n", cli->session->vuid, session->vuid, vuid3);
|
||||
|
||||
@ -142,7 +142,7 @@ static bool test_session(struct torture_context *tctx,
|
||||
setup.in.capabilities &= ~CAP_EXTENDED_SECURITY; /* force a non extended security login (should fail) */
|
||||
setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
|
||||
|
||||
setup.in.credentials = popt_get_cmdline_credentials();
|
||||
setup.in.credentials = samba_cmdline_get_creds();
|
||||
|
||||
status = smb_composite_sesssetup(session3, &setup);
|
||||
if (!NT_STATUS_EQUAL(status, NT_STATUS_LOGON_FAILURE)) {
|
||||
@ -239,7 +239,7 @@ static bool test_session(struct torture_context *tctx,
|
||||
setups[i].in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
|
||||
setups[i].in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
|
||||
|
||||
setups[i].in.credentials = popt_get_cmdline_credentials();
|
||||
setups[i].in.credentials = samba_cmdline_get_creds();
|
||||
setups[i].in.gensec_settings = gensec_settings;
|
||||
|
||||
sessions[i] = smbcli_session_init(cli->transport, tctx, false, options);
|
||||
@ -402,7 +402,7 @@ static bool test_tree_ulogoff(struct torture_context *tctx, struct smbcli_state
|
||||
setup.in.sesskey = cli->transport->negotiate.sesskey;
|
||||
setup.in.capabilities = cli->transport->negotiate.capabilities;
|
||||
setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
|
||||
setup.in.credentials = popt_get_cmdline_credentials();
|
||||
setup.in.credentials = samba_cmdline_get_creds();
|
||||
setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
|
||||
status = smb_composite_sesssetup(session1, &setup);
|
||||
CHECK_STATUS(status, NT_STATUS_OK);
|
||||
@ -459,7 +459,7 @@ static bool test_tree_ulogoff(struct torture_context *tctx, struct smbcli_state
|
||||
setup.in.sesskey = cli->transport->negotiate.sesskey;
|
||||
setup.in.capabilities = cli->transport->negotiate.capabilities;
|
||||
setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
|
||||
setup.in.credentials = popt_get_cmdline_credentials();
|
||||
setup.in.credentials = samba_cmdline_get_creds();
|
||||
setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
|
||||
status = smb_composite_sesssetup(session2, &setup);
|
||||
CHECK_STATUS(status, NT_STATUS_OK);
|
||||
@ -659,7 +659,7 @@ static bool test_pid_2sess(struct torture_context *tctx,
|
||||
setup.in.sesskey = cli->transport->negotiate.sesskey;
|
||||
setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
|
||||
setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
|
||||
setup.in.credentials = popt_get_cmdline_credentials();
|
||||
setup.in.credentials = samba_cmdline_get_creds();
|
||||
setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
|
||||
|
||||
status = smb_composite_sesssetup(session, &setup);
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "torture/util.h"
|
||||
#include "libcli/composite/composite.h"
|
||||
#include "libcli/smb_composite/smb_composite.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "param/param.h"
|
||||
#include "torture/raw/proto.h"
|
||||
|
||||
@ -816,7 +816,7 @@ static bool test_async(struct torture_context *tctx,
|
||||
setup.in.sesskey = cli->transport->negotiate.sesskey;
|
||||
setup.in.capabilities = cli->transport->negotiate.capabilities;
|
||||
setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
|
||||
setup.in.credentials = popt_get_cmdline_credentials();
|
||||
setup.in.credentials = samba_cmdline_get_creds();
|
||||
setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
|
||||
status = smb_composite_sesssetup(session, &setup);
|
||||
CHECK_STATUS(status, NT_STATUS_OK);
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "libcli/libcli.h"
|
||||
#include "torture/util.h"
|
||||
#include "lib/events/events.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libcli/composite/composite.h"
|
||||
#include "libcli/smb_composite/smb_composite.h"
|
||||
#include "libcli/resolve/resolve.h"
|
||||
@ -195,7 +195,7 @@ static void reopen_connection(struct tevent_context *ev, struct tevent_timer *te
|
||||
io->in.called_name = state->called_name;
|
||||
io->in.service = share;
|
||||
io->in.service_type = state->service_type;
|
||||
io->in.credentials = popt_get_cmdline_credentials();
|
||||
io->in.credentials = samba_cmdline_get_creds();
|
||||
io->in.fallback_to_anonymous = false;
|
||||
io->in.workgroup = lpcfg_workgroup(state->tctx->lp_ctx);
|
||||
lpcfg_smbcli_options(state->tctx->lp_ctx, &io->in.options);
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "libcli/libcli.h"
|
||||
#include "torture/util.h"
|
||||
#include "lib/events/events.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libcli/composite/composite.h"
|
||||
#include "libcli/smb_composite/smb_composite.h"
|
||||
#include "libcli/resolve/resolve.h"
|
||||
@ -137,7 +137,7 @@ static void reopen_connection(struct tevent_context *ev, struct tevent_timer *te
|
||||
io->in.called_name = state->called_name;
|
||||
io->in.service = share;
|
||||
io->in.service_type = state->service_type;
|
||||
io->in.credentials = popt_get_cmdline_credentials();
|
||||
io->in.credentials = samba_cmdline_get_creds();
|
||||
io->in.fallback_to_anonymous = false;
|
||||
io->in.workgroup = lpcfg_workgroup(state->tctx->lp_ctx);
|
||||
io->in.gensec_settings = lpcfg_gensec_settings(state->mem_ctx, state->tctx->lp_ctx);
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "torture/util.h"
|
||||
#include "lib/events/events.h"
|
||||
#include "param/param.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libcli/resolve/resolve.h"
|
||||
#include "torture/raw/proto.h"
|
||||
|
||||
@ -187,7 +187,7 @@ static bool open_connection_no_level2_oplocks(struct torture_context *tctx,
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
torture_setting_string(tctx, "share", NULL),
|
||||
NULL, lpcfg_socket_options(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
tctx->ev, &options, &session_options,
|
||||
lpcfg_gensec_settings(tctx, tctx->lp_ctx));
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "libcli/libcli.h"
|
||||
#include "torture/raw/proto.h"
|
||||
#include "smb_composite/smb_composite.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "param/param.h"
|
||||
#include "torture/util.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
@ -63,7 +63,7 @@ static bool test_session_reauth1(struct torture_context *tctx,
|
||||
ZERO_STRUCT(io);
|
||||
io.in.sesskey = cli->transport->negotiate.sesskey;
|
||||
io.in.capabilities = cli->transport->negotiate.capabilities;
|
||||
io.in.credentials = popt_get_cmdline_credentials();
|
||||
io.in.credentials = samba_cmdline_get_creds();
|
||||
io.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
|
||||
io.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
|
||||
status = smb_composite_sesssetup(cli->session, &io);
|
||||
@ -205,7 +205,7 @@ static bool test_session_reauth2(struct torture_context *tctx,
|
||||
ZERO_STRUCT(io_sesssetup);
|
||||
io_sesssetup.in.sesskey = cli->transport->negotiate.sesskey;
|
||||
io_sesssetup.in.capabilities = cli->transport->negotiate.capabilities;
|
||||
io_sesssetup.in.credentials = popt_get_cmdline_credentials();
|
||||
io_sesssetup.in.credentials = samba_cmdline_get_creds();
|
||||
io_sesssetup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
|
||||
io_sesssetup.in.gensec_settings = lpcfg_gensec_settings(
|
||||
tctx, tctx->lp_ctx);
|
||||
@ -244,7 +244,7 @@ static bool test_session_expire1(struct torture_context *tctx)
|
||||
size_t i;
|
||||
|
||||
use_kerberos = cli_credentials_get_kerberos_state(
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
if (use_kerberos != CRED_USE_KERBEROS_REQUIRED) {
|
||||
torture_warning(tctx, "smb2.session.expire1 requires -k yes!");
|
||||
torture_skip(tctx, "smb2.session.expire1 requires -k yes!");
|
||||
@ -264,7 +264,7 @@ static bool test_session_expire1(struct torture_context *tctx)
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
share, NULL,
|
||||
lpcfg_socket_options(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
tctx->ev, &options, &session_options,
|
||||
lpcfg_gensec_settings(tctx, tctx->lp_ctx));
|
||||
@ -312,7 +312,7 @@ static bool test_session_expire1(struct torture_context *tctx)
|
||||
* the krb5 library may not handle expired creds
|
||||
* well, lets start with an empty ccache.
|
||||
*/
|
||||
cli_credentials_invalidate_ccache(popt_get_cmdline_credentials(),
|
||||
cli_credentials_invalidate_ccache(samba_cmdline_get_creds(),
|
||||
CRED_SPECIFIED);
|
||||
|
||||
/*
|
||||
@ -324,7 +324,7 @@ static bool test_session_expire1(struct torture_context *tctx)
|
||||
io_sesssetup.in.sesskey = cli->transport->negotiate.sesskey;
|
||||
io_sesssetup.in.capabilities = cli->transport->negotiate.capabilities;
|
||||
io_sesssetup.in.capabilities |= CAP_DYNAMIC_REAUTH;
|
||||
io_sesssetup.in.credentials = popt_get_cmdline_credentials();
|
||||
io_sesssetup.in.credentials = samba_cmdline_get_creds();
|
||||
io_sesssetup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx);
|
||||
io_sesssetup.in.gensec_settings = lpcfg_gensec_settings(tctx,
|
||||
tctx->lp_ctx);
|
||||
@ -359,7 +359,7 @@ static bool test_session_expire1(struct torture_context *tctx)
|
||||
* well, lets start with an empty ccache.
|
||||
*/
|
||||
cli_credentials_invalidate_ccache(
|
||||
popt_get_cmdline_credentials(), CRED_SPECIFIED);
|
||||
samba_cmdline_get_creds(), CRED_SPECIFIED);
|
||||
|
||||
torture_comment(tctx, "reauth with CAP_DYNAMIC_REAUTH => OK\n");
|
||||
ZERO_STRUCT(io_sesssetup.out);
|
||||
@ -380,7 +380,7 @@ static bool test_session_expire1(struct torture_context *tctx)
|
||||
* the krb5 library may not handle expired creds
|
||||
* well, lets start with an empty ccache.
|
||||
*/
|
||||
cli_credentials_invalidate_ccache(popt_get_cmdline_credentials(),
|
||||
cli_credentials_invalidate_ccache(samba_cmdline_get_creds(),
|
||||
CRED_SPECIFIED);
|
||||
|
||||
/*
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "libcli/libcli.h"
|
||||
#include "libcli/resolve/resolve.h"
|
||||
#include "torture/smbtorture.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "param/param.h"
|
||||
|
||||
#include "system/filesys.h"
|
||||
@ -101,7 +101,7 @@ static int fork_tcon_client(struct torture_context *tctx,
|
||||
status = smbcli_full_connection(NULL, &cli,
|
||||
host, lpcfg_smb_ports(tctx->lp_ctx), share,
|
||||
NULL, lpcfg_socket_options(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
tctx->ev, &options, &session_options,
|
||||
lpcfg_gensec_settings(tctx, tctx->lp_ctx));
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include "librpc/gen_ndr/ndr_lsa.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
|
||||
/*
|
||||
@ -63,7 +63,7 @@ bool torture_async_bind(struct torture_context *torture)
|
||||
if (table == NULL) return false;
|
||||
|
||||
/* credentials */
|
||||
creds = popt_get_cmdline_credentials();
|
||||
creds = samba_cmdline_get_creds();
|
||||
|
||||
/* send bind requests */
|
||||
for (i = 0; i < torture_numasync; i++) {
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "librpc/gen_ndr/ndr_backupkey.h"
|
||||
#include "librpc/gen_ndr/ndr_lsa_c.h"
|
||||
#include "librpc/gen_ndr/ndr_security.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libcli/auth/proto.h"
|
||||
#include <system/network.h>
|
||||
|
||||
@ -80,7 +80,7 @@ static struct dom_sid *get_user_sid(struct torture_context *tctx,
|
||||
struct dcerpc_binding_handle *b;
|
||||
|
||||
const char *domain = cli_credentials_get_domain(
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
|
||||
torture_assert_ntstatus_ok(tctx,
|
||||
torture_rpc_connection(tctx, &p2, &ndr_table_lsarpc),
|
||||
@ -646,7 +646,7 @@ static struct bkrp_BackupKey *createRestoreGUIDStruct(struct torture_context *tc
|
||||
user = "guest";
|
||||
} else {
|
||||
user = cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
}
|
||||
|
||||
|
||||
@ -1772,7 +1772,7 @@ static bool test_ServerWrap_encrypt_decrypt_manual(struct torture_context *tctx,
|
||||
torture_assert_ntstatus_ok(tctx,
|
||||
dcerpc_pipe_connect_b(tctx, &lsa_p,
|
||||
lsa_binding, &ndr_table_lsarpc,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
tctx->ev, tctx->lp_ctx),
|
||||
"Opening LSA pipe");
|
||||
lsa_b = lsa_p->binding_handle;
|
||||
@ -1941,7 +1941,7 @@ static bool test_ServerWrap_encrypt_decrypt_manual(struct torture_context *tctx,
|
||||
/* Not strictly correct all the time, but good enough for this test */
|
||||
caller_sid = get_user_sid(tctx, tctx,
|
||||
cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials()));
|
||||
samba_cmdline_get_creds()));
|
||||
|
||||
torture_assert_sid_equal(tctx, &rc4payload.sid, caller_sid, "Secret saved with wrong SID");
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
#include "librpc/gen_ndr/ndr_lsa_c.h"
|
||||
#include "librpc/gen_ndr/ndr_epmapper_c.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
|
||||
static bool test_openpolicy(struct torture_context *tctx,
|
||||
struct dcerpc_pipe *p)
|
||||
@ -60,7 +60,7 @@ static bool test_bind(struct torture_context *tctx,
|
||||
torture_assert_ntstatus_ok(tctx,
|
||||
dcerpc_pipe_connect_b(tctx, &p, binding,
|
||||
&ndr_table_lsarpc,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
tctx->ev,
|
||||
tctx->lp_ctx),
|
||||
"failed to connect pipe");
|
||||
@ -107,7 +107,7 @@ static bool test_assoc_group_handles_external(struct torture_context *tctx,
|
||||
torture_assert_ntstatus_ok(tctx,
|
||||
dcerpc_pipe_connect_b(tctx, &p1, binding1,
|
||||
&ndr_table_epmapper,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
tctx->ev,
|
||||
tctx->lp_ctx),
|
||||
"failed to connect first pipe");
|
||||
@ -141,7 +141,7 @@ static bool test_assoc_group_handles_external(struct torture_context *tctx,
|
||||
torture_assert_ntstatus_ok(tctx,
|
||||
dcerpc_pipe_connect_b(tctx, &p2, binding2,
|
||||
&ndr_table_epmapper,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
tctx->ev,
|
||||
tctx->lp_ctx),
|
||||
"failed to connect second pipe");
|
||||
@ -159,7 +159,7 @@ static bool test_assoc_group_handles_external(struct torture_context *tctx,
|
||||
torture_assert_ntstatus_ok(tctx,
|
||||
dcerpc_pipe_connect_b(tctx, &p2, binding2,
|
||||
&ndr_table_epmapper,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
tctx->ev,
|
||||
tctx->lp_ctx),
|
||||
"failed to connect second pipe");
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "libnet/libnet.h"
|
||||
#include "torture/util.h"
|
||||
#include "libcli/libcli.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
|
||||
#define SMBTORTURE_DFS_SHARENAME "smbtorture_dfs_share"
|
||||
#define SMBTORTURE_DFS_DIRNAME "\\smbtorture_dfs_dir"
|
||||
@ -56,7 +56,7 @@ static bool test_NetShareAdd(struct torture_context *tctx,
|
||||
return false;
|
||||
}
|
||||
|
||||
libnetctx->cred = popt_get_cmdline_credentials();
|
||||
libnetctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
i.name = sharename;
|
||||
i.type = STYPE_DISKTREE;
|
||||
@ -95,7 +95,7 @@ static bool test_NetShareDel(struct torture_context *tctx,
|
||||
return false;
|
||||
}
|
||||
|
||||
libnetctx->cred = popt_get_cmdline_credentials();
|
||||
libnetctx->cred = samba_cmdline_get_creds();
|
||||
|
||||
r.in.share_name = sharename;
|
||||
r.in.server_name = host;
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "librpc/gen_ndr/ndr_drsuapi_c.h"
|
||||
#include "librpc/gen_ndr/ndr_drsblobs.h"
|
||||
#include "libcli/cldap/cldap.h"
|
||||
@ -135,7 +135,7 @@ static struct DsGetinfoTest *test_create_context(struct torture_context *tctx)
|
||||
}
|
||||
|
||||
/* ctx->admin ...*/
|
||||
ctx->admin.credentials = popt_get_cmdline_credentials();
|
||||
ctx->admin.credentials = samba_cmdline_get_creds();
|
||||
|
||||
our_bind_info28 = &ctx->admin.drsuapi.our_bind_info28;
|
||||
our_bind_info28->supported_extensions = 0xFFFFFFFF;
|
||||
|
@ -44,7 +44,7 @@
|
||||
#include "librpc/gen_ndr/ndr_security.h"
|
||||
#include "librpc/gen_ndr/ndr_srvsvc_c.h"
|
||||
#include "librpc/gen_ndr/ndr_fsrvp_c.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
|
||||
#define FSHARE "fsrvp_share"
|
||||
#define FNAME "testfss.dat"
|
||||
@ -520,7 +520,7 @@ static bool test_fsrvp_sc_share_io(struct torture_context *tctx,
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
FSHARE,
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree_base,
|
||||
tctx->ev,
|
||||
&options,
|
||||
@ -551,7 +551,7 @@ static bool test_fsrvp_sc_share_io(struct torture_context *tctx,
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
sc_map->ShadowCopyShareName,
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree_snap,
|
||||
tctx->ev,
|
||||
&options,
|
||||
@ -644,7 +644,7 @@ static bool test_fsrvp_enum_created(struct torture_context *tctx,
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
FSHARE,
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree_base,
|
||||
tctx->ev,
|
||||
&options,
|
||||
@ -916,7 +916,7 @@ static bool fsrvp_rpc_setup(struct torture_context *tctx, void **data)
|
||||
struct torture_rpc_tcase_data *tcase_data;
|
||||
|
||||
*data = tcase_data = talloc_zero(tctx, struct torture_rpc_tcase_data);
|
||||
tcase_data->credentials = popt_get_cmdline_credentials();
|
||||
tcase_data->credentials = samba_cmdline_get_creds();
|
||||
|
||||
status = torture_rpc_connection(tctx,
|
||||
&(tcase_data->pipe),
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "libcli/resolve/resolve.h"
|
||||
#include "libcli/smb2/smb2.h"
|
||||
#include "libcli/smb2/smb2_calls.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "system/filesys.h"
|
||||
#include "lib/util/tftw.h"
|
||||
|
||||
@ -65,7 +65,7 @@ static bool smb_connect_print_share(struct torture_context *tctx,
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
share_name, NULL,
|
||||
lpcfg_socket_options(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
tctx->ev,
|
||||
&smb_options,
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
#include "librpc/gen_ndr/ndr_mdssvc_c.h"
|
||||
#include "param/param.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "rpc_server/mdssvc/dalloc.h"
|
||||
#include "rpc_server/mdssvc/marshalling.h"
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/events/events.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
#include "../lib/crypto/crypto.h"
|
||||
#include "libcli/auth/libcli_auth.h"
|
||||
@ -110,7 +110,7 @@ static bool test_LogonUasLogon(struct torture_context *tctx,
|
||||
|
||||
r.in.server_name = NULL;
|
||||
r.in.account_name = cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
r.in.workstation = TEST_MACHINE_NAME;
|
||||
r.out.info = &info;
|
||||
|
||||
@ -130,7 +130,7 @@ static bool test_LogonUasLogoff(struct torture_context *tctx,
|
||||
|
||||
r.in.server_name = NULL;
|
||||
r.in.account_name = cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
r.in.workstation = TEST_MACHINE_NAME;
|
||||
r.out.info = &info;
|
||||
|
||||
@ -1855,7 +1855,7 @@ static bool test_netlogon_ops_args(struct dcerpc_pipe *p, struct torture_context
|
||||
flags |= CLI_CRED_NTLMv2_AUTH;
|
||||
}
|
||||
|
||||
cli_credentials_get_ntlm_username_domain(popt_get_cmdline_credentials(),
|
||||
cli_credentials_get_ntlm_username_domain(samba_cmdline_get_creds(),
|
||||
tctx,
|
||||
&ninfo.identity_info.account_name.string,
|
||||
&ninfo.identity_info.domain_name.string);
|
||||
@ -1873,7 +1873,7 @@ static bool test_netlogon_ops_args(struct dcerpc_pipe *p, struct torture_context
|
||||
cli_credentials_get_domain(credentials));
|
||||
|
||||
status = cli_credentials_get_ntlm_response(
|
||||
popt_get_cmdline_credentials(), tctx,
|
||||
samba_cmdline_get_creds(), tctx,
|
||||
&flags,
|
||||
chal,
|
||||
NULL, /* server_timestamp */
|
||||
@ -4492,7 +4492,7 @@ static bool test_netr_DsrGetDcSiteCoverageW(struct torture_context *tctx,
|
||||
url = talloc_asprintf(tctx, "ldap://%s", dcerpc_server_name(p));
|
||||
sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url,
|
||||
NULL,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0);
|
||||
|
||||
torture_assert(tctx, sam_ctx, "Connection to the SAMDB on DC failed!");
|
||||
@ -4541,7 +4541,7 @@ static bool test_netr_DsRAddressToSitenamesW(struct torture_context *tctx,
|
||||
url = talloc_asprintf(tctx, "ldap://%s", dcerpc_server_name(p));
|
||||
sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url,
|
||||
NULL,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0);
|
||||
|
||||
torture_assert(tctx, sam_ctx, "Connection to the SAMDB on DC failed!");
|
||||
@ -4718,7 +4718,7 @@ static bool test_netr_DsRAddressToSitenamesExW(struct torture_context *tctx,
|
||||
url = talloc_asprintf(tctx, "ldap://%s", dcerpc_server_name(p));
|
||||
sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url,
|
||||
NULL,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0);
|
||||
|
||||
torture_assert(tctx, sam_ctx, "Connection to the SAMDB on DC failed!");
|
||||
@ -5001,7 +5001,7 @@ static bool test_GetDomainInfo(struct torture_context *tctx,
|
||||
url = talloc_asprintf(tctx, "ldap://%s", dcerpc_server_name(p));
|
||||
sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url,
|
||||
NULL,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0);
|
||||
|
||||
torture_assert(tctx, sam_ctx, "Connection to the SAMDB on DC failed!");
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "auth/kerberos/kerberos.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "auth/credentials/credentials_krb5.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
#include "libcli/auth/libcli_auth.h"
|
||||
#include "libcli/security/security.h"
|
||||
@ -234,7 +234,7 @@ static bool test_PACVerify(struct torture_context *tctx,
|
||||
*/
|
||||
client_creds =
|
||||
cli_credentials_shallow_copy(tmp_ctx,
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
torture_assert(tctx,
|
||||
client_creds,
|
||||
"Failed to copy of credentials");
|
||||
@ -743,7 +743,7 @@ static bool test_S4U2Self(struct torture_context *tctx,
|
||||
* we will get a new clean memory cache.
|
||||
*/
|
||||
client_creds = cli_credentials_shallow_copy(tmp_ctx,
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
torture_assert(tctx, client_creds, "Failed to copy of credentials");
|
||||
/* We use cli_credentials_get_ntlm_response(), so relax krb5 requirements. */
|
||||
cli_credentials_set_kerberos_state(client_creds,
|
||||
@ -1049,7 +1049,7 @@ static bool test_S4U2Proxy(struct torture_context *tctx,
|
||||
"Testing S4U2Proxy (secure_channel_type: %d, machine: %s, negotiate_flags: 0x%08x\n",
|
||||
secure_channel_type, test_machine_name, negotiate_flags);
|
||||
|
||||
impersonate_princ = cli_credentials_get_principal(popt_get_cmdline_credentials(), tctx);
|
||||
impersonate_princ = cli_credentials_get_principal(samba_cmdline_get_creds(), tctx);
|
||||
torture_assert_not_null(tctx, impersonate_princ, "Failed to get impersonate client name");
|
||||
|
||||
server_creds = cli_credentials_shallow_copy(tctx, credentials);
|
||||
@ -1178,7 +1178,7 @@ static bool setup_constrained_delegation(struct torture_context *tctx,
|
||||
int ret;
|
||||
|
||||
url = talloc_asprintf(tctx, "ldap://%s", dcerpc_server_name(p));
|
||||
sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url, NULL, popt_get_cmdline_credentials(), 0);
|
||||
sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url, NULL, samba_cmdline_get_creds(), 0);
|
||||
torture_assert_not_null(tctx, sam_ctx, "Connection to the SAMDB on DC failed!");
|
||||
|
||||
server_dn_str = samdb_search_string(sam_ctx, tctx, ldb_get_default_basedn(sam_ctx), "distinguishedName",
|
||||
|
@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
#include "torture/smbtorture.h"
|
||||
#include "librpc/ndr/ndr_table.h"
|
||||
@ -98,7 +98,7 @@ _PUBLIC_ NTSTATUS torture_rpc_connection_with_binding(struct torture_context *tc
|
||||
|
||||
status = dcerpc_pipe_connect_b(tctx,
|
||||
p, binding, table,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
tctx->ev, tctx->lp_ctx);
|
||||
|
||||
if (NT_STATUS_IS_ERR(status)) {
|
||||
@ -145,7 +145,7 @@ NTSTATUS torture_rpc_connection_transport(struct torture_context *tctx,
|
||||
}
|
||||
|
||||
status = dcerpc_pipe_connect_b(tctx, p, binding, table,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
tctx->ev, tctx->lp_ctx);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
*p = NULL;
|
||||
@ -169,7 +169,7 @@ static bool torture_rpc_setup_machine_workstation(struct torture_context *tctx,
|
||||
return false;
|
||||
|
||||
*data = tcase_data = talloc_zero(tctx, struct torture_rpc_tcase_data);
|
||||
tcase_data->credentials = popt_get_cmdline_credentials();
|
||||
tcase_data->credentials = samba_cmdline_get_creds();
|
||||
tcase_data->join_ctx = torture_join_domain(tctx, tcase->machine_name,
|
||||
ACB_WSTRUST,
|
||||
&tcase_data->credentials);
|
||||
@ -201,7 +201,7 @@ static bool torture_rpc_setup_machine_bdc(struct torture_context *tctx,
|
||||
return false;
|
||||
|
||||
*data = tcase_data = talloc_zero(tctx, struct torture_rpc_tcase_data);
|
||||
tcase_data->credentials = popt_get_cmdline_credentials();
|
||||
tcase_data->credentials = samba_cmdline_get_creds();
|
||||
tcase_data->join_ctx = torture_join_domain(tctx, tcase->machine_name,
|
||||
ACB_SVRTRUST,
|
||||
&tcase_data->credentials);
|
||||
@ -303,7 +303,7 @@ static bool torture_rpc_setup (struct torture_context *tctx, void **data)
|
||||
struct torture_rpc_tcase_data *tcase_data;
|
||||
|
||||
*data = tcase_data = talloc_zero(tctx, struct torture_rpc_tcase_data);
|
||||
tcase_data->credentials = popt_get_cmdline_credentials();
|
||||
tcase_data->credentials = samba_cmdline_get_creds();
|
||||
|
||||
status = torture_rpc_connection(tctx,
|
||||
&(tcase_data->pipe),
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "librpc/gen_ndr/ndr_winreg_c.h"
|
||||
#include "librpc/gen_ndr/ndr_wkssvc_c.h"
|
||||
#include "librpc/gen_ndr/ndr_svcctl_c.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
#include "libcli/libcli.h"
|
||||
#include "libcli/smb_composite/smb_composite.h"
|
||||
@ -196,7 +196,7 @@ bool torture_bind_authcontext(struct torture_context *torture)
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$", NULL,
|
||||
lpcfg_socket_options(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
lpcfg_resolve_context(torture->lp_ctx),
|
||||
torture->ev, &options, &session_options,
|
||||
lpcfg_gensec_settings(torture, torture->lp_ctx));
|
||||
@ -431,7 +431,7 @@ static bool torture_bind_samba3(struct torture_context *torture)
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$", NULL,
|
||||
lpcfg_socket_options(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
lpcfg_resolve_context(torture->lp_ctx),
|
||||
torture->ev, &options, &session_options,
|
||||
lpcfg_gensec_settings(torture, torture->lp_ctx));
|
||||
@ -443,16 +443,16 @@ static bool torture_bind_samba3(struct torture_context *torture)
|
||||
|
||||
ret = true;
|
||||
|
||||
ret &= bindtest(torture, cli, popt_get_cmdline_credentials(),
|
||||
ret &= bindtest(torture, cli, samba_cmdline_get_creds(),
|
||||
DCERPC_AUTH_TYPE_NTLMSSP,
|
||||
DCERPC_AUTH_LEVEL_INTEGRITY);
|
||||
ret &= bindtest(torture, cli, popt_get_cmdline_credentials(),
|
||||
ret &= bindtest(torture, cli, samba_cmdline_get_creds(),
|
||||
DCERPC_AUTH_TYPE_NTLMSSP,
|
||||
DCERPC_AUTH_LEVEL_PRIVACY);
|
||||
ret &= bindtest(torture, cli, popt_get_cmdline_credentials(),
|
||||
ret &= bindtest(torture, cli, samba_cmdline_get_creds(),
|
||||
DCERPC_AUTH_TYPE_SPNEGO,
|
||||
DCERPC_AUTH_LEVEL_INTEGRITY);
|
||||
ret &= bindtest(torture, cli, popt_get_cmdline_credentials(),
|
||||
ret &= bindtest(torture, cli, samba_cmdline_get_creds(),
|
||||
DCERPC_AUTH_TYPE_SPNEGO,
|
||||
DCERPC_AUTH_LEVEL_PRIVACY);
|
||||
|
||||
@ -1379,7 +1379,7 @@ static bool torture_netlogon_samba3(struct torture_context *torture)
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$", NULL,
|
||||
lpcfg_socket_options(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
lpcfg_resolve_context(torture->lp_ctx),
|
||||
torture->ev, &options, &session_options,
|
||||
lpcfg_gensec_settings(torture, torture->lp_ctx));
|
||||
@ -1403,7 +1403,7 @@ static bool torture_netlogon_samba3(struct torture_context *torture)
|
||||
"join failed");
|
||||
|
||||
cli_credentials_set_domain(
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
cli_credentials_get_domain(wks_creds),
|
||||
CRED_SPECIFIED);
|
||||
|
||||
@ -1422,7 +1422,7 @@ static bool torture_netlogon_samba3(struct torture_context *torture)
|
||||
for (j=0; j<2; j++) {
|
||||
torture_assert(torture,
|
||||
schan(torture, cli, wks_creds,
|
||||
popt_get_cmdline_credentials()),
|
||||
samba_cmdline_get_creds()),
|
||||
"schan failed");
|
||||
}
|
||||
}
|
||||
@ -1480,7 +1480,7 @@ static bool test_join3(struct torture_context *tctx,
|
||||
"join failed");
|
||||
|
||||
cli_credentials_set_domain(
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
cli_credentials_get_domain(wks_creds),
|
||||
CRED_SPECIFIED);
|
||||
|
||||
@ -1530,7 +1530,7 @@ static bool torture_samba3_sessionkey(struct torture_context *torture)
|
||||
}
|
||||
|
||||
torture_assert(torture,
|
||||
test_join3(torture, false, popt_get_cmdline_credentials(),
|
||||
test_join3(torture, false, samba_cmdline_get_creds(),
|
||||
NULL, wks_name),
|
||||
"join using anonymous bind on an authenticated smb connection failed");
|
||||
|
||||
@ -1539,7 +1539,7 @@ static bool torture_samba3_sessionkey(struct torture_context *torture)
|
||||
*/
|
||||
|
||||
torture_assert(torture,
|
||||
test_join3(torture, true, popt_get_cmdline_credentials(),
|
||||
test_join3(torture, true, samba_cmdline_get_creds(),
|
||||
NULL, wks_name),
|
||||
"join using anonymous bind on an authenticated smb connection failed");
|
||||
|
||||
@ -1813,7 +1813,7 @@ static bool torture_samba3_rpc_getusername(struct torture_context *torture)
|
||||
torture, &cli, torture_setting_string(torture, "host", NULL),
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$", NULL, lpcfg_socket_options(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
lpcfg_resolve_context(torture->lp_ctx), torture->ev, &options,
|
||||
&session_options, lpcfg_gensec_settings(torture, torture->lp_ctx));
|
||||
torture_assert_ntstatus_ok(torture, status, "smbcli_full_connection failed\n");
|
||||
@ -2792,7 +2792,7 @@ static bool torture_samba3_rpc_spoolss(struct torture_context *torture)
|
||||
userlevel1.client = talloc_asprintf(
|
||||
torture, "\\\\%s", lpcfg_netbios_name(torture->lp_ctx));
|
||||
userlevel1.user = cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
userlevel1.build = 2600;
|
||||
userlevel1.major = 3;
|
||||
userlevel1.minor = 0;
|
||||
@ -3418,7 +3418,7 @@ static bool torture_rpc_smb_reauth1(struct torture_context *torture)
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$", NULL,
|
||||
lpcfg_socket_options(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
lpcfg_resolve_context(torture->lp_ctx),
|
||||
torture->ev, &options, &session_options,
|
||||
lpcfg_gensec_settings(torture, torture->lp_ctx));
|
||||
@ -3503,7 +3503,7 @@ static bool torture_rpc_smb_reauth1(struct torture_context *torture)
|
||||
ZERO_STRUCT(io);
|
||||
io.in.sesskey = cli->transport->negotiate.sesskey;
|
||||
io.in.capabilities = cli->transport->negotiate.capabilities;
|
||||
io.in.credentials = popt_get_cmdline_credentials();
|
||||
io.in.credentials = samba_cmdline_get_creds();
|
||||
io.in.workgroup = lpcfg_workgroup(torture->lp_ctx);
|
||||
io.in.gensec_settings = lpcfg_gensec_settings(torture, torture->lp_ctx);
|
||||
|
||||
@ -3577,7 +3577,7 @@ static bool torture_rpc_smb_reauth2(struct torture_context *torture)
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$", NULL,
|
||||
lpcfg_socket_options(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
lpcfg_resolve_context(torture->lp_ctx),
|
||||
torture->ev, &options, &session_options,
|
||||
lpcfg_gensec_settings(torture, torture->lp_ctx));
|
||||
@ -3640,7 +3640,7 @@ static bool torture_rpc_smb_reauth2(struct torture_context *torture)
|
||||
ZERO_STRUCT(io);
|
||||
io.in.sesskey = cli->transport->negotiate.sesskey;
|
||||
io.in.capabilities = cli->transport->negotiate.capabilities;
|
||||
io.in.credentials = popt_get_cmdline_credentials();
|
||||
io.in.credentials = samba_cmdline_get_creds();
|
||||
io.in.workgroup = lpcfg_workgroup(torture->lp_ctx);
|
||||
io.in.gensec_settings = lpcfg_gensec_settings(torture, torture->lp_ctx);
|
||||
|
||||
@ -3710,7 +3710,7 @@ static bool torture_rpc_smb2_reauth1(struct torture_context *torture)
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$",
|
||||
lpcfg_resolve_context(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree,
|
||||
torture->ev,
|
||||
&options,
|
||||
@ -3791,7 +3791,7 @@ static bool torture_rpc_smb2_reauth1(struct torture_context *torture)
|
||||
/* smb re-auth again to the original user */
|
||||
|
||||
status = smb2_session_setup_spnego(tree->session,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0 /* previous_session_id */);
|
||||
torture_assert_ntstatus_ok_goto(torture, status, ret, done,
|
||||
"session reauth to anon failed");
|
||||
@ -3860,7 +3860,7 @@ static bool torture_rpc_smb2_reauth2(struct torture_context *torture)
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$",
|
||||
lpcfg_resolve_context(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree,
|
||||
torture->ev,
|
||||
&options,
|
||||
@ -3919,7 +3919,7 @@ static bool torture_rpc_smb2_reauth2(struct torture_context *torture)
|
||||
/* smb re-auth again to the original user */
|
||||
|
||||
status = smb2_session_setup_spnego(tree->session,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0 /* previous_session_id */);
|
||||
torture_assert_ntstatus_ok_goto(torture, status, ret, done,
|
||||
"session reauth to anon failed");
|
||||
@ -3978,7 +3978,7 @@ static bool torture_rpc_smb1_pipe_name(struct torture_context *torture)
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$", NULL,
|
||||
lpcfg_socket_options(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
lpcfg_resolve_context(torture->lp_ctx),
|
||||
torture->ev, &options, &session_options,
|
||||
lpcfg_gensec_settings(torture, torture->lp_ctx));
|
||||
@ -4227,7 +4227,7 @@ static bool torture_rpc_smb2_pipe_name(struct torture_context *torture)
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$",
|
||||
lpcfg_resolve_context(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree,
|
||||
torture->ev,
|
||||
&options,
|
||||
@ -4321,7 +4321,7 @@ static bool torture_rpc_smb2_pipe_read_close(struct torture_context *torture)
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$",
|
||||
lpcfg_resolve_context(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree,
|
||||
torture->ev,
|
||||
&options,
|
||||
@ -4405,7 +4405,7 @@ static bool torture_rpc_smb2_pipe_read_tdis(struct torture_context *torture)
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$",
|
||||
lpcfg_resolve_context(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree,
|
||||
torture->ev,
|
||||
&options,
|
||||
@ -4489,7 +4489,7 @@ static bool torture_rpc_smb2_pipe_read_logoff(struct torture_context *torture)
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$",
|
||||
lpcfg_resolve_context(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree,
|
||||
torture->ev,
|
||||
&options,
|
||||
@ -4568,7 +4568,7 @@ static bool torture_rpc_lsa_over_netlogon(struct torture_context *torture)
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$",
|
||||
lpcfg_resolve_context(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree,
|
||||
torture->ev,
|
||||
&options,
|
||||
@ -4639,7 +4639,7 @@ static bool torture_rpc_pipes_supported_interfaces(
|
||||
lpcfg_smb_ports(torture->lp_ctx),
|
||||
"IPC$",
|
||||
lpcfg_resolve_context(torture->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree,
|
||||
torture->ev,
|
||||
&options,
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "librpc/gen_ndr/ndr_netlogon.h"
|
||||
#include "librpc/gen_ndr/ndr_netlogon_c.h"
|
||||
#include "librpc/gen_ndr/ndr_samr_c.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
#include "auth/gensec/gensec.h"
|
||||
#include "libcli/auth/libcli_auth.h"
|
||||
@ -1838,11 +1838,11 @@ bool torture_rpc_samlogon(struct torture_context *torture)
|
||||
{
|
||||
.comment = "domain\\user",
|
||||
.domain = cli_credentials_get_domain(
|
||||
popt_get_cmdline_credentials()),
|
||||
samba_cmdline_get_creds()),
|
||||
.username = cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials()),
|
||||
samba_cmdline_get_creds()),
|
||||
.password = cli_credentials_get_password(
|
||||
popt_get_cmdline_credentials()),
|
||||
samba_cmdline_get_creds()),
|
||||
.network_login = true,
|
||||
.expected_interactive_error = NT_STATUS_OK,
|
||||
.expected_network_error = NT_STATUS_OK,
|
||||
@ -1851,11 +1851,11 @@ bool torture_rpc_samlogon(struct torture_context *torture)
|
||||
{
|
||||
.comment = "realm\\user",
|
||||
.domain = cli_credentials_get_realm(
|
||||
popt_get_cmdline_credentials()),
|
||||
samba_cmdline_get_creds()),
|
||||
.username = cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials()),
|
||||
samba_cmdline_get_creds()),
|
||||
.password = cli_credentials_get_password(
|
||||
popt_get_cmdline_credentials()),
|
||||
samba_cmdline_get_creds()),
|
||||
.network_login = true,
|
||||
.expected_interactive_error = NT_STATUS_OK,
|
||||
.expected_network_error = NT_STATUS_OK,
|
||||
@ -1867,12 +1867,12 @@ bool torture_rpc_samlogon(struct torture_context *torture)
|
||||
.username = talloc_asprintf(mem_ctx,
|
||||
"%s@%s",
|
||||
cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials()),
|
||||
samba_cmdline_get_creds()),
|
||||
cli_credentials_get_domain(
|
||||
popt_get_cmdline_credentials())
|
||||
samba_cmdline_get_creds())
|
||||
),
|
||||
.password = cli_credentials_get_password(
|
||||
popt_get_cmdline_credentials()),
|
||||
samba_cmdline_get_creds()),
|
||||
.network_login = false, /* works for some things, but not NTLMv2. Odd */
|
||||
.expected_interactive_error = NT_STATUS_OK,
|
||||
.expected_network_error = NT_STATUS_OK,
|
||||
@ -1884,12 +1884,12 @@ bool torture_rpc_samlogon(struct torture_context *torture)
|
||||
.username = talloc_asprintf(mem_ctx,
|
||||
"%s@%s",
|
||||
cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials()),
|
||||
samba_cmdline_get_creds()),
|
||||
cli_credentials_get_realm(
|
||||
popt_get_cmdline_credentials())
|
||||
samba_cmdline_get_creds())
|
||||
),
|
||||
.password = cli_credentials_get_password(
|
||||
popt_get_cmdline_credentials()),
|
||||
samba_cmdline_get_creds()),
|
||||
.network_login = true,
|
||||
.expected_interactive_error = NT_STATUS_OK,
|
||||
.expected_network_error = NT_STATUS_OK,
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "auth/credentials/credentials_krb5.h"
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "../libcli/auth/schannel.h"
|
||||
#include "libcli/auth/libcli_auth.h"
|
||||
#include "libcli/security/security.h"
|
||||
@ -73,7 +73,7 @@ bool test_netlogon_ex_ops(struct dcerpc_pipe *p, struct torture_context *tctx,
|
||||
flags |= CLI_CRED_NTLMv2_AUTH;
|
||||
}
|
||||
|
||||
cli_credentials_get_ntlm_username_domain(popt_get_cmdline_credentials(),
|
||||
cli_credentials_get_ntlm_username_domain(samba_cmdline_get_creds(),
|
||||
tctx,
|
||||
&ninfo.identity_info.account_name.string,
|
||||
&ninfo.identity_info.domain_name.string);
|
||||
@ -87,7 +87,7 @@ bool test_netlogon_ex_ops(struct dcerpc_pipe *p, struct torture_context *tctx,
|
||||
cli_credentials_get_domain(credentials));
|
||||
|
||||
status = cli_credentials_get_ntlm_response(
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
tctx,
|
||||
&flags,
|
||||
chal,
|
||||
@ -944,13 +944,13 @@ bool torture_rpc_schannel_bench1(struct torture_context *torture)
|
||||
s->conns = talloc_zero_array(s, struct torture_schannel_bench_conn, s->nprocs);
|
||||
|
||||
s->user1_creds = cli_credentials_shallow_copy(s,
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
tmp = torture_setting_string(s->tctx, "extra_user1", NULL);
|
||||
if (tmp) {
|
||||
cli_credentials_parse_string(s->user1_creds, tmp, CRED_SPECIFIED);
|
||||
}
|
||||
s->user2_creds = cli_credentials_shallow_copy(s,
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
tmp = torture_setting_string(s->tctx, "extra_user2", NULL);
|
||||
if (tmp) {
|
||||
cli_credentials_parse_string(s->user1_creds, tmp, CRED_SPECIFIED);
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include "libcli/auth/libcli_auth.h"
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "param/param.h"
|
||||
|
||||
static void init_lsa_String(struct lsa_String *name, const char *s)
|
||||
@ -162,7 +162,7 @@ static bool test_secrets(struct torture_context *torture, const void *_data)
|
||||
|
||||
status = dcerpc_pipe_connect_b(torture, &p, binding,
|
||||
&ndr_table_lsarpc,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
torture->ev,
|
||||
torture->lp_ctx);
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
#include "libcli/resolve/resolve.h"
|
||||
#include "libcli/smb2/smb2.h"
|
||||
#include "libcli/smb2/smb2_calls.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "system/filesys.h"
|
||||
#include "torture/ndr/ndr.h"
|
||||
#include "torture/smb2/proto.h"
|
||||
@ -8963,7 +8963,7 @@ static bool test_print_test_smbd(struct torture_context *tctx,
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
share,
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree,
|
||||
tctx->ev,
|
||||
&options,
|
||||
@ -10785,7 +10785,7 @@ static bool connect_printer_driver_share(struct torture_context *tctx,
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
share_name, NULL,
|
||||
lpcfg_socket_options(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
tctx->ev,
|
||||
&smb_options,
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "libcli/security/security.h"
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
#include "param/param.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
|
||||
#define TORTURE_USER "torture_user"
|
||||
#define TORTURE_USER_ADMINGROUP "torture_user_544"
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "includes.h"
|
||||
#include "system/time.h"
|
||||
#include "libnet/libnet.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "librpc/gen_ndr/ndr_lsa_c.h"
|
||||
#include "librpc/gen_ndr/ndr_samr_c.h"
|
||||
|
||||
@ -159,7 +159,7 @@ struct test_join *torture_create_testuser_max_pwlen(struct torture_context *tctx
|
||||
&join->p,
|
||||
dc_binding,
|
||||
&ndr_table_samr,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
NULL, tctx->lp_ctx);
|
||||
|
||||
} else {
|
||||
@ -553,7 +553,7 @@ _PUBLIC_ struct test_join *torture_join_domain(struct torture_context *tctx,
|
||||
|
||||
tj->libnet_r = libnet_r;
|
||||
|
||||
libnet_ctx->cred = popt_get_cmdline_credentials();
|
||||
libnet_ctx->cred = samba_cmdline_get_creds();
|
||||
libnet_r->in.binding = dcerpc_binding_string(libnet_r, binding);
|
||||
if (libnet_r->in.binding == NULL) {
|
||||
talloc_free(tj);
|
||||
@ -701,8 +701,8 @@ static NTSTATUS torture_leave_ads_domain(struct torture_context *torture,
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
ldb_set_opaque(ldb_ctx, "credentials", popt_get_cmdline_credentials());
|
||||
ldb_set_opaque(ldb_ctx, "loadparm", cmdline_lp_ctx);
|
||||
ldb_set_opaque(ldb_ctx, "credentials", samba_cmdline_get_creds());
|
||||
ldb_set_opaque(ldb_ctx, "loadparm", samba_cmdline_get_lp_ctx());
|
||||
|
||||
rtn = ldb_connect(ldb_ctx, remote_ldb_url, 0, NULL);
|
||||
if (rtn != LDB_SUCCESS) {
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "librpc/gen_ndr/ndr_clusapi_c.h"
|
||||
#include "param/param.h"
|
||||
#include <tevent.h>
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
|
||||
struct torture_test_clusapi_state {
|
||||
struct dcerpc_pipe *p;
|
||||
@ -538,7 +538,7 @@ static bool setup_clusapi_connection(struct torture_context *tctx,
|
||||
torture_assert_ntstatus_ok(tctx,
|
||||
dcerpc_pipe_connect_b(tctx, &s->clusapi.p, binding,
|
||||
&ndr_table_clusapi,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
tctx->ev, tctx->lp_ctx),
|
||||
"failed to connect dcerpc pipe");
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "torture/torture.h"
|
||||
#include "librpc/gen_ndr/ndr_wkssvc_c.h"
|
||||
#include "torture/rpc/torture_rpc.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "param/param.h"
|
||||
#include "libcli/auth/libcli_auth.h"
|
||||
|
||||
@ -217,7 +217,7 @@ static bool test_NetrWkstaUserGetInfo(struct torture_context *tctx,
|
||||
struct wkssvc_NetrWkstaUserGetInfo r;
|
||||
union wkssvc_NetrWkstaUserInfo info;
|
||||
const char *dom = lpcfg_workgroup(tctx->lp_ctx);
|
||||
struct cli_credentials *creds = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *creds = samba_cmdline_get_creds();
|
||||
const char *user = cli_credentials_get_username(creds);
|
||||
int i;
|
||||
struct dcerpc_binding_handle *b = p->binding_handle;
|
||||
@ -1123,7 +1123,7 @@ static bool test_NetrUnjoinDomain(struct torture_context *tctx,
|
||||
{
|
||||
NTSTATUS status;
|
||||
struct wkssvc_NetrUnjoinDomain r;
|
||||
struct cli_credentials *creds = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *creds = samba_cmdline_get_creds();
|
||||
const char *user = cli_credentials_get_username(creds);
|
||||
const char *admin_account = NULL;
|
||||
struct dcerpc_binding_handle *b = p->binding_handle;
|
||||
@ -1152,7 +1152,7 @@ static bool test_NetrJoinDomain(struct torture_context *tctx,
|
||||
{
|
||||
NTSTATUS status;
|
||||
struct wkssvc_NetrJoinDomain r;
|
||||
struct cli_credentials *creds = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *creds = samba_cmdline_get_creds();
|
||||
const char *user = cli_credentials_get_username(creds);
|
||||
const char *admin_account = NULL;
|
||||
struct dcerpc_binding_handle *b = p->binding_handle;
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "includes.h"
|
||||
#include "system/readline.h"
|
||||
#include "../libcli/smbreadline/smbreadline.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "torture/smbtorture.h"
|
||||
#include "param/param.h"
|
||||
@ -110,7 +110,7 @@ void torture_shell(struct torture_context *tctx)
|
||||
* stops the credentials system prompting when we use the "auth"
|
||||
* command to display the current auth parameters.
|
||||
*/
|
||||
cli_credentials_set_password(popt_get_cmdline_credentials(),
|
||||
cli_credentials_set_password(samba_cmdline_get_creds(),
|
||||
"", CRED_GUESS_ENV);
|
||||
|
||||
while (1) {
|
||||
@ -228,13 +228,13 @@ static void shell_auth(const struct shell_command * command,
|
||||
const char * principal;
|
||||
|
||||
username = cli_credentials_get_username(
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
principal = cli_credentials_get_principal(
|
||||
popt_get_cmdline_credentials(), tctx);
|
||||
domain = cli_credentials_get_domain(popt_get_cmdline_credentials());
|
||||
realm = cli_credentials_get_realm(popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds(), tctx);
|
||||
domain = cli_credentials_get_domain(samba_cmdline_get_creds());
|
||||
realm = cli_credentials_get_realm(samba_cmdline_get_creds());
|
||||
password = cli_credentials_get_password(
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
|
||||
printf("Username: %s\n", username ? username : "");
|
||||
printf("User Principal: %s\n", principal ? principal : "");
|
||||
@ -246,23 +246,23 @@ static void shell_auth(const struct shell_command * command,
|
||||
|
||||
if (!strcmp(argv[0], "username")) {
|
||||
result = cli_credentials_set_username(
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
argv[1], CRED_SPECIFIED);
|
||||
} else if (!strcmp(argv[0], "principal")) {
|
||||
result = cli_credentials_set_principal(
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
argv[1], CRED_SPECIFIED);
|
||||
} else if (!strcmp(argv[0], "domain")) {
|
||||
result = cli_credentials_set_domain(
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
argv[1], CRED_SPECIFIED);
|
||||
} else if (!strcmp(argv[0], "realm")) {
|
||||
result = cli_credentials_set_realm(
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
argv[1], CRED_SPECIFIED);
|
||||
} else if (!strcmp(argv[0], "password")) {
|
||||
result = cli_credentials_set_password(
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
argv[1], CRED_SPECIFIED);
|
||||
} else {
|
||||
shell_usage(command);
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libcli/smb2/smb2.h"
|
||||
#include "libcli/smb2/smb2_calls.h"
|
||||
#include "libcli/smb/smbXcli_base.h"
|
||||
@ -2157,7 +2157,7 @@ static bool torture_smb2_con_share(struct torture_context *tctx,
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
share,
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0,
|
||||
tree,
|
||||
tctx->ev,
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#include "system/filesys.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "librpc/gen_ndr/security.h"
|
||||
#include "lib/events/events.h"
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "librpc/gen_ndr/ndr_security.h"
|
||||
#include "librpc/gen_ndr/ndr_ioctl.h"
|
||||
#include "../libcli/smb/smbXcli_base.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libcli/security/security.h"
|
||||
#include "libcli/resolve/resolve.h"
|
||||
#include "lib/param/param.h"
|
||||
@ -426,7 +426,7 @@ static bool test_multichannel_oplock_break_test1(struct torture_context *tctx,
|
||||
{
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
NTSTATUS status;
|
||||
TALLOC_CTX *mem_ctx = talloc_new(tctx);
|
||||
struct smb2_handle _h;
|
||||
@ -609,7 +609,7 @@ static bool test_multichannel_oplock_break_test2(struct torture_context *tctx,
|
||||
{
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
NTSTATUS status;
|
||||
TALLOC_CTX *mem_ctx = talloc_new(tctx);
|
||||
struct smb2_handle _h;
|
||||
@ -892,7 +892,7 @@ static bool test_multichannel_oplock_break_test3_windows(struct torture_context
|
||||
{
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
NTSTATUS status;
|
||||
TALLOC_CTX *mem_ctx = talloc_new(tctx);
|
||||
struct test_multichannel_oplock_break_state state = {
|
||||
@ -1090,7 +1090,7 @@ static bool test_multichannel_oplock_break_test3_specification(struct torture_co
|
||||
{
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
NTSTATUS status;
|
||||
TALLOC_CTX *mem_ctx = talloc_new(tctx);
|
||||
struct test_multichannel_oplock_break_state state = {
|
||||
@ -1317,7 +1317,7 @@ static bool test_multichannel_lease_break_test1(struct torture_context *tctx,
|
||||
{
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
NTSTATUS status;
|
||||
TALLOC_CTX *mem_ctx = talloc_new(tctx);
|
||||
struct smb2_handle _h;
|
||||
@ -1527,7 +1527,7 @@ static bool test_multichannel_lease_break_test2(struct torture_context *tctx,
|
||||
{
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
NTSTATUS status;
|
||||
TALLOC_CTX *mem_ctx = talloc_new(tctx);
|
||||
struct smb2_handle _h;
|
||||
@ -1842,7 +1842,7 @@ static bool test_multichannel_lease_break_test3(struct torture_context *tctx,
|
||||
{
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
NTSTATUS status;
|
||||
TALLOC_CTX *mem_ctx = talloc_new(tctx);
|
||||
struct smb2_handle _h;
|
||||
@ -1972,7 +1972,7 @@ static bool test_multichannel_num_channels(struct torture_context *tctx,
|
||||
{
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
TALLOC_CTX *mem_ctx = talloc_new(tctx);
|
||||
bool ret = true;
|
||||
struct smb2_tree **tree2 = NULL;
|
||||
@ -2066,7 +2066,7 @@ static bool test_multichannel_num_channels(struct torture_context *tctx,
|
||||
|
||||
torture_assert_ntstatus_equal_goto(tctx,
|
||||
smb2_session_setup_spnego(session2[i],
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0 /* previous_session_id */),
|
||||
expected_status,
|
||||
ret, done,
|
||||
@ -2137,7 +2137,7 @@ static bool test_multichannel_lease_break_test4(struct torture_context *tctx,
|
||||
{
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
NTSTATUS status;
|
||||
TALLOC_CTX *mem_ctx = talloc_new(tctx);
|
||||
struct test_multichannel_lease_break_state state = {
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "system/filesys.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "librpc/gen_ndr/security.h"
|
||||
|
||||
#include "lib/events/events.h"
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
#include "system/filesys.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "librpc/gen_ndr/security.h"
|
||||
|
||||
#include "lib/events/events.h"
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "libcli/resolve/resolve.h"
|
||||
#include "libcli/smb/smbXcli_base.h"
|
||||
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "lib/events/events.h"
|
||||
|
||||
#include "param/param.h"
|
||||
@ -294,7 +294,7 @@ static bool open_smb2_connection_no_level2_oplocks(struct torture_context *tctx,
|
||||
status = smb2_connect(tctx, host,
|
||||
lpcfg_smb_ports(tctx->lp_ctx), share,
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
tree, tctx->ev, &options,
|
||||
lpcfg_socket_options(tctx->lp_ctx),
|
||||
lpcfg_gensec_settings(tctx, tctx->lp_ctx));
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "torture/torture.h"
|
||||
#include "torture/smb2/proto.h"
|
||||
#include "../libcli/smb/smbXcli_base.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "libcli/security/security.h"
|
||||
#include "libcli/resolve/resolve.h"
|
||||
@ -2752,7 +2752,7 @@ static bool _test_dhv2_pending2_vs_hold(struct torture_context *tctx,
|
||||
{
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
NTSTATUS status;
|
||||
TALLOC_CTX *mem_ctx = talloc_new(tctx);
|
||||
struct smb2_handle _h1;
|
||||
@ -3582,7 +3582,7 @@ static bool _test_dhv2_pending3_vs_hold(struct torture_context *tctx,
|
||||
{
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
NTSTATUS status;
|
||||
TALLOC_CTX *mem_ctx = talloc_new(tctx);
|
||||
struct smb2_handle _h1;
|
||||
@ -4772,7 +4772,7 @@ static bool test_replay3(struct torture_context *tctx, struct smb2_tree *tree1)
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
share,
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree2,
|
||||
tctx->ev,
|
||||
&transport1->options,
|
||||
@ -4795,7 +4795,7 @@ static bool test_replay3(struct torture_context *tctx, struct smb2_tree *tree1)
|
||||
torture_assert(tctx, session1_2 != NULL, "smb2_session_channel failed");
|
||||
|
||||
status = smb2_session_setup_spnego(session1_2,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0 /* previous_session_id */);
|
||||
CHECK_STATUS(status, NT_STATUS_OK);
|
||||
|
||||
@ -4994,7 +4994,7 @@ static bool test_replay4(struct torture_context *tctx, struct smb2_tree *tree1)
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
share,
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree2,
|
||||
tctx->ev,
|
||||
&transport1->options,
|
||||
@ -5017,7 +5017,7 @@ static bool test_replay4(struct torture_context *tctx, struct smb2_tree *tree1)
|
||||
torture_assert(tctx, session1_2 != NULL, "smb2_session_channel failed");
|
||||
|
||||
status = smb2_session_setup_spnego(session1_2,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0 /* previous_session_id */);
|
||||
CHECK_STATUS(status, NT_STATUS_OK);
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "includes.h"
|
||||
#include "libcli/smb2/smb2.h"
|
||||
#include "libcli/smb2/smb2_calls.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "torture/torture.h"
|
||||
#include "param/param.h"
|
||||
#include "libcli/resolve/resolve.h"
|
||||
@ -215,7 +215,7 @@ static bool torture_smb2_scan(struct torture_context *tctx)
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
share,
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree, tctx->ev, &options,
|
||||
lpcfg_socket_options(tctx->lp_ctx),
|
||||
lpcfg_gensec_settings(tctx, tctx->lp_ctx));
|
||||
@ -233,7 +233,7 @@ static bool torture_smb2_scan(struct torture_context *tctx)
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
share,
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
&tree, tctx->ev, &options,
|
||||
lpcfg_socket_options(tctx->lp_ctx),
|
||||
lpcfg_gensec_settings(mem_ctx, tctx->lp_ctx));
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "torture/util.h"
|
||||
#include "torture/smb2/proto.h"
|
||||
#include "../libcli/smb/smbXcli_base.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "auth/credentials/credentials_krb5.h"
|
||||
#include "libcli/security/security.h"
|
||||
@ -243,7 +243,7 @@ bool test_session_reauth1(struct torture_context *tctx, struct smb2_tree *tree)
|
||||
"oplock_level incorrect");
|
||||
|
||||
status = smb2_session_setup_spnego(tree->session,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0 /* previous_session_id */);
|
||||
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
|
||||
"smb2_session_setup_spnego failed");
|
||||
@ -258,7 +258,7 @@ bool test_session_reauth1(struct torture_context *tctx, struct smb2_tree *tree)
|
||||
"smb2_getinfo_file failed");
|
||||
|
||||
status = smb2_session_setup_spnego(tree->session,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0 /* previous_session_id */);
|
||||
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
|
||||
"smb2_session_setup_spnego failed");
|
||||
@ -341,7 +341,7 @@ bool test_session_reauth2(struct torture_context *tctx, struct smb2_tree *tree)
|
||||
/* re-authenticate as original user again */
|
||||
|
||||
status = smb2_session_setup_spnego(tree->session,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0 /* previous_session_id */);
|
||||
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
|
||||
"smb2_session_setup_spnego failed");
|
||||
@ -447,7 +447,7 @@ bool test_session_reauth3(struct torture_context *tctx, struct smb2_tree *tree)
|
||||
/* re-authenticate as original user again */
|
||||
|
||||
status = smb2_session_setup_spnego(tree->session,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0 /* previous_session_id */);
|
||||
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
|
||||
"smb2_session_setup_spnego failed");
|
||||
@ -574,7 +574,7 @@ bool test_session_reauth4(struct torture_context *tctx, struct smb2_tree *tree)
|
||||
/* re-authenticate as original user again */
|
||||
|
||||
status = smb2_session_setup_spnego(tree->session,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0 /* previous_session_id */);
|
||||
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
|
||||
"smb2_session_setup_spnego failed");
|
||||
@ -714,7 +714,7 @@ bool test_session_reauth5(struct torture_context *tctx, struct smb2_tree *tree)
|
||||
/* re-authenticate as original user again */
|
||||
|
||||
status = smb2_session_setup_spnego(tree->session,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0 /* previous_session_id */);
|
||||
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
|
||||
"smb2_session_setup_spnego failed");
|
||||
@ -847,7 +847,7 @@ bool test_session_reauth5(struct torture_context *tctx, struct smb2_tree *tree)
|
||||
/* re-authenticate as original user - again */
|
||||
|
||||
status = smb2_session_setup_spnego(tree->session,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0 /* previous_session_id */);
|
||||
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
|
||||
"smb2_session_setup_spnego failed");
|
||||
@ -956,7 +956,7 @@ bool test_session_reauth6(struct torture_context *tctx, struct smb2_tree *tree)
|
||||
enum credentials_use_kerberos krb_state;
|
||||
|
||||
krb_state = cli_credentials_get_kerberos_state(
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
if (krb_state == CRED_USE_KERBEROS_REQUIRED) {
|
||||
torture_skip(tctx,
|
||||
"Can't test failing session setup with kerberos.");
|
||||
@ -990,7 +990,7 @@ bool test_session_reauth6(struct torture_context *tctx, struct smb2_tree *tree)
|
||||
*/
|
||||
|
||||
broken_creds = cli_credentials_shallow_copy(mem_ctx,
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
torture_assert(tctx, (broken_creds != NULL), "talloc error");
|
||||
|
||||
corrupted_password = talloc_asprintf(mem_ctx, "%s%s",
|
||||
@ -1054,7 +1054,7 @@ static bool test_session_expire1i(struct torture_context *tctx,
|
||||
struct smbcli_options options;
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
struct smb2_tree *tree = NULL;
|
||||
enum credentials_use_kerberos use_kerberos;
|
||||
char fname[256];
|
||||
@ -1219,7 +1219,7 @@ static bool test_session_expire2i(struct torture_context *tctx,
|
||||
struct smbcli_options options;
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
struct smb2_tree *tree = NULL;
|
||||
const char *unc = NULL;
|
||||
struct smb2_tree *tree2 = NULL;
|
||||
@ -1602,7 +1602,7 @@ static bool test_session_expire_disconnect(struct torture_context *tctx)
|
||||
struct smbcli_options options;
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
struct smb2_tree *tree = NULL;
|
||||
enum credentials_use_kerberos use_kerberos;
|
||||
char fname[256];
|
||||
@ -1707,7 +1707,7 @@ bool test_session_bind1(struct torture_context *tctx, struct smb2_tree *tree1)
|
||||
{
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
NTSTATUS status;
|
||||
TALLOC_CTX *mem_ctx = talloc_new(tctx);
|
||||
char fname[256];
|
||||
@ -1785,7 +1785,7 @@ bool test_session_bind1(struct torture_context *tctx, struct smb2_tree *tree1)
|
||||
torture_assert(tctx, session1_2 != NULL, "smb2_session_channel failed");
|
||||
|
||||
status = smb2_session_setup_spnego(session1_2,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0 /* previous_session_id */);
|
||||
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
|
||||
"smb2_session_setup_spnego failed");
|
||||
@ -1824,7 +1824,7 @@ bool test_session_bind1(struct torture_context *tctx, struct smb2_tree *tree1)
|
||||
torture_assert(tctx, session2_1 != NULL, "smb2_session_channel failed");
|
||||
|
||||
status = smb2_session_setup_spnego(session2_1,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0 /* previous_session_id */);
|
||||
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
|
||||
"smb2_session_setup_spnego failed");
|
||||
@ -1855,7 +1855,7 @@ static bool test_session_bind2(struct torture_context *tctx, struct smb2_tree *t
|
||||
{
|
||||
const char *host = torture_setting_string(tctx, "host", NULL);
|
||||
const char *share = torture_setting_string(tctx, "share", NULL);
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
NTSTATUS status;
|
||||
TALLOC_CTX *mem_ctx = talloc_new(tctx);
|
||||
char fname1[256];
|
||||
@ -2448,7 +2448,7 @@ done:
|
||||
|
||||
static bool test_session_bind_invalid_auth(struct torture_context *tctx, struct smb2_tree *tree1)
|
||||
{
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
struct cli_credentials *invalid_credentials = NULL;
|
||||
bool ret = false;
|
||||
|
||||
@ -2469,7 +2469,7 @@ static bool test_session_bind_invalid_auth(struct torture_context *tctx, struct
|
||||
|
||||
static bool test_session_bind_different_user(struct torture_context *tctx, struct smb2_tree *tree1)
|
||||
{
|
||||
struct cli_credentials *credentials1 = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials1 = samba_cmdline_get_creds();
|
||||
struct cli_credentials *credentials2 = torture_user2_credentials(tctx, tctx);
|
||||
char *u1 = cli_credentials_get_unparsed_name(credentials1, tctx);
|
||||
char *u2 = cli_credentials_get_unparsed_name(credentials2, tctx);
|
||||
@ -2668,7 +2668,7 @@ done:
|
||||
*/
|
||||
static bool test_session_bind_negative_smb202(struct torture_context *tctx, struct smb2_tree *tree0)
|
||||
{
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
bool ret = false;
|
||||
struct smb2_transport *transport0 = tree0->session->transport;
|
||||
struct smbcli_options options1;
|
||||
@ -2698,7 +2698,7 @@ static bool test_session_bind_negative_smb202(struct torture_context *tctx, stru
|
||||
|
||||
static bool test_session_bind_negative_smb210(struct torture_context *tctx, struct smb2_tree *tree0)
|
||||
{
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
bool ret = false;
|
||||
struct smb2_transport *transport0 = tree0->session->transport;
|
||||
struct smbcli_options options1;
|
||||
@ -2728,7 +2728,7 @@ static bool test_session_bind_negative_smb210(struct torture_context *tctx, stru
|
||||
|
||||
static bool test_session_bind_negative_smb2to3(struct torture_context *tctx, struct smb2_tree *tree0)
|
||||
{
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
bool ret = false;
|
||||
struct smb2_transport *transport0 = tree0->session->transport;
|
||||
struct smbcli_options options1;
|
||||
@ -2766,7 +2766,7 @@ static bool test_session_bind_negative_smb2to3(struct torture_context *tctx, str
|
||||
|
||||
static bool test_session_bind_negative_smb3to2(struct torture_context *tctx, struct smb2_tree *tree0)
|
||||
{
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
bool ret = false;
|
||||
struct smb2_transport *transport0 = tree0->session->transport;
|
||||
struct smbcli_options options1;
|
||||
@ -2804,7 +2804,7 @@ static bool test_session_bind_negative_smb3to2(struct torture_context *tctx, str
|
||||
|
||||
static bool test_session_bind_negative_smb3to3(struct torture_context *tctx, struct smb2_tree *tree0)
|
||||
{
|
||||
struct cli_credentials *credentials = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials = samba_cmdline_get_creds();
|
||||
bool ret = false;
|
||||
struct smb2_transport *transport0 = tree0->session->transport;
|
||||
struct smbcli_options options1;
|
||||
@ -2835,7 +2835,7 @@ static bool test_session_bind_negative_smb3to3(struct torture_context *tctx, str
|
||||
|
||||
static bool test_session_bind_negative_smb3encGtoC(struct torture_context *tctx, struct smb2_tree *tree0)
|
||||
{
|
||||
struct cli_credentials *credentials0 = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials0 = samba_cmdline_get_creds();
|
||||
struct cli_credentials *credentials = NULL;
|
||||
bool ret = false;
|
||||
struct smb2_transport *transport0 = tree0->session->transport;
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "libcli/smb2/smb2.h"
|
||||
#include "libcli/smb2/smb2_calls.h"
|
||||
#include "../libcli/smb/smbXcli_base.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "system/time.h"
|
||||
#include "librpc/gen_ndr/ndr_security.h"
|
||||
#include "param/param.h"
|
||||
@ -372,7 +372,7 @@ bool torture_smb2_session_setup(struct torture_context *tctx,
|
||||
}
|
||||
|
||||
status = smb2_session_setup_spnego(session,
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
previous_session_id);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
torture_comment(tctx, "session setup failed: %s\n", nt_errstr(status));
|
||||
@ -425,7 +425,7 @@ bool torture_smb2_connection_ext(struct torture_context *tctx,
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
share,
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
previous_session_id,
|
||||
tree,
|
||||
tctx->ev,
|
||||
@ -480,7 +480,7 @@ bool torture_smb2_con_sopt(struct torture_context *tctx,
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
share,
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0,
|
||||
tree,
|
||||
tctx->ev,
|
||||
|
@ -49,7 +49,7 @@ bld.SAMBA_MODULE('TORTURE_SMB2',
|
||||
util.c
|
||||
''',
|
||||
subsystem='smbtorture',
|
||||
deps='LIBCLI_SMB2 POPT_CREDENTIALS torture NDR_IOCTL',
|
||||
deps='LIBCLI_SMB2 torture NDR_IOCTL',
|
||||
internal_module=True,
|
||||
autoproto='proto.h',
|
||||
init_function='torture_smb2_init'
|
||||
|
@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "system/time.h"
|
||||
#include "system/wait.h"
|
||||
#include "system/filesys.h"
|
||||
@ -419,6 +419,8 @@ int main(int argc, const char *argv[])
|
||||
OPT_DANGEROUS,OPT_SMB_PORTS,OPT_ASYNC,OPT_NUMPROGS,
|
||||
OPT_EXTRA_USER,};
|
||||
TALLOC_CTX *mem_ctx = NULL;
|
||||
struct loadparm_context *lp_ctx = NULL;
|
||||
bool ok;
|
||||
|
||||
struct poptOption long_options[] = {
|
||||
POPT_AUTOHELP
|
||||
@ -457,7 +459,8 @@ int main(int argc, const char *argv[])
|
||||
POPT_COMMON_CONNECTION
|
||||
POPT_COMMON_CREDENTIALS
|
||||
POPT_COMMON_VERSION
|
||||
{0}
|
||||
POPT_LEGACY_S4
|
||||
POPT_TABLEEND
|
||||
};
|
||||
|
||||
setlinebuf(stdout);
|
||||
@ -473,36 +476,55 @@ int main(int argc, const char *argv[])
|
||||
/* we are never interested in SIGPIPE */
|
||||
BlockSignals(true, SIGPIPE);
|
||||
|
||||
pc = poptGetContext("smbtorture", argc, argv, long_options,
|
||||
POPT_CONTEXT_KEEP_FIRST);
|
||||
ok = samba_cmdline_init(mem_ctx,
|
||||
SAMBA_CMDLINE_CONFIG_CLIENT,
|
||||
false /* require_smbconf */);
|
||||
if (!ok) {
|
||||
DBG_ERR("Unable to init cmdline parser\n");
|
||||
TALLOC_FREE(mem_ctx);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
pc = samba_popt_get_context(getprogname(),
|
||||
argc,
|
||||
argv,
|
||||
long_options,
|
||||
POPT_CONTEXT_KEEP_FIRST);
|
||||
if (pc == NULL) {
|
||||
DBG_ERR("Failed cmdline parser\n");
|
||||
TALLOC_FREE(mem_ctx);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
poptSetOtherOptionHelp(pc, "<binding>|<unc> TEST1 TEST2 ...");
|
||||
|
||||
lp_ctx = samba_cmdline_get_lp_ctx();
|
||||
|
||||
while((opt = poptGetNextOpt(pc)) != -1) {
|
||||
switch (opt) {
|
||||
case OPT_LOADFILE:
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:loadfile", poptGetOptArg(pc));
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:loadfile", poptGetOptArg(pc));
|
||||
break;
|
||||
case OPT_UNCLIST:
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc));
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:unclist", poptGetOptArg(pc));
|
||||
break;
|
||||
case OPT_TIMELIMIT:
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:timelimit", poptGetOptArg(pc));
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:timelimit", poptGetOptArg(pc));
|
||||
break;
|
||||
case OPT_NUMPROGS:
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:nprocs", poptGetOptArg(pc));
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:nprocs", poptGetOptArg(pc));
|
||||
break;
|
||||
case OPT_DNS:
|
||||
parse_dns(cmdline_lp_ctx, poptGetOptArg(pc));
|
||||
parse_dns(lp_ctx, poptGetOptArg(pc));
|
||||
break;
|
||||
case OPT_DANGEROUS:
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:dangerous", "Yes");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:dangerous", "Yes");
|
||||
break;
|
||||
case OPT_ASYNC:
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:async", "Yes");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:async", "Yes");
|
||||
break;
|
||||
case OPT_SMB_PORTS:
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "smb ports", poptGetOptArg(pc));
|
||||
lpcfg_set_cmdline(lp_ctx, "smb ports", poptGetOptArg(pc));
|
||||
break;
|
||||
case OPT_EXTRA_USER:
|
||||
{
|
||||
@ -515,7 +537,7 @@ int main(int argc, const char *argv[])
|
||||
talloc_free(mem_ctx);
|
||||
exit(1);
|
||||
}
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, option, value);
|
||||
lpcfg_set_cmdline(lp_ctx, option, value);
|
||||
talloc_free(option);
|
||||
}
|
||||
break;
|
||||
@ -542,54 +564,54 @@ int main(int argc, const char *argv[])
|
||||
}
|
||||
|
||||
if (strcmp(target, "samba3") == 0) {
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:samba3", "true");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:samba3", "true");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:resume_key_support", "false");
|
||||
} else if (strcmp(target, "samba4") == 0) {
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:samba4", "true");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:samba4", "true");
|
||||
} else if (strcmp(target, "samba4-ntvfs") == 0) {
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:samba4", "true");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:samba4-ntvfs", "true");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:samba4", "true");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:samba4-ntvfs", "true");
|
||||
} else if (strcmp(target, "winxp") == 0) {
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:winxp", "true");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:winxp", "true");
|
||||
} else if (strcmp(target, "w2k3") == 0) {
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:w2k3", "true");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:w2k3", "true");
|
||||
} else if (strcmp(target, "w2k8") == 0) {
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:w2k8", "true");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx,
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:w2k8", "true");
|
||||
lpcfg_set_cmdline(lp_ctx,
|
||||
"torture:invalid_lock_range_support", "false");
|
||||
} else if (strcmp(target, "w2k12") == 0) {
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:w2k12", "true");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:w2k12", "true");
|
||||
} else if (strcmp(target, "win7") == 0) {
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:win7", "true");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:rewind_support", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:win7", "true");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:resume_key_support", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:rewind_support", "false");
|
||||
|
||||
/* RAW-SEARCH for fails for inexplicable reasons against win7 */
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:search_ea_support", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:search_ea_support", "false");
|
||||
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:hide_on_access_denied",
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:hide_on_access_denied",
|
||||
"true");
|
||||
} else if (strcmp(target, "onefs") == 0) {
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:onefs", "true");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:openx_deny_dos_support",
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:onefs", "true");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:openx_deny_dos_support",
|
||||
"false");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:range_not_locked_on_file_close", "false");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:sacl_support", "false");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:ea_support", "false");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:smbexit_pdu_support",
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:range_not_locked_on_file_close", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:sacl_support", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:ea_support", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:smbexit_pdu_support",
|
||||
"false");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:smblock_pdu_support",
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:smblock_pdu_support",
|
||||
"false");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:2_step_break_to_none",
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:2_step_break_to_none",
|
||||
"true");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:deny_dos_support", "false");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:deny_fcb_support", "false");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:read_support", "false");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:writeclose_support", "false");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:rewind_support", "false");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:raw_search_search", "false");
|
||||
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:search_ea_size", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:deny_dos_support", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:deny_fcb_support", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:read_support", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:writeclose_support", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:resume_key_support", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:rewind_support", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:raw_search_search", "false");
|
||||
lpcfg_set_cmdline(lp_ctx, "torture:search_ea_size", "false");
|
||||
}
|
||||
|
||||
if (max_runtime) {
|
||||
@ -622,7 +644,6 @@ int main(int argc, const char *argv[])
|
||||
print_testsuite_list();
|
||||
poptFreeContext(pc);
|
||||
talloc_free(mem_ctx);
|
||||
popt_free_cmdline_credentials();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -646,7 +667,6 @@ int main(int argc, const char *argv[])
|
||||
}
|
||||
poptFreeContext(pc);
|
||||
talloc_free(mem_ctx);
|
||||
popt_free_cmdline_credentials();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -702,7 +722,7 @@ int main(int argc, const char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
torture->lp_ctx = cmdline_lp_ctx;
|
||||
torture->lp_ctx = lp_ctx;
|
||||
|
||||
gensec_init();
|
||||
|
||||
@ -721,7 +741,7 @@ int main(int argc, const char *argv[])
|
||||
usage(pc);
|
||||
torture->results->returncode = 1;
|
||||
} else if (!torture_parse_target(torture,
|
||||
cmdline_lp_ctx, argv_new[1])) {
|
||||
lp_ctx, argv_new[1])) {
|
||||
/* Take the target name or binding. */
|
||||
usage(pc);
|
||||
torture->results->returncode = 1;
|
||||
@ -741,7 +761,6 @@ int main(int argc, const char *argv[])
|
||||
if (torture->results->returncode && correct) {
|
||||
poptFreeContext(pc);
|
||||
talloc_free(mem_ctx);
|
||||
popt_free_cmdline_credentials();
|
||||
return(0);
|
||||
} else {
|
||||
poptFreeContext(pc);
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "libcli/libcli.h"
|
||||
#include "torture/util.h"
|
||||
#include "torture/unix/proto.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libcli/resolve/resolve.h"
|
||||
#include "param/param.h"
|
||||
|
||||
@ -60,7 +60,7 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx)
|
||||
status = smbcli_full_connection(tctx, &cli, host,
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
share, NULL, lpcfg_socket_options(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
tctx->ev, &options, &session_options,
|
||||
lpcfg_gensec_settings(tctx, tctx->lp_ctx));
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "libcli/raw/raw_proto.h"
|
||||
#include "torture/torture.h"
|
||||
#include "torture/unix/proto.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "param/param.h"
|
||||
#include "libcli/resolve/resolve.h"
|
||||
@ -372,7 +372,7 @@ bool torture_unix_whoami(struct torture_context *torture)
|
||||
struct ldb_context *ldb;
|
||||
const char *addc, *host;
|
||||
|
||||
cli = connect_to_server(torture, popt_get_cmdline_credentials());
|
||||
cli = connect_to_server(torture, samba_cmdline_get_creds());
|
||||
torture_assert(torture, cli, "connecting to server with authenticated credentials");
|
||||
|
||||
/* Test basic authenticated mapping. */
|
||||
@ -389,7 +389,7 @@ bool torture_unix_whoami(struct torture_context *torture)
|
||||
guest ? "YES" : "NO");
|
||||
torture_assert(torture,
|
||||
cli_credentials_is_anonymous(
|
||||
popt_get_cmdline_credentials()) == guest,
|
||||
samba_cmdline_get_creds()) == guest,
|
||||
"login did not credentials map to guest");
|
||||
} else {
|
||||
torture_comment(torture, "server does not support SMB_WHOAMI_GUEST flag\n");
|
||||
@ -400,7 +400,7 @@ bool torture_unix_whoami(struct torture_context *torture)
|
||||
|
||||
if (addc) {
|
||||
ldb = ldb_wrap_connect(torture, torture->ev, torture->lp_ctx, talloc_asprintf(torture, "ldap://%s", addc),
|
||||
NULL, popt_get_cmdline_credentials(), 0);
|
||||
NULL, samba_cmdline_get_creds(), 0);
|
||||
torture_assert(torture, ldb, "ldb connect failed");
|
||||
|
||||
/* We skip this testing if we could not contact the LDAP server */
|
||||
|
@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libcli/raw/libcliraw.h"
|
||||
#include "libcli/raw/raw_proto.h"
|
||||
#include "../libcli/smb/smb_constants.h"
|
||||
@ -459,7 +459,7 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
sharename, NULL,
|
||||
lpcfg_socket_options(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
ev, &options, &session_options,
|
||||
lpcfg_gensec_settings(tctx, tctx->lp_ctx));
|
||||
@ -981,7 +981,7 @@ NTSTATUS torture_check_privilege(struct smbcli_state *cli,
|
||||
struct cli_credentials *torture_user2_credentials(struct torture_context *tctx,
|
||||
TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
struct cli_credentials *credentials1 = popt_get_cmdline_credentials();
|
||||
struct cli_credentials *credentials1 = samba_cmdline_get_creds();
|
||||
const char *user1domain = cli_credentials_get_domain(credentials1);
|
||||
const char *user2name = torture_setting_string(tctx, "user2name", NULL);
|
||||
const char *user2domain = torture_setting_string(tctx, "user2domain", user1domain);
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "libcli/smb2/smb2.h"
|
||||
#include "libcli/smb2/smb2_calls.h"
|
||||
#include "libcli/smb/smbXcli_base.h"
|
||||
@ -65,7 +65,7 @@ static bool torture_smb2_con_share(struct torture_context *tctx,
|
||||
lpcfg_smb_ports(tctx->lp_ctx),
|
||||
share,
|
||||
lpcfg_resolve_context(tctx->lp_ctx),
|
||||
popt_get_cmdline_credentials(),
|
||||
samba_cmdline_get_creds(),
|
||||
0,
|
||||
tree,
|
||||
tctx->ev,
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "libcli/smb2/smb2.h"
|
||||
#include "libcli/smb2/smb2_calls.h"
|
||||
#include "libcli/smb/smb2_create_ctx.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "param/param.h"
|
||||
#include "libcli/resolve/resolve.h"
|
||||
#include "MacExtensions.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include "libcli/smb2/smb2.h"
|
||||
#include "libcli/smb2/smb2_calls.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "param/param.h"
|
||||
#include "libcli/resolve/resolve.h"
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "auth/kerberos/kerberos.h"
|
||||
#include "auth/credentials/credentials.h"
|
||||
#include "param/param.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "lib/cmdline/cmdline.h"
|
||||
#include "auth/kerberos/pac_utils.h"
|
||||
#include "wbclient.h"
|
||||
|
||||
@ -211,7 +211,7 @@ static bool torture_winbind_pac(struct torture_context *tctx,
|
||||
torture_assert_ntstatus_ok(tctx, status, "gensec_set_target_hostname (client) failed");
|
||||
|
||||
status = gensec_set_credentials(gensec_client_context,
|
||||
popt_get_cmdline_credentials());
|
||||
samba_cmdline_get_creds());
|
||||
torture_assert_ntstatus_ok(tctx, status, "gensec_set_credentials (client) failed");
|
||||
|
||||
if (sasl_mech) {
|
||||
|
@ -5,7 +5,7 @@ samba_net = bld.pyembed_libname('samba-net')
|
||||
|
||||
bld.SAMBA_SUBSYSTEM('TORTURE_UTIL',
|
||||
source='util_smb.c',
|
||||
public_deps='torture popt POPT_CREDENTIALS',
|
||||
public_deps='torture',
|
||||
deps='smbclient-raw'
|
||||
)
|
||||
|
||||
@ -13,7 +13,7 @@ bld.SAMBA_SUBSYSTEM('TORTURE_UTIL',
|
||||
bld.SAMBA_MODULE('TORTURE_BASIC',
|
||||
source='basic/base.c basic/misc.c basic/scanner.c basic/utable.c basic/charset.c basic/mangle_test.c basic/denytest.c basic/aliases.c basic/locking.c basic/secleak.c basic/rename.c basic/dir.c basic/delete.c basic/unlink.c basic/disconnect.c basic/delaywrite.c basic/attr.c basic/properties.c',
|
||||
subsystem='smbtorture',
|
||||
deps='LIBCLI_SMB popt POPT_CREDENTIALS TORTURE_UTIL smbclient-raw TORTURE_RAW',
|
||||
deps='LIBCLI_SMB TORTURE_UTIL smbclient-raw TORTURE_RAW',
|
||||
internal_module=True,
|
||||
autoproto='basic/proto.h',
|
||||
init_function='torture_base_init',
|
||||
@ -26,7 +26,7 @@ bld.SAMBA_MODULE('TORTURE_RAW',
|
||||
autoproto='raw/proto.h',
|
||||
subsystem='smbtorture',
|
||||
init_function='torture_raw_init',
|
||||
deps='LIBCLI_SMB LIBCLI_LSA LIBCLI_SMB_COMPOSITE popt POPT_CREDENTIALS TORTURE_UTIL',
|
||||
deps='LIBCLI_SMB LIBCLI_LSA LIBCLI_SMB_COMPOSITE TORTURE_UTIL',
|
||||
internal_module=True,
|
||||
enabled=bld.PYTHON_BUILD_IS_ENABLED()
|
||||
)
|
||||
@ -172,7 +172,7 @@ bld.SAMBA_MODULE('torture_rpc',
|
||||
%s
|
||||
LIBCLI_AUTH
|
||||
popt
|
||||
POPT_CREDENTIALS
|
||||
CMDLINE_S4
|
||||
TORTURE_LDAP
|
||||
TORTURE_UTIL
|
||||
TORTURE_RAP
|
||||
@ -221,7 +221,7 @@ bld.SAMBA_MODULE('TORTURE_AUTH',
|
||||
source='auth/ntlmssp.c auth/pac.c auth/smbencrypt.c',
|
||||
autoproto='auth/proto.h',
|
||||
subsystem='smbtorture',
|
||||
deps='LIBCLI_SMB gensec auth4 authkrb5 popt POPT_CREDENTIALS smbpasswdparser torture com_err gensec_ntlmssp',
|
||||
deps='LIBCLI_SMB gensec auth4 authkrb5 smbpasswdparser torture com_err gensec_ntlmssp',
|
||||
internal_module=True
|
||||
)
|
||||
|
||||
@ -262,7 +262,7 @@ bld.SAMBA_MODULE('TORTURE_LDAP',
|
||||
ldap/session_expiry.c
|
||||
''',
|
||||
subsystem='smbtorture',
|
||||
deps='cli-ldap cli_cldap samdb popt POPT_CREDENTIALS torture ldbsamba',
|
||||
deps='cli-ldap cli_cldap samdb torture ldbsamba',
|
||||
internal_module=True,
|
||||
autoproto='ldap/proto.h',
|
||||
init_function='torture_ldap_init'
|
||||
@ -285,7 +285,7 @@ bld.SAMBA_MODULE('TORTURE_NET',
|
||||
autoproto='libnet/proto.h',
|
||||
subsystem='smbtorture',
|
||||
init_function='torture_net_init',
|
||||
deps='%s popt POPT_CREDENTIALS torture_rpc %s' % (provision, samba_net),
|
||||
deps='%s torture_rpc %s' % (provision, samba_net),
|
||||
internal_module=True,
|
||||
enabled=bld.PYTHON_BUILD_IS_ENABLED()
|
||||
)
|
||||
@ -296,7 +296,7 @@ bld.SAMBA_MODULE('TORTURE_NTP',
|
||||
autoproto='ntp/proto.h',
|
||||
subsystem='smbtorture',
|
||||
init_function='torture_ntp_init',
|
||||
deps='popt POPT_CREDENTIALS torture_rpc',
|
||||
deps='torture_rpc',
|
||||
internal_module=True,
|
||||
enabled=bld.PYTHON_BUILD_IS_ENABLED()
|
||||
)
|
||||
@ -304,7 +304,7 @@ bld.SAMBA_MODULE('TORTURE_NTP',
|
||||
bld.SAMBA_MODULE('TORTURE_VFS',
|
||||
source='vfs/vfs.c vfs/fruit.c vfs/acl_xattr.c',
|
||||
subsystem='smbtorture',
|
||||
deps='LIBCLI_SMB POPT_CREDENTIALS TORTURE_UTIL smbclient-raw TORTURE_RAW',
|
||||
deps='LIBCLI_SMB TORTURE_UTIL smbclient-raw TORTURE_RAW',
|
||||
internal_module=True,
|
||||
autoproto='vfs/proto.h',
|
||||
init_function='torture_vfs_init'
|
||||
@ -315,7 +315,7 @@ TORTURE_MODULES = 'TORTURE_BASIC TORTURE_RAW torture_rpc TORTURE_RAP TORTURE_AUT
|
||||
bld.SAMBA_SUBSYSTEM('torturemain',
|
||||
source='smbtorture.c torture.c shell.c',
|
||||
subsystem_name='smbtorture',
|
||||
deps='torture popt POPT_SAMBA POPT_CREDENTIALS dcerpc LIBCLI_SMB SMBREADLINE ' + TORTURE_MODULES,
|
||||
deps='torture dcerpc LIBCLI_SMB SMBREADLINE ' + TORTURE_MODULES,
|
||||
enabled=bld.PYTHON_BUILD_IS_ENABLED()
|
||||
)
|
||||
|
||||
@ -323,7 +323,7 @@ bld.SAMBA_BINARY('smbtorture',
|
||||
source=[],
|
||||
manpages='man/smbtorture.1',
|
||||
private_headers='smbtorture.h',
|
||||
deps='torturemain torture popt POPT_SAMBA POPT_CREDENTIALS dcerpc LIBCLI_SMB SMBREADLINE ' + TORTURE_MODULES,
|
||||
deps='torturemain torture popt CMDLINE_S4 dcerpc LIBCLI_SMB SMBREADLINE ' + TORTURE_MODULES,
|
||||
pyembed=True,
|
||||
enabled=bld.PYTHON_BUILD_IS_ENABLED()
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user