1
0
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:
Andreas Schneider 2020-12-02 17:24:22 +01:00 committed by Andrew Bartlett
parent 092d26af6a
commit a40bc1d0ee
84 changed files with 443 additions and 418 deletions

View File

@ -32,7 +32,7 @@
#include "lib/param/param.h" #include "lib/param/param.h"
#include "lib/util/samba_util.h" #include "lib/util/samba_util.h"
#include "auth/credentials/credentials.h" #include "auth/credentials/credentials.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include <gnutls/gnutls.h> #include <gnutls/gnutls.h>
#include <gnutls/crypto.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 wbcAuthUserInfo *info = NULL;
struct wbcAuthErrorInfo *error = NULL; struct wbcAuthErrorInfo *error = NULL;
wbcErr ret; wbcErr ret;
struct cli_credentials *creds = samba_cmdline_get_creds();
ret = wbcAuthenticateUser(cli_credentials_get_username( ret = wbcAuthenticateUser(cli_credentials_get_username(
popt_get_cmdline_credentials()), correct_password); creds), correct_password);
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS, torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
"wbcAuthenticateUser of %s failed", "wbcAuthenticateUser of %s failed",
cli_credentials_get_username(popt_get_cmdline_credentials())); cli_credentials_get_username(creds));
ZERO_STRUCT(params); ZERO_STRUCT(params);
params.account_name = params.account_name =
cli_credentials_get_username(popt_get_cmdline_credentials()); cli_credentials_get_username(creds);
params.level = WBC_AUTH_USER_LEVEL_PLAIN; params.level = WBC_AUTH_USER_LEVEL_PLAIN;
params.password.plaintext = correct_password; 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) 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, 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) static bool test_wbc_change_password(struct torture_context *tctx)
{ {
wbcErr ret; wbcErr ret;
struct cli_credentials *creds = samba_cmdline_get_creds();
const char *oldpass = const char *oldpass =
cli_credentials_get_password(popt_get_cmdline_credentials()); cli_credentials_get_password(creds);
const char *newpass = "Koo8irei%$"; const char *newpass = "Koo8irei%$";
struct samr_CryptPassword new_nt_password; 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.level = WBC_CHANGE_PASSWORD_LEVEL_RESPONSE;
params.account_name = params.account_name =
cli_credentials_get_username(popt_get_cmdline_credentials()); cli_credentials_get_username(creds);
params.domain_name = params.domain_name =
cli_credentials_get_domain(popt_get_cmdline_credentials()); cli_credentials_get_domain(creds);
ret = wbcChangeUserPasswordEx(&params, NULL, NULL, NULL); ret = wbcChangeUserPasswordEx(&params, NULL, NULL, NULL);
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS, 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( ret = wbcChangeUserPassword(
cli_credentials_get_username(popt_get_cmdline_credentials()), cli_credentials_get_username(creds),
newpass, newpass,
cli_credentials_get_password(popt_get_cmdline_credentials())); cli_credentials_get_password(creds));
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS, torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
"wbcChangeUserPassword for %s failed", params.account_name); "wbcChangeUserPassword for %s failed", params.account_name);
return test_wbc_authenticate_user_int(tctx, 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) 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; enum wbcSidType sidtype;
char *sidstr; char *sidstr;
wbcErr ret; wbcErr ret;
struct cli_credentials *creds = samba_cmdline_get_creds();
ZERO_STRUCT(params); ZERO_STRUCT(params);
@ -934,9 +939,9 @@ static bool test_wbc_logon_user(struct torture_context *tctx)
"have failed"); "have failed");
params.username = params.username =
cli_credentials_get_username(popt_get_cmdline_credentials()); cli_credentials_get_username(creds);
params.password = params.password =
cli_credentials_get_password(popt_get_cmdline_credentials()); cli_credentials_get_password(creds);
ret = wbcAddNamedBlob(&params.num_blobs, &params.blobs, ret = wbcAddNamedBlob(&params.num_blobs, &params.blobs,
"foo", 0, discard_const_p(uint8_t, "bar"), 4); "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, torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
"%s", "wbcAddNamedBlob failed"); "%s", "wbcAddNamedBlob failed");
params.password = params.password =
cli_credentials_get_password(popt_get_cmdline_credentials()); cli_credentials_get_password(creds);
ret = wbcLogonUser(&params, &info, &error, &policy); ret = wbcLogonUser(&params, &info, &error, &policy);
torture_assert_wbc_equal(tctx, ret, WBC_ERR_AUTH_ERROR, torture_assert_wbc_equal(tctx, ret, WBC_ERR_AUTH_ERROR,
"wbcLogonUser for %s should have failed with " "wbcLogonUser for %s should have failed with "
@ -983,13 +988,13 @@ static bool test_wbc_logon_user(struct torture_context *tctx)
"%s", "wbcInterfaceDetails failed"); "%s", "wbcInterfaceDetails failed");
ret = wbcLookupName(iface->netbios_domain, ret = wbcLookupName(iface->netbios_domain,
cli_credentials_get_username(popt_get_cmdline_credentials()), cli_credentials_get_username(creds),
&sid, &sid,
&sidtype); &sidtype);
wbcFreeMemory(iface); wbcFreeMemory(iface);
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS, torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
"wbcLookupName for %s failed", "wbcLookupName for %s failed",
cli_credentials_get_username(popt_get_cmdline_credentials())); cli_credentials_get_username(creds));
ret = wbcSidToString(&sid, &sidstr); ret = wbcSidToString(&sid, &sidstr);
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS, 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"); "%s", "wbcAddNamedBlob failed");
wbcFreeMemory(sidstr); wbcFreeMemory(sidstr);
params.password = params.password =
cli_credentials_get_password(popt_get_cmdline_credentials()); cli_credentials_get_password(creds);
ret = wbcLogonUser(&params, &info, &error, &policy); ret = wbcLogonUser(&params, &info, &error, &policy);
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS, torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
"wbcLogonUser for %s failed", params.username); "wbcLogonUser for %s failed", params.username);
@ -1020,14 +1025,15 @@ static bool test_wbc_getgroups(struct torture_context *tctx)
wbcErr ret; wbcErr ret;
uint32_t num_groups; uint32_t num_groups;
gid_t *groups; gid_t *groups;
struct cli_credentials *creds = samba_cmdline_get_creds();
ret = wbcGetGroups( ret = wbcGetGroups(
cli_credentials_get_username(popt_get_cmdline_credentials()), cli_credentials_get_username(creds),
&num_groups, &num_groups,
&groups); &groups);
torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS, torture_assert_wbc_equal(tctx, ret, WBC_ERR_SUCCESS,
"wbcGetGroups for %s failed", "wbcGetGroups for %s failed",
cli_credentials_get_username(popt_get_cmdline_credentials())); cli_credentials_get_username(creds));
wbcFreeMemory(groups); wbcFreeMemory(groups);
return true; return true;
} }

View File

@ -331,7 +331,7 @@
^samba.tests.dns.__main__.TestComplexQueries.test_cname_two_chain_not_matching_qtype ^samba.tests.dns.__main__.TestComplexQueries.test_cname_two_chain_not_matching_qtype
# ad_dc requires signing # 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 # fl2000dc doesn't support AES
^samba4.krb5.kdc.*as-req-aes.*fl2000dc ^samba4.krb5.kdc.*as-req-aes.*fl2000dc
# nt4_member and ad_member don't support ntlmv1 (not even over SMB1) # nt4_member and ad_member don't support ntlmv1 (not even over SMB1)

View File

@ -1,2 +1,2 @@
# 'raw NTLMv2 auth' is not enabled on ad_member # '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\)

View File

@ -40,9 +40,9 @@
^samba3.unix.whoami kerberos connection.whoami\(ad_member\) ^samba3.unix.whoami kerberos connection.whoami\(ad_member\)
^samba3.unix.whoami anonymous connection.whoami\(ad_member\) ^samba3.unix.whoami anonymous connection.whoami\(ad_member\)
^samba3.unix.whoami ntlm user@realm.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 --client-protection=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 no --option=gensec:spengo=no --client-protection=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 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 without kerberos\(ad_member:local\)
^samba4.blackbox.smbclient\(ad_member:local\).Test login with --machine-pass and 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\) ^samba4.blackbox.smbclient\(chgdcpass:local\).Test login with --machine-pass without kerberos\(chgdcpass:local\)

View File

@ -856,7 +856,7 @@ for t in tests:
if t == "raw.notify" or t == "raw.oplock": if t == "raw.notify" or t == "raw.oplock":
tmp_env = "nt4_dc_smb1" tmp_env = "nt4_dc_smb1"
# These tests are a little slower so don't duplicate them with ad_dc # 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": elif t == "smb2.dosmode":
plansmbtorture4testsuite(t, "simpleserver", '//$SERVER/dosmode -U$USERNAME%$PASSWORD') plansmbtorture4testsuite(t, "simpleserver", '//$SERVER/dosmode -U$USERNAME%$PASSWORD')
elif t == "smb2.kernel-oplocks": elif t == "smb2.kernel-oplocks":
@ -996,10 +996,10 @@ for s in signseal_options:
e = "" e = ""
a = "smb2" a = "smb2"
binding_string = "ncacn_np:$SERVER[%s%s%s]" % (a, s, e) 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)) 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)) plansmbtorture4testsuite(test, "ktest", options, 'krb5 ncacn_np with [%s%s%s] ' % (a, s, e))
auth_options2 = ["krb5", "spnego,krb5"] auth_options2 = ["krb5", "spnego,krb5"]

View File

@ -623,7 +623,7 @@ for mech in [
"-k no --option=gensec:spengo=no", "-k no --option=gensec:spengo=no",
"-k yes", "-k yes",
"-k yes --option=gensec:fake_gssapi_krb5=yes --option=gensec:gssapi_krb5=no"]: "-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) signoptions = "%s %s" % (mech, signing)
name = "smb.signing on with %s" % signoptions name = "smb.signing on with %s" % signoptions
plansmbtorture4testsuite('base.xcopy', "ad_dc_ntvfs", ['//$NETBIOSNAME/xcopy_share', signoptions, '-U$USERNAME%$PASSWORD'], modname="samba4.%s" % name) 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=clientusespnego=no",
"-k no --option=gensec:spengo=no", "-k no --option=gensec:spengo=no",
"-k yes"]: "-k yes"]:
signoptions = "%s --signing=off" % mech signoptions = "%s --client-protection=off" % mech
name = "smb.signing disabled on with %s" % signoptions 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', "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) 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",
"-k no --option=clientusespnego=no", "-k no --option=clientusespnego=no",
"-k no --option=gensec:spengo=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', "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', '--option=clientsigning=desired', '-U%'], modname="samba4.smb.signing --option=clientsigning=desired 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', "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', '--signing=no', '-U%'], modname="samba4.smb.signing --signing=no 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 # Test SPNEGO without issuing an optimistic token
opt='--option=spnego:client_no_optimistic=yes' opt='--option=spnego:client_no_optimistic=yes'

View File

@ -22,7 +22,7 @@
#include "auth/gensec/gensec_internal.h" #include "auth/gensec/gensec_internal.h"
#include "auth/ntlmssp/ntlmssp.h" #include "auth/ntlmssp/ntlmssp.h"
#include "auth/ntlmssp/ntlmssp_private.h" #include "auth/ntlmssp/ntlmssp_private.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "torture/torture.h" #include "torture/torture.h"
#include "param/param.h" #include "param/param.h"
#include "torture/auth/proto.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)), lpcfg_gensec_settings(tctx, tctx->lp_ctx)),
"gensec client start"); "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_SIGN);
gensec_want_feature(gensec_security, GENSEC_FEATURE_SEAL); 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)), lpcfg_gensec_settings(tctx, tctx->lp_ctx)),
"Failed to start GENSEC for NTLMSSP"); "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_SIGN);
gensec_want_feature(gensec_security, GENSEC_FEATURE_SEAL); gensec_want_feature(gensec_security, GENSEC_FEATURE_SEAL);

View File

@ -34,7 +34,7 @@
#include "libcli/composite/composite.h" #include "libcli/composite/composite.h"
#include "param/param.h" #include "param/param.h"
#include "torture/basic/proto.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) 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.socket_options = lpcfg_socket_options(tctx->lp_ctx);
smb->in.called_name = strupper_talloc(mem_ctx, host); smb->in.called_name = strupper_talloc(mem_ctx, host);
smb->in.service_type=NULL; 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.fallback_to_anonymous=false;
smb->in.gensec_settings = lpcfg_gensec_settings(mem_ctx, tctx->lp_ctx); smb->in.gensec_settings = lpcfg_gensec_settings(mem_ctx, tctx->lp_ctx);
smb->in.workgroup=workgroup; smb->in.workgroup=workgroup;

View File

@ -29,7 +29,7 @@
#include "auth/session.h" #include "auth/session.h"
#include "auth/gensec/gensec.h" #include "auth/gensec/gensec.h"
#include "auth/credentials/credentials.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. */ /* Tests that configure multiple DLZs will use this. Increase to add stress. */
#define NUM_DLZS_TO_CONFIGURE 4 #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"); torture_assert_ntstatus_ok(tctx, status, "gensec_set_target_service failed");
status = gensec_set_credentials(gensec_client_context, 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"); torture_assert_ntstatus_ok(tctx, status, "gensec_set_credentials (client) failed");
status = gensec_start_mech_by_sasl_name(gensec_client_context, mech); 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( torture_assert_int_equal(tctx, dlz_ssumatch(
cli_credentials_get_username( cli_credentials_get_username(
popt_get_cmdline_credentials()), samba_cmdline_get_creds()),
lpcfg_dnsdomain(tctx->lp_ctx), lpcfg_dnsdomain(tctx->lp_ctx),
"127.0.0.1", "type", "key", "127.0.0.1", "type", "key",
client_to_server.length, 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"); torture_assert_ntstatus_ok(tctx, status, "gensec_set_target_service failed");
status = gensec_set_credentials(gensec_client_context, 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"); torture_assert_ntstatus_ok(tctx, status, "gensec_set_credentials (client) failed");
status = gensec_start_mech_by_sasl_name(gensec_client_context, "GSS-SPNEGO"); 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( torture_assert_int_equal(tctx, dlz_ssumatch(
cli_credentials_get_username( cli_credentials_get_username(
popt_get_cmdline_credentials()), samba_cmdline_get_creds()),
name, name,
"127.0.0.1", "127.0.0.1",
expected1->records[0].type, expected1->records[0].type,

View File

@ -21,7 +21,7 @@
*/ */
#include "includes.h" #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_drsuapi_c.h"
#include "librpc/gen_ndr/ndr_drsblobs.h" #include "librpc/gen_ndr/ndr_drsblobs.h"
#include "libcli/cldap/cldap.h" #include "libcli/cldap/cldap.h"
@ -126,7 +126,7 @@ static struct DsSyncTest *test_create_context(struct torture_context *tctx)
} }
/* ctx->admin ...*/ /* 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 = &ctx->admin.drsuapi.our_bind_info28;
our_bind_info28->supported_extensions = 0xFFFFFFFF; 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->admin.drsuapi.req.out.bind_handle = &ctx->admin.drsuapi.bind_handle;
/* ctx->new_dc ...*/ /* 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 = &ctx->new_dc.drsuapi.our_bind_info28;
our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_BASE; our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_BASE;

View File

@ -20,7 +20,7 @@
*/ */
#include "includes.h" #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_drsuapi_c.h"
#include "librpc/gen_ndr/ndr_drsblobs.h" #include "librpc/gen_ndr/ndr_drsblobs.h"
#include "libcli/cldap/cldap.h" #include "libcli/cldap/cldap.h"
@ -186,7 +186,7 @@ static struct DsIntIdTestCtx *_dsintid_create_context(struct torture_context *tc
} }
/* populate test suite context */ /* populate test suite context */
ctx->creds = popt_get_cmdline_credentials(); ctx->creds = samba_cmdline_get_creds();
ctx->dsa_bind.server_binding = server_binding; ctx->dsa_bind.server_binding = server_binding;
ctx->ldap_url = talloc_asprintf(ctx, "ldap://%s", ctx->ldap_url = talloc_asprintf(ctx, "ldap://%s",

View File

@ -5,7 +5,7 @@ bld.SAMBA_MODULE('TORTURE_DRS',
autoproto='proto.h', autoproto='proto.h',
subsystem='smbtorture', subsystem='smbtorture',
init_function='torture_drs_init', 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, internal_module=True,
enabled=bld.PYTHON_BUILD_IS_ENABLED() enabled=bld.PYTHON_BUILD_IS_ENABLED()
) )

View File

@ -25,7 +25,7 @@
#include "torture/smbtorture.h" #include "torture/smbtorture.h"
#include "torture/krb5/proto.h" #include "torture/krb5/proto.h"
#include "auth/credentials/credentials.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.h"
#include "source4/auth/kerberos/kerberos_util.h" #include "source4/auth/kerberos/kerberos_util.h"
#include "lib/util/util_net.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 *got_principal_string;
char *assertion_message; char *assertion_message;
const char *password = cli_credentials_get_password( const char *password = cli_credentials_get_password(
popt_get_cmdline_credentials()); samba_cmdline_get_creds());
krb5_context k5_context; krb5_context k5_context;
struct torture_krb5_context *test_context; struct torture_krb5_context *test_context;
bool ok; bool ok;
@ -2090,7 +2090,7 @@ static bool torture_krb5_as_req_canon(struct torture_context *tctx, const void *
torture_assert(tctx, torture_assert(tctx,
test_accept_ticket(tctx, test_accept_ticket(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
spn_real_realm, spn_real_realm,
client_to_server), client_to_server),
"test_accept_ticket failed - failed to accept the ticket we just created"); "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, torture_assert(tctx,
test_accept_ticket(tctx, test_accept_ticket(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
spn, spn,
client_to_server), client_to_server),
"test_accept_ticket failed - failed to accept the ticket we just created"); "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, torture_assert(tctx,
test_accept_ticket(tctx, test_accept_ticket(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
principal_string, principal_string,
client_to_server), client_to_server),
"test_accept_ticket failed - failed to accept the ticket we just created"); "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, torture_assert(tctx,
test_accept_ticket(tctx, test_accept_ticket(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
accept_expected_principal_string, accept_expected_principal_string,
client_to_server), client_to_server),
"test_accept_ticket failed - failed to accept the ticket we just created"); "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, torture_assert(tctx,
test_accept_ticket(tctx, test_accept_ticket(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
expected_unparse_principal_string, expected_unparse_principal_string,
client_to_server), client_to_server),
"test_accept_ticket failed - failed to accept the ticket we just created"); "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 test_data->real_realm
= strupper_talloc(test_data, = strupper_talloc(test_data,
cli_credentials_get_realm( cli_credentials_get_realm(
popt_get_cmdline_credentials())); samba_cmdline_get_creds()));
test_data->real_domain = cli_credentials_get_domain( test_data->real_domain = cli_credentials_get_domain(
popt_get_cmdline_credentials()); samba_cmdline_get_creds());
test_data->username = cli_credentials_get_username( test_data->username = cli_credentials_get_username(
popt_get_cmdline_credentials()); samba_cmdline_get_creds());
test_data->real_username = cli_credentials_get_username( 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->canonicalize = (i & TEST_CANONICALIZE) != 0;
test_data->enterprise = (i & TEST_ENTERPRISE) != 0; test_data->enterprise = (i & TEST_ENTERPRISE) != 0;
test_data->upper_realm = (i & TEST_UPPER_REALM) != 0; test_data->upper_realm = (i & TEST_UPPER_REALM) != 0;

View File

@ -26,7 +26,7 @@
#include "torture/winbind/proto.h" #include "torture/winbind/proto.h"
#include "torture/krb5/proto.h" #include "torture/krb5/proto.h"
#include "auth/credentials/credentials.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.h"
#include "source4/auth/kerberos/kerberos_util.h" #include "source4/auth/kerberos/kerberos_util.h"
#include "lib/util/util_net.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) 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); 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)) { 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"); 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); TORTURE_KRB5_TEST_PAC_REQUEST);
} }
static bool torture_krb5_as_req_break_pw(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(), return torture_krb5_as_req_creds(tctx, samba_cmdline_get_creds(),
TORTURE_KRB5_TEST_BREAK_PW); TORTURE_KRB5_TEST_BREAK_PW);
} }
static bool torture_krb5_as_req_clock_skew(struct torture_context *tctx) 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); TORTURE_KRB5_TEST_CLOCK_SKEW);
} }
static bool torture_krb5_as_req_aes(struct torture_context *tctx) static bool torture_krb5_as_req_aes(struct torture_context *tctx)
{ {
return torture_krb5_as_req_creds(tctx, return torture_krb5_as_req_creds(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
TORTURE_KRB5_TEST_AES); TORTURE_KRB5_TEST_AES);
} }
static bool torture_krb5_as_req_rc4(struct torture_context *tctx) static bool torture_krb5_as_req_rc4(struct torture_context *tctx)
{ {
return torture_krb5_as_req_creds(tctx, return torture_krb5_as_req_creds(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
TORTURE_KRB5_TEST_RC4); TORTURE_KRB5_TEST_RC4);
} }
static bool torture_krb5_as_req_aes_rc4(struct torture_context *tctx) static bool torture_krb5_as_req_aes_rc4(struct torture_context *tctx)
{ {
return torture_krb5_as_req_creds(tctx, return torture_krb5_as_req_creds(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
TORTURE_KRB5_TEST_AES_RC4); 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) static bool torture_krb5_as_req_change_server_out(struct torture_context *tctx)
{ {
return torture_krb5_as_req_creds(tctx, return torture_krb5_as_req_creds(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
TORTURE_KRB5_TEST_CHANGE_SERVER_OUT); TORTURE_KRB5_TEST_CHANGE_SERVER_OUT);
} }
static bool torture_krb5_as_req_change_server_in(struct torture_context *tctx) static bool torture_krb5_as_req_change_server_in(struct torture_context *tctx)
{ {
return torture_krb5_as_req_creds(tctx, return torture_krb5_as_req_creds(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
TORTURE_KRB5_TEST_CHANGE_SERVER_IN); TORTURE_KRB5_TEST_CHANGE_SERVER_IN);
} }
static bool torture_krb5_as_req_change_server_both(struct torture_context *tctx) static bool torture_krb5_as_req_change_server_both(struct torture_context *tctx)
{ {
return torture_krb5_as_req_creds(tctx, return torture_krb5_as_req_creds(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
TORTURE_KRB5_TEST_CHANGE_SERVER_BOTH); TORTURE_KRB5_TEST_CHANGE_SERVER_BOTH);
} }

View File

@ -26,7 +26,7 @@
#include "torture/winbind/proto.h" #include "torture/winbind/proto.h"
#include "torture/krb5/proto.h" #include "torture/krb5/proto.h"
#include "auth/credentials/credentials.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.h"
#include "source4/auth/kerberos/kerberos_util.h" #include "source4/auth/kerberos/kerberos_util.h"
#include "lib/util/util_net.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) static bool torture_krb5_as_req_cmdline(struct torture_context *tctx)
{ {
return torture_krb5_as_req_creds(tctx, return torture_krb5_as_req_creds(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
TORTURE_KRB5_TEST_PLAIN); 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 " "RODC case against a Windows DC, in particular "
"with non-cached users"); "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); TORTURE_KRB5_TEST_PAC_REQUEST);
} }
#endif /* HAVE_KRB5_GET_INIT_CREDS_OPT_SET_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) static bool torture_krb5_as_req_break_pw(struct torture_context *tctx)
{ {
return torture_krb5_as_req_creds(tctx, return torture_krb5_as_req_creds(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
TORTURE_KRB5_TEST_BREAK_PW); TORTURE_KRB5_TEST_BREAK_PW);
} }
static bool torture_krb5_as_req_clock_skew(struct torture_context *tctx) static bool torture_krb5_as_req_clock_skew(struct torture_context *tctx)
{ {
return torture_krb5_as_req_creds(tctx, return torture_krb5_as_req_creds(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
TORTURE_KRB5_TEST_CLOCK_SKEW); TORTURE_KRB5_TEST_CLOCK_SKEW);
} }
static bool torture_krb5_as_req_aes(struct torture_context *tctx) static bool torture_krb5_as_req_aes(struct torture_context *tctx)
{ {
return torture_krb5_as_req_creds(tctx, return torture_krb5_as_req_creds(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
TORTURE_KRB5_TEST_AES); TORTURE_KRB5_TEST_AES);
} }
static bool torture_krb5_as_req_rc4(struct torture_context *tctx) static bool torture_krb5_as_req_rc4(struct torture_context *tctx)
{ {
return torture_krb5_as_req_creds(tctx, return torture_krb5_as_req_creds(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
TORTURE_KRB5_TEST_RC4); TORTURE_KRB5_TEST_RC4);
} }
static bool torture_krb5_as_req_aes_rc4(struct torture_context *tctx) static bool torture_krb5_as_req_aes_rc4(struct torture_context *tctx)
{ {
return torture_krb5_as_req_creds(tctx, return torture_krb5_as_req_creds(tctx,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
TORTURE_KRB5_TEST_AES_RC4); TORTURE_KRB5_TEST_AES_RC4);
} }

View File

@ -7,7 +7,7 @@ if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
autoproto='proto.h', autoproto='proto.h',
subsystem='smbtorture', subsystem='smbtorture',
init_function='torture_krb5_init', init_function='torture_krb5_init',
deps='authkrb5 popt POPT_CREDENTIALS torture KERBEROS_UTIL', deps='authkrb5 torture KERBEROS_UTIL',
internal_module=True) internal_module=True)
else: else:
bld.SAMBA_MODULE('TORTURE_KRB5', bld.SAMBA_MODULE('TORTURE_KRB5',
@ -15,5 +15,5 @@ if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
autoproto='proto.h', autoproto='proto.h',
subsystem='smbtorture', subsystem='smbtorture',
init_function='torture_krb5_init', init_function='torture_krb5_init',
deps='authkrb5 popt POPT_CREDENTIALS torture KERBEROS_UTIL', deps='authkrb5 torture KERBEROS_UTIL',
internal_module=True) internal_module=True)

View File

@ -24,7 +24,7 @@
#include "includes.h" #include "includes.h"
#include "ldb_wrap.h" #include "ldb_wrap.h"
#include "libcli/ldap/ldap_client.h" #include "libcli/ldap/ldap_client.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "torture/torture.h" #include "torture/torture.h"
#include "torture/ldap/proto.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, 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 */ /* "partitions[i]" are the partitions for which we search the parents */
for (i = 1; partitions[i] != NULL; i++) { for (i = 1; partitions[i] != NULL; i++) {
@ -965,7 +965,7 @@ bool torture_ldap_basic(struct torture_context *torture)
ret = false; ret = false;
} }
if (!test_bind_sasl(torture, conn, popt_get_cmdline_credentials())) { if (!test_bind_sasl(torture, conn, samba_cmdline_get_creds())) {
ret = false; ret = false;
} }

View File

@ -26,7 +26,7 @@
#include <ldb_errors.h> #include <ldb_errors.h>
#include "ldb_wrap.h" #include "ldb_wrap.h"
#include "param/param.h" #include "param/param.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libcli/ldap/ldap_client.h" #include "libcli/ldap/ldap_client.h"
#include "torture/smbtorture.h" #include "torture/smbtorture.h"
#include "torture/ldap/proto.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, ldb = ldb_wrap_connect(torture, torture->ev, torture->lp_ctx, url,
NULL, NULL,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0); 0);
torture_assert(torture, ldb, "Failed to make LDB connection to target"); torture_assert(torture, ldb, "Failed to make LDB connection to target");

View File

@ -22,7 +22,7 @@
#include "includes.h" #include "includes.h"
#include "ldb.h" #include "ldb.h"
#include "ldb_wrap.h" #include "ldb_wrap.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libcli/ldap/ldap_client.h" #include "libcli/ldap/ldap_client.h"
#include "torture/torture.h" #include "torture/torture.h"
#include "torture/ldap/proto.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); torture_comment(tctx, "Connecting to: %s\n", url);
sctx->ldb = ldb_wrap_connect(sctx, tctx->ev, tctx->lp_ctx, url, sctx->ldb = ldb_wrap_connect(sctx, tctx->ev, tctx->lp_ctx, url,
NULL, NULL,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0); 0);
torture_assert(tctx, sctx->ldb, "Failed to create ldb connection"); torture_assert(tctx, sctx->ldb, "Failed to create ldb connection");

View File

@ -21,7 +21,7 @@
#include "includes.h" #include "includes.h"
#include "libcli/ldap/ldap_client.h" #include "libcli/ldap/ldap_client.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "ldb_wrap.h" #include "ldb_wrap.h"
#include "dsdb/samdb/samdb.h" #include "dsdb/samdb/samdb.h"
#include "../lib/util/dlinklist.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, ldb = ldb_wrap_connect(torture, torture->ev, torture->lp_ctx, url,
NULL, NULL,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0); 0);
if (!ldb) goto failed; if (!ldb) goto failed;

View File

@ -26,7 +26,7 @@
#include <ldb_errors.h> #include <ldb_errors.h>
#include "ldb_wrap.h" #include "ldb_wrap.h"
#include "param/param.h" #include "param/param.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "auth/credentials/credentials.h" #include "auth/credentials/credentials.h"
#include "libcli/ldap/ldap_client.h" #include "libcli/ldap/ldap_client.h"
#include "torture/smbtorture.h" #include "torture/smbtorture.h"
@ -35,7 +35,7 @@
bool torture_ldap_session_expiry(struct torture_context *torture) bool torture_ldap_session_expiry(struct torture_context *torture)
{ {
const char *host = torture_setting_string(torture, "host", NULL); 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; struct ldb_context *ldb = NULL;
const char *url = NULL; const char *url = NULL;
bool ret = false; bool ret = false;

View File

@ -21,7 +21,7 @@
#include "includes.h" #include "includes.h"
#include "libcli/ldap/ldap_client.h" #include "libcli/ldap/ldap_client.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "ldb_wrap.h" #include "ldb_wrap.h"
#include "dsdb/samdb/samdb.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, ldb = ldb_wrap_connect(torture, torture->ev, torture->lp_ctx, url,
NULL, NULL,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0); 0);
if (!ldb) goto failed; if (!ldb) goto failed;

View File

@ -20,7 +20,7 @@
*/ */
#include "includes.h" #include "includes.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "torture/rpc/torture_rpc.h" #include "torture/rpc/torture_rpc.h"
#include "libnet/libnet.h" #include "libnet/libnet.h"
#include "dsdb/samdb/samdb.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"); torture_assert(torture, s, "libnet_vampire_cb_state_init");
ctx = libnet_context_init(torture->ev, torture->lp_ctx); ctx = libnet_context_init(torture->ev, torture->lp_ctx);
ctx->cred = popt_get_cmdline_credentials(); ctx->cred = samba_cmdline_get_creds();
ZERO_STRUCT(b); ZERO_STRUCT(b);
b.in.domain_dns_name = torture_join_dom_dns_name(tj); b.in.domain_dns_name = torture_join_dom_dns_name(tj);

View File

@ -20,7 +20,7 @@
#include "includes.h" #include "includes.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libnet/libnet.h" #include "libnet/libnet.h"
#include "librpc/gen_ndr/ndr_samr_c.h" #include "librpc/gen_ndr/ndr_samr_c.h"
#include "librpc/gen_ndr/ndr_lsa_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; return false;
} }
ctx->cred = popt_get_cmdline_credentials(); ctx->cred = samba_cmdline_get_creds();
ZERO_STRUCT(r); ZERO_STRUCT(r);
r.in.type = DOMAIN_LSA; r.in.type = DOMAIN_LSA;
@ -196,11 +196,11 @@ bool torture_domain_close_lsa(struct torture_context *torture)
goto done; goto done;
} }
ctx->cred = popt_get_cmdline_credentials(); ctx->cred = samba_cmdline_get_creds();
mem_ctx = talloc_init("torture_domain_close_lsa"); mem_ctx = talloc_init("torture_domain_close_lsa");
status = dcerpc_pipe_connect_b(mem_ctx, &p, binding, &ndr_table_lsarpc, 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); torture->ev, torture->lp_ctx);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
torture_comment(torture, "failed to connect to server: %s\n", nt_errstr(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"); mem_ctx = talloc_init("test_domainopen_lsa");
ctx = libnet_context_init(torture->ev, torture->lp_ctx); 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 /* we're accessing domain controller so the domain name should be
passed (it's going to be resolved to dc name and address) instead 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; goto done;
} }
ctx->cred = popt_get_cmdline_credentials(); ctx->cred = samba_cmdline_get_creds();
mem_ctx = talloc_init("torture_domain_close_samr"); mem_ctx = talloc_init("torture_domain_close_samr");
status = dcerpc_pipe_connect_b(mem_ctx, &p, binding, &ndr_table_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; goto done;
} }
ctx->cred = popt_get_cmdline_credentials(); ctx->cred = samba_cmdline_get_creds();
mem_ctx = talloc_init("torture_domain_close_samr"); mem_ctx = talloc_init("torture_domain_close_samr");

View File

@ -20,7 +20,7 @@
#include "includes.h" #include "includes.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libnet/libnet.h" #include "libnet/libnet.h"
#include "librpc/gen_ndr/ndr_samr_c.h" #include "librpc/gen_ndr/ndr_samr_c.h"
#include "librpc/gen_ndr/ndr_lsa_c.h" #include "librpc/gen_ndr/ndr_lsa_c.h"
@ -114,7 +114,7 @@ bool torture_grouplist(struct torture_context *torture)
int i; int i;
ctx = libnet_context_init(torture->ev, torture->lp_ctx); 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); domain_name.string = lpcfg_workgroup(torture->lp_ctx);
mem_ctx = talloc_init("torture group list"); mem_ctx = talloc_init("torture group list");
@ -177,7 +177,7 @@ bool torture_creategroup(struct torture_context *torture)
mem_ctx = talloc_init("test_creategroup"); mem_ctx = talloc_init("test_creategroup");
ctx = libnet_context_init(torture->ev, torture->lp_ctx); 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.group_name = TEST_GROUPNAME;
req.in.domain_name = lpcfg_workgroup(torture->lp_ctx); req.in.domain_name = lpcfg_workgroup(torture->lp_ctx);

View File

@ -19,7 +19,7 @@
*/ */
#include "includes.h" #include "includes.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libnet/libnet.h" #include "libnet/libnet.h"
#include "libcli/libcli.h" #include "libcli/libcli.h"
#include "torture/rpc/torture_rpc.h" #include "torture/rpc/torture_rpc.h"
@ -39,7 +39,7 @@ bool torture_lookup(struct torture_context *torture)
mem_ctx = talloc_init("test_lookup"); mem_ctx = talloc_init("test_lookup");
ctx = libnet_context_init(torture->ev, torture->lp_ctx); 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); lookup.in.hostname = torture_setting_string(torture, "host", NULL);
if (lookup.in.hostname == 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"); mem_ctx = talloc_init("test_lookup_host");
ctx = libnet_context_init(torture->ev, torture->lp_ctx); 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); lookup.in.hostname = torture_setting_string(torture, "host", NULL);
if (lookup.in.hostname == 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"); mem_ctx = talloc_init("test_lookup_pdc");
ctx = libnet_context_init(torture->ev, torture->lp_ctx); 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); talloc_steal(ctx, mem_ctx);
@ -171,7 +171,7 @@ bool torture_lookup_sam_name(struct torture_context *torture)
bool ret = true; bool ret = true;
ctx = libnet_context_init(torture->ev, torture->lp_ctx); 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"); mem_ctx = talloc_init("torture lookup sam name");
if (mem_ctx == NULL) return false; if (mem_ctx == NULL) return false;

View File

@ -19,7 +19,7 @@
*/ */
#include "includes.h" #include "includes.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libnet/libnet.h" #include "libnet/libnet.h"
#include "libcli/security/security.h" #include "libcli/security/security.h"
#include "librpc/gen_ndr/ndr_lsa.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; struct libnet_context *ctx;
ctx = libnet_context_init(torture->ev, torture->lp_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"); torture_comment(torture, "Testing connection to LSA interface\n");

View File

@ -22,7 +22,7 @@
#include "includes.h" #include "includes.h"
#include "torture/rpc/torture_rpc.h" #include "torture/rpc/torture_rpc.h"
#include "libnet/libnet.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 "librpc/gen_ndr/ndr_srvsvc_c.h"
#include "torture/libnet/proto.h" #include "torture/libnet/proto.h"
@ -182,7 +182,7 @@ bool torture_listshares(struct torture_context *torture)
goto done; goto done;
} }
libnetctx->cred = popt_get_cmdline_credentials(); libnetctx->cred = samba_cmdline_get_creds();
torture_comment(torture, "Testing libnet_ListShare\n"); 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"); torture_assert_ntstatus_ok(torture, status, "Failed to get binding");
libnetctx = libnet_context_init(torture->ev, torture->lp_ctx); 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, status = torture_rpc_connection(torture,
&p, &p,

View File

@ -20,7 +20,7 @@
#include "includes.h" #include "includes.h"
#include "system/time.h" #include "system/time.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libnet/libnet.h" #include "libnet/libnet.h"
#include "librpc/gen_ndr/ndr_samr_c.h" #include "librpc/gen_ndr/ndr_samr_c.h"
#include "librpc/gen_ndr/ndr_lsa_c.h" #include "librpc/gen_ndr/ndr_lsa_c.h"
@ -466,7 +466,7 @@ bool torture_userlist(struct torture_context *torture)
int i; int i;
ctx = libnet_context_init(torture->ev, torture->lp_ctx); 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); domain_name.string = lpcfg_workgroup(torture->lp_ctx);
mem_ctx = talloc_init("torture user list"); mem_ctx = talloc_init("torture user list");

View File

@ -23,7 +23,7 @@
*/ */
#include "includes.h" #include "includes.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "torture/rpc/torture_rpc.h" #include "torture/rpc/torture_rpc.h"
#include "libnet/libnet.h" #include "libnet/libnet.h"
#include "librpc/gen_ndr/ndr_samr_c.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, ldb = ldb_wrap_connect(tmp_ctx,
tctx->ev, tctx->lp_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"); torture_assert_goto(tctx, ldb != NULL, test_res, done, "Failed to make LDB connection");
ldb_ret = ldb_search(ldb, tmp_ctx, &ldb_res, 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"); torture_assert(tctx, net_ctx != NULL, "Failed to create libnet_context");
/* Use command line credentials for testing */ /* Use command line credentials for testing */
net_ctx->cred = popt_get_cmdline_credentials(); net_ctx->cred = samba_cmdline_get_creds();
if (rpc_connect) { if (rpc_connect) {
/* connect SAMR pipe */ /* connect SAMR pipe */

View File

@ -20,7 +20,7 @@
#include "source3/include/includes.h" #include "source3/include/includes.h"
#include "torture/smbtorture.h" #include "torture/smbtorture.h"
#include "auth/credentials/credentials.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.h"
#include "source3/lib/netapi/netapi_private.h" #include "source3/lib/netapi/netapi_private.h"
#include "lib/param/param.h" #include "lib/param/param.h"
@ -48,9 +48,9 @@ bool torture_libnetapi_init_context(struct torture_context *tctx,
} }
libnetapi_set_username(ctx, libnetapi_set_username(ctx,
cli_credentials_get_username(popt_get_cmdline_credentials())); cli_credentials_get_username(samba_cmdline_get_creds()));
libnetapi_set_password(ctx, libnetapi_set_password(ctx,
cli_credentials_get_password(popt_get_cmdline_credentials())); cli_credentials_get_password(samba_cmdline_get_creds()));
*ctx_p = ctx; *ctx_p = ctx;

View File

@ -5,7 +5,7 @@ bld.SAMBA_MODULE('TORTURE_LIBNETAPI',
autoproto='proto.h', autoproto='proto.h',
subsystem='smbtorture', subsystem='smbtorture',
init_function='torture_libnetapi_init', init_function='torture_libnetapi_init',
deps='POPT_CREDENTIALS netapi', deps='netapi',
internal_module=True, internal_module=True,
) )

View File

@ -21,7 +21,7 @@
#include "system/dir.h" #include "system/dir.h"
#include "torture/smbtorture.h" #include "torture/smbtorture.h"
#include "auth/credentials/credentials.h" #include "auth/credentials/credentials.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include <libsmbclient.h> #include <libsmbclient.h>
#include "torture/libsmbclient/proto.h" #include "torture/libsmbclient/proto.h"
#include "lib/param/loadparm.h" #include "lib/param/loadparm.h"
@ -49,11 +49,11 @@ static void auth_callback(const char *srv,
char *pw, int pwlen) char *pw, int pwlen)
{ {
const char *workgroup = const char *workgroup =
cli_credentials_get_domain(popt_get_cmdline_credentials()); cli_credentials_get_domain(samba_cmdline_get_creds());
const char *username = const char *username =
cli_credentials_get_username(popt_get_cmdline_credentials()); cli_credentials_get_username(samba_cmdline_get_creds());
const char *password = const char *password =
cli_credentials_get_password(popt_get_cmdline_credentials()); cli_credentials_get_password(samba_cmdline_get_creds());
ssize_t ret; ssize_t ret;
if (workgroup != NULL) { if (workgroup != NULL) {
@ -82,9 +82,9 @@ bool torture_libsmbclient_init_context(struct torture_context *tctx,
SMBCCTX **ctx_p) SMBCCTX **ctx_p)
{ {
const char *workgroup = const char *workgroup =
cli_credentials_get_domain(popt_get_cmdline_credentials()); cli_credentials_get_domain(samba_cmdline_get_creds());
const char *username = const char *username =
cli_credentials_get_username(popt_get_cmdline_credentials()); cli_credentials_get_username(samba_cmdline_get_creds());
const char *client_proto = const char *client_proto =
torture_setting_string(tctx, "clientprotocol", NULL); torture_setting_string(tctx, "clientprotocol", NULL);
SMBCCTX *ctx = NULL; SMBCCTX *ctx = NULL;

View File

@ -6,7 +6,7 @@ bld.SAMBA_MODULE('TORTURE_LIBSMBCLIENT',
autoproto='proto.h', autoproto='proto.h',
subsystem='smbtorture', subsystem='smbtorture',
init_function='torture_libsmbclient_init', init_function='torture_libsmbclient_init',
deps='POPT_CREDENTIALS smbclient', deps='smbclient',
internal_module=True internal_module=True
) )

View File

@ -31,7 +31,7 @@ TORTURE_LOCAL_SOURCE = '''../../../lib/util/charset/tests/iconv.c
fsrvp_state.c fsrvp_state.c
smbtorture_fullname.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', bld.SAMBA_MODULE('TORTURE_LOCAL',
source=TORTURE_LOCAL_SOURCE, source=TORTURE_LOCAL_SOURCE,

View File

@ -28,7 +28,7 @@
#include "libcli/composite/composite.h" #include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h" #include "libcli/smb_composite/smb_composite.h"
#include "librpc/gen_ndr/ndr_misc.h" #include "librpc/gen_ndr/ndr_misc.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "torture/util.h" #include "torture/util.h"
#include "param/param.h" #include "param/param.h"
#include "libcli/resolve/resolve.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.service_type = "A:";
io2.in.socket_options = lpcfg_socket_options(tctx->lp_ctx); 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.workgroup = lpcfg_workgroup(tctx->lp_ctx);
io2.in.filename = fname; io2.in.filename = fname;
lpcfg_smbcli_options(tctx->lp_ctx, &io2.in.options); 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.called_name = torture_setting_string(tctx, "host", NULL);
io1.in.service = torture_setting_string(tctx, "share", NULL); io1.in.service = torture_setting_string(tctx, "share", NULL);
io1.in.service_type = "A:"; 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.workgroup = lpcfg_workgroup(tctx->lp_ctx);
io1.in.level = RAW_QFS_OBJECTID_INFORMATION; io1.in.level = RAW_QFS_OBJECTID_INFORMATION;
io1.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx); io1.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);

View File

@ -21,7 +21,7 @@
#include "libcli/raw/libcliraw.h" #include "libcli/raw/libcliraw.h"
#include "libcli/raw/raw_proto.h" #include "libcli/raw/raw_proto.h"
#include "libcli/smb_composite/smb_composite.h" #include "libcli/smb_composite/smb_composite.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libcli/libcli.h" #include "libcli/libcli.h"
#include "torture/util.h" #include "torture/util.h"
#include "auth/credentials/credentials.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.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.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; setup.in.gensec_settings = gensec_settings;
status = smb_composite_sesssetup(session, &setup); 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.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.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); 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.capabilities &= ~CAP_EXTENDED_SECURITY; /* force a non extended security login (should fail) */
setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); 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); status = smb_composite_sesssetup(session3, &setup);
if (!NT_STATUS_EQUAL(status, NT_STATUS_LOGON_FAILURE)) { 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.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.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; setups[i].in.gensec_settings = gensec_settings;
sessions[i] = smbcli_session_init(cli->transport, tctx, false, options); 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.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities; setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); 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); setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
status = smb_composite_sesssetup(session1, &setup); status = smb_composite_sesssetup(session1, &setup);
CHECK_STATUS(status, NT_STATUS_OK); 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.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities; setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); 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); setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
status = smb_composite_sesssetup(session2, &setup); status = smb_composite_sesssetup(session2, &setup);
CHECK_STATUS(status, NT_STATUS_OK); 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.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.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.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); setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
status = smb_composite_sesssetup(session, &setup); status = smb_composite_sesssetup(session, &setup);

View File

@ -27,7 +27,7 @@
#include "torture/util.h" #include "torture/util.h"
#include "libcli/composite/composite.h" #include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_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 "param/param.h"
#include "torture/raw/proto.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.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities; setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = lpcfg_workgroup(tctx->lp_ctx); 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); setup.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
status = smb_composite_sesssetup(session, &setup); status = smb_composite_sesssetup(session, &setup);
CHECK_STATUS(status, NT_STATUS_OK); CHECK_STATUS(status, NT_STATUS_OK);

View File

@ -27,7 +27,7 @@
#include "libcli/libcli.h" #include "libcli/libcli.h"
#include "torture/util.h" #include "torture/util.h"
#include "lib/events/events.h" #include "lib/events/events.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libcli/composite/composite.h" #include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h" #include "libcli/smb_composite/smb_composite.h"
#include "libcli/resolve/resolve.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.called_name = state->called_name;
io->in.service = share; io->in.service = share;
io->in.service_type = state->service_type; 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.fallback_to_anonymous = false;
io->in.workgroup = lpcfg_workgroup(state->tctx->lp_ctx); io->in.workgroup = lpcfg_workgroup(state->tctx->lp_ctx);
lpcfg_smbcli_options(state->tctx->lp_ctx, &io->in.options); lpcfg_smbcli_options(state->tctx->lp_ctx, &io->in.options);

View File

@ -28,7 +28,7 @@
#include "libcli/libcli.h" #include "libcli/libcli.h"
#include "torture/util.h" #include "torture/util.h"
#include "lib/events/events.h" #include "lib/events/events.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libcli/composite/composite.h" #include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h" #include "libcli/smb_composite/smb_composite.h"
#include "libcli/resolve/resolve.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.called_name = state->called_name;
io->in.service = share; io->in.service = share;
io->in.service_type = state->service_type; 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.fallback_to_anonymous = false;
io->in.workgroup = lpcfg_workgroup(state->tctx->lp_ctx); io->in.workgroup = lpcfg_workgroup(state->tctx->lp_ctx);
io->in.gensec_settings = lpcfg_gensec_settings(state->mem_ctx, state->tctx->lp_ctx); io->in.gensec_settings = lpcfg_gensec_settings(state->mem_ctx, state->tctx->lp_ctx);

View File

@ -24,7 +24,7 @@
#include "torture/util.h" #include "torture/util.h"
#include "lib/events/events.h" #include "lib/events/events.h"
#include "param/param.h" #include "param/param.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libcli/resolve/resolve.h" #include "libcli/resolve/resolve.h"
#include "torture/raw/proto.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), lpcfg_smb_ports(tctx->lp_ctx),
torture_setting_string(tctx, "share", NULL), torture_setting_string(tctx, "share", NULL),
NULL, lpcfg_socket_options(tctx->lp_ctx), NULL, lpcfg_socket_options(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
tctx->ev, &options, &session_options, tctx->ev, &options, &session_options,
lpcfg_gensec_settings(tctx, tctx->lp_ctx)); lpcfg_gensec_settings(tctx, tctx->lp_ctx));

View File

@ -22,7 +22,7 @@
#include "libcli/libcli.h" #include "libcli/libcli.h"
#include "torture/raw/proto.h" #include "torture/raw/proto.h"
#include "smb_composite/smb_composite.h" #include "smb_composite/smb_composite.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "param/param.h" #include "param/param.h"
#include "torture/util.h" #include "torture/util.h"
#include "auth/credentials/credentials.h" #include "auth/credentials/credentials.h"
@ -63,7 +63,7 @@ static bool test_session_reauth1(struct torture_context *tctx,
ZERO_STRUCT(io); ZERO_STRUCT(io);
io.in.sesskey = cli->transport->negotiate.sesskey; io.in.sesskey = cli->transport->negotiate.sesskey;
io.in.capabilities = cli->transport->negotiate.capabilities; 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.workgroup = lpcfg_workgroup(tctx->lp_ctx);
io.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx); io.in.gensec_settings = lpcfg_gensec_settings(tctx, tctx->lp_ctx);
status = smb_composite_sesssetup(cli->session, &io); status = smb_composite_sesssetup(cli->session, &io);
@ -205,7 +205,7 @@ static bool test_session_reauth2(struct torture_context *tctx,
ZERO_STRUCT(io_sesssetup); ZERO_STRUCT(io_sesssetup);
io_sesssetup.in.sesskey = cli->transport->negotiate.sesskey; io_sesssetup.in.sesskey = cli->transport->negotiate.sesskey;
io_sesssetup.in.capabilities = cli->transport->negotiate.capabilities; 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.workgroup = lpcfg_workgroup(tctx->lp_ctx);
io_sesssetup.in.gensec_settings = lpcfg_gensec_settings( io_sesssetup.in.gensec_settings = lpcfg_gensec_settings(
tctx, tctx->lp_ctx); tctx, tctx->lp_ctx);
@ -244,7 +244,7 @@ static bool test_session_expire1(struct torture_context *tctx)
size_t i; size_t i;
use_kerberos = cli_credentials_get_kerberos_state( use_kerberos = cli_credentials_get_kerberos_state(
popt_get_cmdline_credentials()); samba_cmdline_get_creds());
if (use_kerberos != CRED_USE_KERBEROS_REQUIRED) { if (use_kerberos != CRED_USE_KERBEROS_REQUIRED) {
torture_warning(tctx, "smb2.session.expire1 requires -k yes!"); torture_warning(tctx, "smb2.session.expire1 requires -k yes!");
torture_skip(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), lpcfg_smb_ports(tctx->lp_ctx),
share, NULL, share, NULL,
lpcfg_socket_options(tctx->lp_ctx), lpcfg_socket_options(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
tctx->ev, &options, &session_options, tctx->ev, &options, &session_options,
lpcfg_gensec_settings(tctx, tctx->lp_ctx)); 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 * the krb5 library may not handle expired creds
* well, lets start with an empty ccache. * 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); 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.sesskey = cli->transport->negotiate.sesskey;
io_sesssetup.in.capabilities = cli->transport->negotiate.capabilities; io_sesssetup.in.capabilities = cli->transport->negotiate.capabilities;
io_sesssetup.in.capabilities |= CAP_DYNAMIC_REAUTH; 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.workgroup = lpcfg_workgroup(tctx->lp_ctx);
io_sesssetup.in.gensec_settings = lpcfg_gensec_settings(tctx, io_sesssetup.in.gensec_settings = lpcfg_gensec_settings(tctx,
tctx->lp_ctx); tctx->lp_ctx);
@ -359,7 +359,7 @@ static bool test_session_expire1(struct torture_context *tctx)
* well, lets start with an empty ccache. * well, lets start with an empty ccache.
*/ */
cli_credentials_invalidate_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"); torture_comment(tctx, "reauth with CAP_DYNAMIC_REAUTH => OK\n");
ZERO_STRUCT(io_sesssetup.out); 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 * the krb5 library may not handle expired creds
* well, lets start with an empty ccache. * 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); CRED_SPECIFIED);
/* /*

View File

@ -21,7 +21,7 @@
#include "libcli/libcli.h" #include "libcli/libcli.h"
#include "libcli/resolve/resolve.h" #include "libcli/resolve/resolve.h"
#include "torture/smbtorture.h" #include "torture/smbtorture.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "param/param.h" #include "param/param.h"
#include "system/filesys.h" #include "system/filesys.h"
@ -101,7 +101,7 @@ static int fork_tcon_client(struct torture_context *tctx,
status = smbcli_full_connection(NULL, &cli, status = smbcli_full_connection(NULL, &cli,
host, lpcfg_smb_ports(tctx->lp_ctx), share, host, lpcfg_smb_ports(tctx->lp_ctx), share,
NULL, lpcfg_socket_options(tctx->lp_ctx), NULL, lpcfg_socket_options(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
tctx->ev, &options, &session_options, tctx->ev, &options, &session_options,
lpcfg_gensec_settings(tctx, tctx->lp_ctx)); lpcfg_gensec_settings(tctx, tctx->lp_ctx));

View File

@ -22,7 +22,7 @@
#include "includes.h" #include "includes.h"
#include "librpc/gen_ndr/ndr_lsa.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" #include "torture/rpc/torture_rpc.h"
/* /*
@ -63,7 +63,7 @@ bool torture_async_bind(struct torture_context *torture)
if (table == NULL) return false; if (table == NULL) return false;
/* credentials */ /* credentials */
creds = popt_get_cmdline_credentials(); creds = samba_cmdline_get_creds();
/* send bind requests */ /* send bind requests */
for (i = 0; i < torture_numasync; i++) { for (i = 0; i < torture_numasync; i++) {

View File

@ -29,7 +29,7 @@
#include "librpc/gen_ndr/ndr_backupkey.h" #include "librpc/gen_ndr/ndr_backupkey.h"
#include "librpc/gen_ndr/ndr_lsa_c.h" #include "librpc/gen_ndr/ndr_lsa_c.h"
#include "librpc/gen_ndr/ndr_security.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 "libcli/auth/proto.h"
#include <system/network.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; struct dcerpc_binding_handle *b;
const char *domain = cli_credentials_get_domain( const char *domain = cli_credentials_get_domain(
popt_get_cmdline_credentials()); samba_cmdline_get_creds());
torture_assert_ntstatus_ok(tctx, torture_assert_ntstatus_ok(tctx,
torture_rpc_connection(tctx, &p2, &ndr_table_lsarpc), torture_rpc_connection(tctx, &p2, &ndr_table_lsarpc),
@ -646,7 +646,7 @@ static struct bkrp_BackupKey *createRestoreGUIDStruct(struct torture_context *tc
user = "guest"; user = "guest";
} else { } else {
user = cli_credentials_get_username( 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, torture_assert_ntstatus_ok(tctx,
dcerpc_pipe_connect_b(tctx, &lsa_p, dcerpc_pipe_connect_b(tctx, &lsa_p,
lsa_binding, &ndr_table_lsarpc, lsa_binding, &ndr_table_lsarpc,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
tctx->ev, tctx->lp_ctx), tctx->ev, tctx->lp_ctx),
"Opening LSA pipe"); "Opening LSA pipe");
lsa_b = lsa_p->binding_handle; 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 */ /* Not strictly correct all the time, but good enough for this test */
caller_sid = get_user_sid(tctx, tctx, caller_sid = get_user_sid(tctx, tctx,
cli_credentials_get_username( 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"); torture_assert_sid_equal(tctx, &rc4payload.sid, caller_sid, "Secret saved with wrong SID");

View File

@ -23,7 +23,7 @@
#include "torture/rpc/torture_rpc.h" #include "torture/rpc/torture_rpc.h"
#include "librpc/gen_ndr/ndr_lsa_c.h" #include "librpc/gen_ndr/ndr_lsa_c.h"
#include "librpc/gen_ndr/ndr_epmapper_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, static bool test_openpolicy(struct torture_context *tctx,
struct dcerpc_pipe *p) struct dcerpc_pipe *p)
@ -60,7 +60,7 @@ static bool test_bind(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, torture_assert_ntstatus_ok(tctx,
dcerpc_pipe_connect_b(tctx, &p, binding, dcerpc_pipe_connect_b(tctx, &p, binding,
&ndr_table_lsarpc, &ndr_table_lsarpc,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
tctx->ev, tctx->ev,
tctx->lp_ctx), tctx->lp_ctx),
"failed to connect pipe"); "failed to connect pipe");
@ -107,7 +107,7 @@ static bool test_assoc_group_handles_external(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, torture_assert_ntstatus_ok(tctx,
dcerpc_pipe_connect_b(tctx, &p1, binding1, dcerpc_pipe_connect_b(tctx, &p1, binding1,
&ndr_table_epmapper, &ndr_table_epmapper,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
tctx->ev, tctx->ev,
tctx->lp_ctx), tctx->lp_ctx),
"failed to connect first pipe"); "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, torture_assert_ntstatus_ok(tctx,
dcerpc_pipe_connect_b(tctx, &p2, binding2, dcerpc_pipe_connect_b(tctx, &p2, binding2,
&ndr_table_epmapper, &ndr_table_epmapper,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
tctx->ev, tctx->ev,
tctx->lp_ctx), tctx->lp_ctx),
"failed to connect second pipe"); "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, torture_assert_ntstatus_ok(tctx,
dcerpc_pipe_connect_b(tctx, &p2, binding2, dcerpc_pipe_connect_b(tctx, &p2, binding2,
&ndr_table_epmapper, &ndr_table_epmapper,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
tctx->ev, tctx->ev,
tctx->lp_ctx), tctx->lp_ctx),
"failed to connect second pipe"); "failed to connect second pipe");

View File

@ -25,7 +25,7 @@
#include "libnet/libnet.h" #include "libnet/libnet.h"
#include "torture/util.h" #include "torture/util.h"
#include "libcli/libcli.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_SHARENAME "smbtorture_dfs_share"
#define SMBTORTURE_DFS_DIRNAME "\\smbtorture_dfs_dir" #define SMBTORTURE_DFS_DIRNAME "\\smbtorture_dfs_dir"
@ -56,7 +56,7 @@ static bool test_NetShareAdd(struct torture_context *tctx,
return false; return false;
} }
libnetctx->cred = popt_get_cmdline_credentials(); libnetctx->cred = samba_cmdline_get_creds();
i.name = sharename; i.name = sharename;
i.type = STYPE_DISKTREE; i.type = STYPE_DISKTREE;
@ -95,7 +95,7 @@ static bool test_NetShareDel(struct torture_context *tctx,
return false; return false;
} }
libnetctx->cred = popt_get_cmdline_credentials(); libnetctx->cred = samba_cmdline_get_creds();
r.in.share_name = sharename; r.in.share_name = sharename;
r.in.server_name = host; r.in.server_name = host;

View File

@ -20,7 +20,7 @@
*/ */
#include "includes.h" #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_drsuapi_c.h"
#include "librpc/gen_ndr/ndr_drsblobs.h" #include "librpc/gen_ndr/ndr_drsblobs.h"
#include "libcli/cldap/cldap.h" #include "libcli/cldap/cldap.h"
@ -135,7 +135,7 @@ static struct DsGetinfoTest *test_create_context(struct torture_context *tctx)
} }
/* ctx->admin ...*/ /* 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 = &ctx->admin.drsuapi.our_bind_info28;
our_bind_info28->supported_extensions = 0xFFFFFFFF; our_bind_info28->supported_extensions = 0xFFFFFFFF;

View File

@ -44,7 +44,7 @@
#include "librpc/gen_ndr/ndr_security.h" #include "librpc/gen_ndr/ndr_security.h"
#include "librpc/gen_ndr/ndr_srvsvc_c.h" #include "librpc/gen_ndr/ndr_srvsvc_c.h"
#include "librpc/gen_ndr/ndr_fsrvp_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 FSHARE "fsrvp_share"
#define FNAME "testfss.dat" #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), lpcfg_smb_ports(tctx->lp_ctx),
FSHARE, FSHARE,
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree_base, &tree_base,
tctx->ev, tctx->ev,
&options, &options,
@ -551,7 +551,7 @@ static bool test_fsrvp_sc_share_io(struct torture_context *tctx,
lpcfg_smb_ports(tctx->lp_ctx), lpcfg_smb_ports(tctx->lp_ctx),
sc_map->ShadowCopyShareName, sc_map->ShadowCopyShareName,
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree_snap, &tree_snap,
tctx->ev, tctx->ev,
&options, &options,
@ -644,7 +644,7 @@ static bool test_fsrvp_enum_created(struct torture_context *tctx,
lpcfg_smb_ports(tctx->lp_ctx), lpcfg_smb_ports(tctx->lp_ctx),
FSHARE, FSHARE,
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree_base, &tree_base,
tctx->ev, tctx->ev,
&options, &options,
@ -916,7 +916,7 @@ static bool fsrvp_rpc_setup(struct torture_context *tctx, void **data)
struct torture_rpc_tcase_data *tcase_data; struct torture_rpc_tcase_data *tcase_data;
*data = tcase_data = talloc_zero(tctx, struct torture_rpc_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, status = torture_rpc_connection(tctx,
&(tcase_data->pipe), &(tcase_data->pipe),

View File

@ -38,7 +38,7 @@
#include "libcli/resolve/resolve.h" #include "libcli/resolve/resolve.h"
#include "libcli/smb2/smb2.h" #include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h" #include "libcli/smb2/smb2_calls.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "system/filesys.h" #include "system/filesys.h"
#include "lib/util/tftw.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), lpcfg_smb_ports(tctx->lp_ctx),
share_name, NULL, share_name, NULL,
lpcfg_socket_options(tctx->lp_ctx), lpcfg_socket_options(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
tctx->ev, tctx->ev,
&smb_options, &smb_options,

View File

@ -23,7 +23,7 @@
#include "torture/rpc/torture_rpc.h" #include "torture/rpc/torture_rpc.h"
#include "librpc/gen_ndr/ndr_mdssvc_c.h" #include "librpc/gen_ndr/ndr_mdssvc_c.h"
#include "param/param.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/dalloc.h"
#include "rpc_server/mdssvc/marshalling.h" #include "rpc_server/mdssvc/marshalling.h"

View File

@ -24,7 +24,7 @@
#include "includes.h" #include "includes.h"
#include "lib/events/events.h" #include "lib/events/events.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "torture/rpc/torture_rpc.h" #include "torture/rpc/torture_rpc.h"
#include "../lib/crypto/crypto.h" #include "../lib/crypto/crypto.h"
#include "libcli/auth/libcli_auth.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.server_name = NULL;
r.in.account_name = cli_credentials_get_username( r.in.account_name = cli_credentials_get_username(
popt_get_cmdline_credentials()); samba_cmdline_get_creds());
r.in.workstation = TEST_MACHINE_NAME; r.in.workstation = TEST_MACHINE_NAME;
r.out.info = &info; r.out.info = &info;
@ -130,7 +130,7 @@ static bool test_LogonUasLogoff(struct torture_context *tctx,
r.in.server_name = NULL; r.in.server_name = NULL;
r.in.account_name = cli_credentials_get_username( r.in.account_name = cli_credentials_get_username(
popt_get_cmdline_credentials()); samba_cmdline_get_creds());
r.in.workstation = TEST_MACHINE_NAME; r.in.workstation = TEST_MACHINE_NAME;
r.out.info = &info; 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; 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, tctx,
&ninfo.identity_info.account_name.string, &ninfo.identity_info.account_name.string,
&ninfo.identity_info.domain_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)); cli_credentials_get_domain(credentials));
status = cli_credentials_get_ntlm_response( status = cli_credentials_get_ntlm_response(
popt_get_cmdline_credentials(), tctx, samba_cmdline_get_creds(), tctx,
&flags, &flags,
chal, chal,
NULL, /* server_timestamp */ 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)); url = talloc_asprintf(tctx, "ldap://%s", dcerpc_server_name(p));
sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url, sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url,
NULL, NULL,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0); 0);
torture_assert(tctx, sam_ctx, "Connection to the SAMDB on DC failed!"); 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)); url = talloc_asprintf(tctx, "ldap://%s", dcerpc_server_name(p));
sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url, sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url,
NULL, NULL,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0); 0);
torture_assert(tctx, sam_ctx, "Connection to the SAMDB on DC failed!"); 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)); url = talloc_asprintf(tctx, "ldap://%s", dcerpc_server_name(p));
sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url, sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url,
NULL, NULL,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0); 0);
torture_assert(tctx, sam_ctx, "Connection to the SAMDB on DC failed!"); 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)); url = talloc_asprintf(tctx, "ldap://%s", dcerpc_server_name(p));
sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url, sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url,
NULL, NULL,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0); 0);
torture_assert(tctx, sam_ctx, "Connection to the SAMDB on DC failed!"); torture_assert(tctx, sam_ctx, "Connection to the SAMDB on DC failed!");

View File

@ -27,7 +27,7 @@
#include "auth/kerberos/kerberos.h" #include "auth/kerberos/kerberos.h"
#include "auth/credentials/credentials.h" #include "auth/credentials/credentials.h"
#include "auth/credentials/credentials_krb5.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 "torture/rpc/torture_rpc.h"
#include "libcli/auth/libcli_auth.h" #include "libcli/auth/libcli_auth.h"
#include "libcli/security/security.h" #include "libcli/security/security.h"
@ -234,7 +234,7 @@ static bool test_PACVerify(struct torture_context *tctx,
*/ */
client_creds = client_creds =
cli_credentials_shallow_copy(tmp_ctx, cli_credentials_shallow_copy(tmp_ctx,
popt_get_cmdline_credentials()); samba_cmdline_get_creds());
torture_assert(tctx, torture_assert(tctx,
client_creds, client_creds,
"Failed to copy of credentials"); "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. * we will get a new clean memory cache.
*/ */
client_creds = cli_credentials_shallow_copy(tmp_ctx, 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"); torture_assert(tctx, client_creds, "Failed to copy of credentials");
/* We use cli_credentials_get_ntlm_response(), so relax krb5 requirements. */ /* We use cli_credentials_get_ntlm_response(), so relax krb5 requirements. */
cli_credentials_set_kerberos_state(client_creds, 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", "Testing S4U2Proxy (secure_channel_type: %d, machine: %s, negotiate_flags: 0x%08x\n",
secure_channel_type, test_machine_name, negotiate_flags); 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"); torture_assert_not_null(tctx, impersonate_princ, "Failed to get impersonate client name");
server_creds = cli_credentials_shallow_copy(tctx, credentials); server_creds = cli_credentials_shallow_copy(tctx, credentials);
@ -1178,7 +1178,7 @@ static bool setup_constrained_delegation(struct torture_context *tctx,
int ret; int ret;
url = talloc_asprintf(tctx, "ldap://%s", dcerpc_server_name(p)); 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!"); 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", server_dn_str = samdb_search_string(sam_ctx, tctx, ldb_get_default_basedn(sam_ctx), "distinguishedName",

View File

@ -19,7 +19,7 @@
*/ */
#include "includes.h" #include "includes.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "torture/rpc/torture_rpc.h" #include "torture/rpc/torture_rpc.h"
#include "torture/smbtorture.h" #include "torture/smbtorture.h"
#include "librpc/ndr/ndr_table.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, status = dcerpc_pipe_connect_b(tctx,
p, binding, table, p, binding, table,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
tctx->ev, tctx->lp_ctx); tctx->ev, tctx->lp_ctx);
if (NT_STATUS_IS_ERR(status)) { 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, status = dcerpc_pipe_connect_b(tctx, p, binding, table,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
tctx->ev, tctx->lp_ctx); tctx->ev, tctx->lp_ctx);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
*p = NULL; *p = NULL;
@ -169,7 +169,7 @@ static bool torture_rpc_setup_machine_workstation(struct torture_context *tctx,
return false; return false;
*data = tcase_data = talloc_zero(tctx, struct torture_rpc_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();
tcase_data->join_ctx = torture_join_domain(tctx, tcase->machine_name, tcase_data->join_ctx = torture_join_domain(tctx, tcase->machine_name,
ACB_WSTRUST, ACB_WSTRUST,
&tcase_data->credentials); &tcase_data->credentials);
@ -201,7 +201,7 @@ static bool torture_rpc_setup_machine_bdc(struct torture_context *tctx,
return false; return false;
*data = tcase_data = talloc_zero(tctx, struct torture_rpc_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();
tcase_data->join_ctx = torture_join_domain(tctx, tcase->machine_name, tcase_data->join_ctx = torture_join_domain(tctx, tcase->machine_name,
ACB_SVRTRUST, ACB_SVRTRUST,
&tcase_data->credentials); &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; struct torture_rpc_tcase_data *tcase_data;
*data = tcase_data = talloc_zero(tctx, struct torture_rpc_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, status = torture_rpc_connection(tctx,
&(tcase_data->pipe), &(tcase_data->pipe),

View File

@ -32,7 +32,7 @@
#include "librpc/gen_ndr/ndr_winreg_c.h" #include "librpc/gen_ndr/ndr_winreg_c.h"
#include "librpc/gen_ndr/ndr_wkssvc_c.h" #include "librpc/gen_ndr/ndr_wkssvc_c.h"
#include "librpc/gen_ndr/ndr_svcctl_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 "torture/rpc/torture_rpc.h"
#include "libcli/libcli.h" #include "libcli/libcli.h"
#include "libcli/smb_composite/smb_composite.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), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", NULL, "IPC$", NULL,
lpcfg_socket_options(torture->lp_ctx), lpcfg_socket_options(torture->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
lpcfg_resolve_context(torture->lp_ctx), lpcfg_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options, torture->ev, &options, &session_options,
lpcfg_gensec_settings(torture, torture->lp_ctx)); 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), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", NULL, "IPC$", NULL,
lpcfg_socket_options(torture->lp_ctx), lpcfg_socket_options(torture->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
lpcfg_resolve_context(torture->lp_ctx), lpcfg_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options, torture->ev, &options, &session_options,
lpcfg_gensec_settings(torture, torture->lp_ctx)); lpcfg_gensec_settings(torture, torture->lp_ctx));
@ -443,16 +443,16 @@ static bool torture_bind_samba3(struct torture_context *torture)
ret = true; ret = true;
ret &= bindtest(torture, cli, popt_get_cmdline_credentials(), ret &= bindtest(torture, cli, samba_cmdline_get_creds(),
DCERPC_AUTH_TYPE_NTLMSSP, DCERPC_AUTH_TYPE_NTLMSSP,
DCERPC_AUTH_LEVEL_INTEGRITY); 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_TYPE_NTLMSSP,
DCERPC_AUTH_LEVEL_PRIVACY); 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_TYPE_SPNEGO,
DCERPC_AUTH_LEVEL_INTEGRITY); 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_TYPE_SPNEGO,
DCERPC_AUTH_LEVEL_PRIVACY); DCERPC_AUTH_LEVEL_PRIVACY);
@ -1379,7 +1379,7 @@ static bool torture_netlogon_samba3(struct torture_context *torture)
lpcfg_smb_ports(torture->lp_ctx), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", NULL, "IPC$", NULL,
lpcfg_socket_options(torture->lp_ctx), lpcfg_socket_options(torture->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
lpcfg_resolve_context(torture->lp_ctx), lpcfg_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options, torture->ev, &options, &session_options,
lpcfg_gensec_settings(torture, torture->lp_ctx)); lpcfg_gensec_settings(torture, torture->lp_ctx));
@ -1403,7 +1403,7 @@ static bool torture_netlogon_samba3(struct torture_context *torture)
"join failed"); "join failed");
cli_credentials_set_domain( cli_credentials_set_domain(
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
cli_credentials_get_domain(wks_creds), cli_credentials_get_domain(wks_creds),
CRED_SPECIFIED); CRED_SPECIFIED);
@ -1422,7 +1422,7 @@ static bool torture_netlogon_samba3(struct torture_context *torture)
for (j=0; j<2; j++) { for (j=0; j<2; j++) {
torture_assert(torture, torture_assert(torture,
schan(torture, cli, wks_creds, schan(torture, cli, wks_creds,
popt_get_cmdline_credentials()), samba_cmdline_get_creds()),
"schan failed"); "schan failed");
} }
} }
@ -1480,7 +1480,7 @@ static bool test_join3(struct torture_context *tctx,
"join failed"); "join failed");
cli_credentials_set_domain( cli_credentials_set_domain(
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
cli_credentials_get_domain(wks_creds), cli_credentials_get_domain(wks_creds),
CRED_SPECIFIED); CRED_SPECIFIED);
@ -1530,7 +1530,7 @@ static bool torture_samba3_sessionkey(struct torture_context *torture)
} }
torture_assert(torture, torture_assert(torture,
test_join3(torture, false, popt_get_cmdline_credentials(), test_join3(torture, false, samba_cmdline_get_creds(),
NULL, wks_name), NULL, wks_name),
"join using anonymous bind on an authenticated smb connection failed"); "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, torture_assert(torture,
test_join3(torture, true, popt_get_cmdline_credentials(), test_join3(torture, true, samba_cmdline_get_creds(),
NULL, wks_name), NULL, wks_name),
"join using anonymous bind on an authenticated smb connection failed"); "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), torture, &cli, torture_setting_string(torture, "host", NULL),
lpcfg_smb_ports(torture->lp_ctx), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", NULL, lpcfg_socket_options(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, lpcfg_resolve_context(torture->lp_ctx), torture->ev, &options,
&session_options, lpcfg_gensec_settings(torture, torture->lp_ctx)); &session_options, lpcfg_gensec_settings(torture, torture->lp_ctx));
torture_assert_ntstatus_ok(torture, status, "smbcli_full_connection failed\n"); 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( userlevel1.client = talloc_asprintf(
torture, "\\\\%s", lpcfg_netbios_name(torture->lp_ctx)); torture, "\\\\%s", lpcfg_netbios_name(torture->lp_ctx));
userlevel1.user = cli_credentials_get_username( userlevel1.user = cli_credentials_get_username(
popt_get_cmdline_credentials()); samba_cmdline_get_creds());
userlevel1.build = 2600; userlevel1.build = 2600;
userlevel1.major = 3; userlevel1.major = 3;
userlevel1.minor = 0; userlevel1.minor = 0;
@ -3418,7 +3418,7 @@ static bool torture_rpc_smb_reauth1(struct torture_context *torture)
lpcfg_smb_ports(torture->lp_ctx), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", NULL, "IPC$", NULL,
lpcfg_socket_options(torture->lp_ctx), lpcfg_socket_options(torture->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
lpcfg_resolve_context(torture->lp_ctx), lpcfg_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options, torture->ev, &options, &session_options,
lpcfg_gensec_settings(torture, torture->lp_ctx)); lpcfg_gensec_settings(torture, torture->lp_ctx));
@ -3503,7 +3503,7 @@ static bool torture_rpc_smb_reauth1(struct torture_context *torture)
ZERO_STRUCT(io); ZERO_STRUCT(io);
io.in.sesskey = cli->transport->negotiate.sesskey; io.in.sesskey = cli->transport->negotiate.sesskey;
io.in.capabilities = cli->transport->negotiate.capabilities; 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.workgroup = lpcfg_workgroup(torture->lp_ctx);
io.in.gensec_settings = lpcfg_gensec_settings(torture, 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), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", NULL, "IPC$", NULL,
lpcfg_socket_options(torture->lp_ctx), lpcfg_socket_options(torture->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
lpcfg_resolve_context(torture->lp_ctx), lpcfg_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options, torture->ev, &options, &session_options,
lpcfg_gensec_settings(torture, torture->lp_ctx)); lpcfg_gensec_settings(torture, torture->lp_ctx));
@ -3640,7 +3640,7 @@ static bool torture_rpc_smb_reauth2(struct torture_context *torture)
ZERO_STRUCT(io); ZERO_STRUCT(io);
io.in.sesskey = cli->transport->negotiate.sesskey; io.in.sesskey = cli->transport->negotiate.sesskey;
io.in.capabilities = cli->transport->negotiate.capabilities; 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.workgroup = lpcfg_workgroup(torture->lp_ctx);
io.in.gensec_settings = lpcfg_gensec_settings(torture, 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), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", "IPC$",
lpcfg_resolve_context(torture->lp_ctx), lpcfg_resolve_context(torture->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree, &tree,
torture->ev, torture->ev,
&options, &options,
@ -3791,7 +3791,7 @@ static bool torture_rpc_smb2_reauth1(struct torture_context *torture)
/* smb re-auth again to the original user */ /* smb re-auth again to the original user */
status = smb2_session_setup_spnego(tree->session, status = smb2_session_setup_spnego(tree->session,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0 /* previous_session_id */); 0 /* previous_session_id */);
torture_assert_ntstatus_ok_goto(torture, status, ret, done, torture_assert_ntstatus_ok_goto(torture, status, ret, done,
"session reauth to anon failed"); "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), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", "IPC$",
lpcfg_resolve_context(torture->lp_ctx), lpcfg_resolve_context(torture->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree, &tree,
torture->ev, torture->ev,
&options, &options,
@ -3919,7 +3919,7 @@ static bool torture_rpc_smb2_reauth2(struct torture_context *torture)
/* smb re-auth again to the original user */ /* smb re-auth again to the original user */
status = smb2_session_setup_spnego(tree->session, status = smb2_session_setup_spnego(tree->session,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0 /* previous_session_id */); 0 /* previous_session_id */);
torture_assert_ntstatus_ok_goto(torture, status, ret, done, torture_assert_ntstatus_ok_goto(torture, status, ret, done,
"session reauth to anon failed"); "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), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", NULL, "IPC$", NULL,
lpcfg_socket_options(torture->lp_ctx), lpcfg_socket_options(torture->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
lpcfg_resolve_context(torture->lp_ctx), lpcfg_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options, torture->ev, &options, &session_options,
lpcfg_gensec_settings(torture, torture->lp_ctx)); 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), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", "IPC$",
lpcfg_resolve_context(torture->lp_ctx), lpcfg_resolve_context(torture->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree, &tree,
torture->ev, torture->ev,
&options, &options,
@ -4321,7 +4321,7 @@ static bool torture_rpc_smb2_pipe_read_close(struct torture_context *torture)
lpcfg_smb_ports(torture->lp_ctx), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", "IPC$",
lpcfg_resolve_context(torture->lp_ctx), lpcfg_resolve_context(torture->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree, &tree,
torture->ev, torture->ev,
&options, &options,
@ -4405,7 +4405,7 @@ static bool torture_rpc_smb2_pipe_read_tdis(struct torture_context *torture)
lpcfg_smb_ports(torture->lp_ctx), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", "IPC$",
lpcfg_resolve_context(torture->lp_ctx), lpcfg_resolve_context(torture->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree, &tree,
torture->ev, torture->ev,
&options, &options,
@ -4489,7 +4489,7 @@ static bool torture_rpc_smb2_pipe_read_logoff(struct torture_context *torture)
lpcfg_smb_ports(torture->lp_ctx), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", "IPC$",
lpcfg_resolve_context(torture->lp_ctx), lpcfg_resolve_context(torture->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree, &tree,
torture->ev, torture->ev,
&options, &options,
@ -4568,7 +4568,7 @@ static bool torture_rpc_lsa_over_netlogon(struct torture_context *torture)
lpcfg_smb_ports(torture->lp_ctx), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", "IPC$",
lpcfg_resolve_context(torture->lp_ctx), lpcfg_resolve_context(torture->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree, &tree,
torture->ev, torture->ev,
&options, &options,
@ -4639,7 +4639,7 @@ static bool torture_rpc_pipes_supported_interfaces(
lpcfg_smb_ports(torture->lp_ctx), lpcfg_smb_ports(torture->lp_ctx),
"IPC$", "IPC$",
lpcfg_resolve_context(torture->lp_ctx), lpcfg_resolve_context(torture->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree, &tree,
torture->ev, torture->ev,
&options, &options,

View File

@ -25,7 +25,7 @@
#include "librpc/gen_ndr/ndr_netlogon.h" #include "librpc/gen_ndr/ndr_netlogon.h"
#include "librpc/gen_ndr/ndr_netlogon_c.h" #include "librpc/gen_ndr/ndr_netlogon_c.h"
#include "librpc/gen_ndr/ndr_samr_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 "torture/rpc/torture_rpc.h"
#include "auth/gensec/gensec.h" #include "auth/gensec/gensec.h"
#include "libcli/auth/libcli_auth.h" #include "libcli/auth/libcli_auth.h"
@ -1838,11 +1838,11 @@ bool torture_rpc_samlogon(struct torture_context *torture)
{ {
.comment = "domain\\user", .comment = "domain\\user",
.domain = cli_credentials_get_domain( .domain = cli_credentials_get_domain(
popt_get_cmdline_credentials()), samba_cmdline_get_creds()),
.username = cli_credentials_get_username( .username = cli_credentials_get_username(
popt_get_cmdline_credentials()), samba_cmdline_get_creds()),
.password = cli_credentials_get_password( .password = cli_credentials_get_password(
popt_get_cmdline_credentials()), samba_cmdline_get_creds()),
.network_login = true, .network_login = true,
.expected_interactive_error = NT_STATUS_OK, .expected_interactive_error = NT_STATUS_OK,
.expected_network_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", .comment = "realm\\user",
.domain = cli_credentials_get_realm( .domain = cli_credentials_get_realm(
popt_get_cmdline_credentials()), samba_cmdline_get_creds()),
.username = cli_credentials_get_username( .username = cli_credentials_get_username(
popt_get_cmdline_credentials()), samba_cmdline_get_creds()),
.password = cli_credentials_get_password( .password = cli_credentials_get_password(
popt_get_cmdline_credentials()), samba_cmdline_get_creds()),
.network_login = true, .network_login = true,
.expected_interactive_error = NT_STATUS_OK, .expected_interactive_error = NT_STATUS_OK,
.expected_network_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, .username = talloc_asprintf(mem_ctx,
"%s@%s", "%s@%s",
cli_credentials_get_username( cli_credentials_get_username(
popt_get_cmdline_credentials()), samba_cmdline_get_creds()),
cli_credentials_get_domain( cli_credentials_get_domain(
popt_get_cmdline_credentials()) samba_cmdline_get_creds())
), ),
.password = cli_credentials_get_password( .password = cli_credentials_get_password(
popt_get_cmdline_credentials()), samba_cmdline_get_creds()),
.network_login = false, /* works for some things, but not NTLMv2. Odd */ .network_login = false, /* works for some things, but not NTLMv2. Odd */
.expected_interactive_error = NT_STATUS_OK, .expected_interactive_error = NT_STATUS_OK,
.expected_network_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, .username = talloc_asprintf(mem_ctx,
"%s@%s", "%s@%s",
cli_credentials_get_username( cli_credentials_get_username(
popt_get_cmdline_credentials()), samba_cmdline_get_creds()),
cli_credentials_get_realm( cli_credentials_get_realm(
popt_get_cmdline_credentials()) samba_cmdline_get_creds())
), ),
.password = cli_credentials_get_password( .password = cli_credentials_get_password(
popt_get_cmdline_credentials()), samba_cmdline_get_creds()),
.network_login = true, .network_login = true,
.expected_interactive_error = NT_STATUS_OK, .expected_interactive_error = NT_STATUS_OK,
.expected_network_error = NT_STATUS_OK, .expected_network_error = NT_STATUS_OK,

View File

@ -26,7 +26,7 @@
#include "auth/credentials/credentials.h" #include "auth/credentials/credentials.h"
#include "auth/credentials/credentials_krb5.h" #include "auth/credentials/credentials_krb5.h"
#include "torture/rpc/torture_rpc.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/schannel.h"
#include "libcli/auth/libcli_auth.h" #include "libcli/auth/libcli_auth.h"
#include "libcli/security/security.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; 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, tctx,
&ninfo.identity_info.account_name.string, &ninfo.identity_info.account_name.string,
&ninfo.identity_info.domain_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)); cli_credentials_get_domain(credentials));
status = cli_credentials_get_ntlm_response( status = cli_credentials_get_ntlm_response(
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
tctx, tctx,
&flags, &flags,
chal, 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->conns = talloc_zero_array(s, struct torture_schannel_bench_conn, s->nprocs);
s->user1_creds = cli_credentials_shallow_copy(s, 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); tmp = torture_setting_string(s->tctx, "extra_user1", NULL);
if (tmp) { if (tmp) {
cli_credentials_parse_string(s->user1_creds, tmp, CRED_SPECIFIED); cli_credentials_parse_string(s->user1_creds, tmp, CRED_SPECIFIED);
} }
s->user2_creds = cli_credentials_shallow_copy(s, 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); tmp = torture_setting_string(s->tctx, "extra_user2", NULL);
if (tmp) { if (tmp) {
cli_credentials_parse_string(s->user1_creds, tmp, CRED_SPECIFIED); cli_credentials_parse_string(s->user1_creds, tmp, CRED_SPECIFIED);

View File

@ -24,7 +24,7 @@
#include "libcli/auth/libcli_auth.h" #include "libcli/auth/libcli_auth.h"
#include "torture/rpc/torture_rpc.h" #include "torture/rpc/torture_rpc.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "param/param.h" #include "param/param.h"
static void init_lsa_String(struct lsa_String *name, const char *s) 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, status = dcerpc_pipe_connect_b(torture, &p, binding,
&ndr_table_lsarpc, &ndr_table_lsarpc,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
torture->ev, torture->ev,
torture->lp_ctx); torture->lp_ctx);

View File

@ -37,7 +37,7 @@
#include "libcli/resolve/resolve.h" #include "libcli/resolve/resolve.h"
#include "libcli/smb2/smb2.h" #include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h" #include "libcli/smb2/smb2_calls.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "system/filesys.h" #include "system/filesys.h"
#include "torture/ndr/ndr.h" #include "torture/ndr/ndr.h"
#include "torture/smb2/proto.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), lpcfg_smb_ports(tctx->lp_ctx),
share, share,
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree, &tree,
tctx->ev, tctx->ev,
&options, &options,
@ -10785,7 +10785,7 @@ static bool connect_printer_driver_share(struct torture_context *tctx,
lpcfg_smb_ports(tctx->lp_ctx), lpcfg_smb_ports(tctx->lp_ctx),
share_name, NULL, share_name, NULL,
lpcfg_socket_options(tctx->lp_ctx), lpcfg_socket_options(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
tctx->ev, tctx->ev,
&smb_options, &smb_options,

View File

@ -29,7 +29,7 @@
#include "libcli/security/security.h" #include "libcli/security/security.h"
#include "torture/rpc/torture_rpc.h" #include "torture/rpc/torture_rpc.h"
#include "param/param.h" #include "param/param.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#define TORTURE_USER "torture_user" #define TORTURE_USER "torture_user"
#define TORTURE_USER_ADMINGROUP "torture_user_544" #define TORTURE_USER_ADMINGROUP "torture_user_544"

View File

@ -27,7 +27,7 @@
#include "includes.h" #include "includes.h"
#include "system/time.h" #include "system/time.h"
#include "libnet/libnet.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_lsa_c.h"
#include "librpc/gen_ndr/ndr_samr_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, &join->p,
dc_binding, dc_binding,
&ndr_table_samr, &ndr_table_samr,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
NULL, tctx->lp_ctx); NULL, tctx->lp_ctx);
} else { } else {
@ -553,7 +553,7 @@ _PUBLIC_ struct test_join *torture_join_domain(struct torture_context *tctx,
tj->libnet_r = libnet_r; 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); libnet_r->in.binding = dcerpc_binding_string(libnet_r, binding);
if (libnet_r->in.binding == NULL) { if (libnet_r->in.binding == NULL) {
talloc_free(tj); talloc_free(tj);
@ -701,8 +701,8 @@ static NTSTATUS torture_leave_ads_domain(struct torture_context *torture,
return NT_STATUS_NO_MEMORY; return NT_STATUS_NO_MEMORY;
} }
ldb_set_opaque(ldb_ctx, "credentials", popt_get_cmdline_credentials()); ldb_set_opaque(ldb_ctx, "credentials", samba_cmdline_get_creds());
ldb_set_opaque(ldb_ctx, "loadparm", cmdline_lp_ctx); ldb_set_opaque(ldb_ctx, "loadparm", samba_cmdline_get_lp_ctx());
rtn = ldb_connect(ldb_ctx, remote_ldb_url, 0, NULL); rtn = ldb_connect(ldb_ctx, remote_ldb_url, 0, NULL);
if (rtn != LDB_SUCCESS) { if (rtn != LDB_SUCCESS) {

View File

@ -26,7 +26,7 @@
#include "librpc/gen_ndr/ndr_clusapi_c.h" #include "librpc/gen_ndr/ndr_clusapi_c.h"
#include "param/param.h" #include "param/param.h"
#include <tevent.h> #include <tevent.h>
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
struct torture_test_clusapi_state { struct torture_test_clusapi_state {
struct dcerpc_pipe *p; struct dcerpc_pipe *p;
@ -538,7 +538,7 @@ static bool setup_clusapi_connection(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, torture_assert_ntstatus_ok(tctx,
dcerpc_pipe_connect_b(tctx, &s->clusapi.p, binding, dcerpc_pipe_connect_b(tctx, &s->clusapi.p, binding,
&ndr_table_clusapi, &ndr_table_clusapi,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
tctx->ev, tctx->lp_ctx), tctx->ev, tctx->lp_ctx),
"failed to connect dcerpc pipe"); "failed to connect dcerpc pipe");

View File

@ -23,7 +23,7 @@
#include "torture/torture.h" #include "torture/torture.h"
#include "librpc/gen_ndr/ndr_wkssvc_c.h" #include "librpc/gen_ndr/ndr_wkssvc_c.h"
#include "torture/rpc/torture_rpc.h" #include "torture/rpc/torture_rpc.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "param/param.h" #include "param/param.h"
#include "libcli/auth/libcli_auth.h" #include "libcli/auth/libcli_auth.h"
@ -217,7 +217,7 @@ static bool test_NetrWkstaUserGetInfo(struct torture_context *tctx,
struct wkssvc_NetrWkstaUserGetInfo r; struct wkssvc_NetrWkstaUserGetInfo r;
union wkssvc_NetrWkstaUserInfo info; union wkssvc_NetrWkstaUserInfo info;
const char *dom = lpcfg_workgroup(tctx->lp_ctx); 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); const char *user = cli_credentials_get_username(creds);
int i; int i;
struct dcerpc_binding_handle *b = p->binding_handle; struct dcerpc_binding_handle *b = p->binding_handle;
@ -1123,7 +1123,7 @@ static bool test_NetrUnjoinDomain(struct torture_context *tctx,
{ {
NTSTATUS status; NTSTATUS status;
struct wkssvc_NetrUnjoinDomain r; 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 *user = cli_credentials_get_username(creds);
const char *admin_account = NULL; const char *admin_account = NULL;
struct dcerpc_binding_handle *b = p->binding_handle; struct dcerpc_binding_handle *b = p->binding_handle;
@ -1152,7 +1152,7 @@ static bool test_NetrJoinDomain(struct torture_context *tctx,
{ {
NTSTATUS status; NTSTATUS status;
struct wkssvc_NetrJoinDomain r; 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 *user = cli_credentials_get_username(creds);
const char *admin_account = NULL; const char *admin_account = NULL;
struct dcerpc_binding_handle *b = p->binding_handle; struct dcerpc_binding_handle *b = p->binding_handle;

View File

@ -22,7 +22,7 @@
#include "includes.h" #include "includes.h"
#include "system/readline.h" #include "system/readline.h"
#include "../libcli/smbreadline/smbreadline.h" #include "../libcli/smbreadline/smbreadline.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "auth/credentials/credentials.h" #include "auth/credentials/credentials.h"
#include "torture/smbtorture.h" #include "torture/smbtorture.h"
#include "param/param.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" * stops the credentials system prompting when we use the "auth"
* command to display the current auth parameters. * 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); "", CRED_GUESS_ENV);
while (1) { while (1) {
@ -228,13 +228,13 @@ static void shell_auth(const struct shell_command * command,
const char * principal; const char * principal;
username = cli_credentials_get_username( username = cli_credentials_get_username(
popt_get_cmdline_credentials()); samba_cmdline_get_creds());
principal = cli_credentials_get_principal( principal = cli_credentials_get_principal(
popt_get_cmdline_credentials(), tctx); samba_cmdline_get_creds(), tctx);
domain = cli_credentials_get_domain(popt_get_cmdline_credentials()); domain = cli_credentials_get_domain(samba_cmdline_get_creds());
realm = cli_credentials_get_realm(popt_get_cmdline_credentials()); realm = cli_credentials_get_realm(samba_cmdline_get_creds());
password = cli_credentials_get_password( password = cli_credentials_get_password(
popt_get_cmdline_credentials()); samba_cmdline_get_creds());
printf("Username: %s\n", username ? username : ""); printf("Username: %s\n", username ? username : "");
printf("User Principal: %s\n", principal ? principal : ""); 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")) { if (!strcmp(argv[0], "username")) {
result = cli_credentials_set_username( result = cli_credentials_set_username(
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
argv[1], CRED_SPECIFIED); argv[1], CRED_SPECIFIED);
} else if (!strcmp(argv[0], "principal")) { } else if (!strcmp(argv[0], "principal")) {
result = cli_credentials_set_principal( result = cli_credentials_set_principal(
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
argv[1], CRED_SPECIFIED); argv[1], CRED_SPECIFIED);
} else if (!strcmp(argv[0], "domain")) { } else if (!strcmp(argv[0], "domain")) {
result = cli_credentials_set_domain( result = cli_credentials_set_domain(
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
argv[1], CRED_SPECIFIED); argv[1], CRED_SPECIFIED);
} else if (!strcmp(argv[0], "realm")) { } else if (!strcmp(argv[0], "realm")) {
result = cli_credentials_set_realm( result = cli_credentials_set_realm(
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
argv[1], CRED_SPECIFIED); argv[1], CRED_SPECIFIED);
} else if (!strcmp(argv[0], "password")) { } else if (!strcmp(argv[0], "password")) {
result = cli_credentials_set_password( result = cli_credentials_set_password(
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
argv[1], CRED_SPECIFIED); argv[1], CRED_SPECIFIED);
} else { } else {
shell_usage(command); shell_usage(command);

View File

@ -20,7 +20,7 @@
*/ */
#include "includes.h" #include "includes.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libcli/smb2/smb2.h" #include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h" #include "libcli/smb2/smb2_calls.h"
#include "libcli/smb/smbXcli_base.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), lpcfg_smb_ports(tctx->lp_ctx),
share, share,
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0, 0,
tree, tree,
tctx->ev, tctx->ev,

View File

@ -30,7 +30,7 @@
#include "system/filesys.h" #include "system/filesys.h"
#include "auth/credentials/credentials.h" #include "auth/credentials/credentials.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "librpc/gen_ndr/security.h" #include "librpc/gen_ndr/security.h"
#include "lib/events/events.h" #include "lib/events/events.h"

View File

@ -28,7 +28,7 @@
#include "librpc/gen_ndr/ndr_security.h" #include "librpc/gen_ndr/ndr_security.h"
#include "librpc/gen_ndr/ndr_ioctl.h" #include "librpc/gen_ndr/ndr_ioctl.h"
#include "../libcli/smb/smbXcli_base.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/security/security.h"
#include "libcli/resolve/resolve.h" #include "libcli/resolve/resolve.h"
#include "lib/param/param.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 *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx); TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_handle _h; 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 *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx); TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_handle _h; 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 *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx); TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct test_multichannel_oplock_break_state state = { 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 *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx); TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct test_multichannel_oplock_break_state state = { 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 *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx); TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_handle _h; 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 *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx); TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_handle _h; 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 *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx); TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_handle _h; 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 *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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); TALLOC_CTX *mem_ctx = talloc_new(tctx);
bool ret = true; bool ret = true;
struct smb2_tree **tree2 = NULL; 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, torture_assert_ntstatus_equal_goto(tctx,
smb2_session_setup_spnego(session2[i], smb2_session_setup_spnego(session2[i],
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0 /* previous_session_id */), 0 /* previous_session_id */),
expected_status, expected_status,
ret, done, 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 *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx); TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct test_multichannel_lease_break_state state = { struct test_multichannel_lease_break_state state = {

View File

@ -33,7 +33,7 @@
#include "system/filesys.h" #include "system/filesys.h"
#include "auth/credentials/credentials.h" #include "auth/credentials/credentials.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "librpc/gen_ndr/security.h" #include "librpc/gen_ndr/security.h"
#include "lib/events/events.h" #include "lib/events/events.h"

View File

@ -34,7 +34,7 @@
#include "system/filesys.h" #include "system/filesys.h"
#include "auth/credentials/credentials.h" #include "auth/credentials/credentials.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "librpc/gen_ndr/security.h" #include "librpc/gen_ndr/security.h"
#include "lib/events/events.h" #include "lib/events/events.h"

View File

@ -28,7 +28,7 @@
#include "libcli/resolve/resolve.h" #include "libcli/resolve/resolve.h"
#include "libcli/smb/smbXcli_base.h" #include "libcli/smb/smbXcli_base.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "lib/events/events.h" #include "lib/events/events.h"
#include "param/param.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, status = smb2_connect(tctx, host,
lpcfg_smb_ports(tctx->lp_ctx), share, lpcfg_smb_ports(tctx->lp_ctx), share,
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
tree, tctx->ev, &options, tree, tctx->ev, &options,
lpcfg_socket_options(tctx->lp_ctx), lpcfg_socket_options(tctx->lp_ctx),
lpcfg_gensec_settings(tctx, tctx->lp_ctx)); lpcfg_gensec_settings(tctx, tctx->lp_ctx));

View File

@ -26,7 +26,7 @@
#include "torture/torture.h" #include "torture/torture.h"
#include "torture/smb2/proto.h" #include "torture/smb2/proto.h"
#include "../libcli/smb/smbXcli_base.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.h"
#include "libcli/security/security.h" #include "libcli/security/security.h"
#include "libcli/resolve/resolve.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 *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx); TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_handle _h1; 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 *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx); TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_handle _h1; 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), lpcfg_smb_ports(tctx->lp_ctx),
share, share,
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree2, &tree2,
tctx->ev, tctx->ev,
&transport1->options, &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"); torture_assert(tctx, session1_2 != NULL, "smb2_session_channel failed");
status = smb2_session_setup_spnego(session1_2, status = smb2_session_setup_spnego(session1_2,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0 /* previous_session_id */); 0 /* previous_session_id */);
CHECK_STATUS(status, NT_STATUS_OK); 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), lpcfg_smb_ports(tctx->lp_ctx),
share, share,
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree2, &tree2,
tctx->ev, tctx->ev,
&transport1->options, &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"); torture_assert(tctx, session1_2 != NULL, "smb2_session_channel failed");
status = smb2_session_setup_spnego(session1_2, status = smb2_session_setup_spnego(session1_2,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0 /* previous_session_id */); 0 /* previous_session_id */);
CHECK_STATUS(status, NT_STATUS_OK); CHECK_STATUS(status, NT_STATUS_OK);

View File

@ -22,7 +22,7 @@
#include "includes.h" #include "includes.h"
#include "libcli/smb2/smb2.h" #include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h" #include "libcli/smb2/smb2_calls.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "torture/torture.h" #include "torture/torture.h"
#include "param/param.h" #include "param/param.h"
#include "libcli/resolve/resolve.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), lpcfg_smb_ports(tctx->lp_ctx),
share, share,
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree, tctx->ev, &options, &tree, tctx->ev, &options,
lpcfg_socket_options(tctx->lp_ctx), lpcfg_socket_options(tctx->lp_ctx),
lpcfg_gensec_settings(tctx, 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), lpcfg_smb_ports(tctx->lp_ctx),
share, share,
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
&tree, tctx->ev, &options, &tree, tctx->ev, &options,
lpcfg_socket_options(tctx->lp_ctx), lpcfg_socket_options(tctx->lp_ctx),
lpcfg_gensec_settings(mem_ctx, tctx->lp_ctx)); lpcfg_gensec_settings(mem_ctx, tctx->lp_ctx));

View File

@ -26,7 +26,7 @@
#include "torture/util.h" #include "torture/util.h"
#include "torture/smb2/proto.h" #include "torture/smb2/proto.h"
#include "../libcli/smb/smbXcli_base.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.h"
#include "auth/credentials/credentials_krb5.h" #include "auth/credentials/credentials_krb5.h"
#include "libcli/security/security.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"); "oplock_level incorrect");
status = smb2_session_setup_spnego(tree->session, status = smb2_session_setup_spnego(tree->session,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0 /* previous_session_id */); 0 /* previous_session_id */);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done, torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"smb2_session_setup_spnego failed"); "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"); "smb2_getinfo_file failed");
status = smb2_session_setup_spnego(tree->session, status = smb2_session_setup_spnego(tree->session,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0 /* previous_session_id */); 0 /* previous_session_id */);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done, torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"smb2_session_setup_spnego failed"); "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 */ /* re-authenticate as original user again */
status = smb2_session_setup_spnego(tree->session, status = smb2_session_setup_spnego(tree->session,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0 /* previous_session_id */); 0 /* previous_session_id */);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done, torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"smb2_session_setup_spnego failed"); "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 */ /* re-authenticate as original user again */
status = smb2_session_setup_spnego(tree->session, status = smb2_session_setup_spnego(tree->session,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0 /* previous_session_id */); 0 /* previous_session_id */);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done, torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"smb2_session_setup_spnego failed"); "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 */ /* re-authenticate as original user again */
status = smb2_session_setup_spnego(tree->session, status = smb2_session_setup_spnego(tree->session,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0 /* previous_session_id */); 0 /* previous_session_id */);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done, torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"smb2_session_setup_spnego failed"); "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 */ /* re-authenticate as original user again */
status = smb2_session_setup_spnego(tree->session, status = smb2_session_setup_spnego(tree->session,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0 /* previous_session_id */); 0 /* previous_session_id */);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done, torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"smb2_session_setup_spnego failed"); "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 */ /* re-authenticate as original user - again */
status = smb2_session_setup_spnego(tree->session, status = smb2_session_setup_spnego(tree->session,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0 /* previous_session_id */); 0 /* previous_session_id */);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done, torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"smb2_session_setup_spnego failed"); "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; enum credentials_use_kerberos krb_state;
krb_state = cli_credentials_get_kerberos_state( krb_state = cli_credentials_get_kerberos_state(
popt_get_cmdline_credentials()); samba_cmdline_get_creds());
if (krb_state == CRED_USE_KERBEROS_REQUIRED) { if (krb_state == CRED_USE_KERBEROS_REQUIRED) {
torture_skip(tctx, torture_skip(tctx,
"Can't test failing session setup with kerberos."); "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, broken_creds = cli_credentials_shallow_copy(mem_ctx,
popt_get_cmdline_credentials()); samba_cmdline_get_creds());
torture_assert(tctx, (broken_creds != NULL), "talloc error"); torture_assert(tctx, (broken_creds != NULL), "talloc error");
corrupted_password = talloc_asprintf(mem_ctx, "%s%s", 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; struct smbcli_options options;
const char *host = torture_setting_string(tctx, "host", NULL); const char *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; struct smb2_tree *tree = NULL;
enum credentials_use_kerberos use_kerberos; enum credentials_use_kerberos use_kerberos;
char fname[256]; char fname[256];
@ -1219,7 +1219,7 @@ static bool test_session_expire2i(struct torture_context *tctx,
struct smbcli_options options; struct smbcli_options options;
const char *host = torture_setting_string(tctx, "host", NULL); const char *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; struct smb2_tree *tree = NULL;
const char *unc = NULL; const char *unc = NULL;
struct smb2_tree *tree2 = NULL; struct smb2_tree *tree2 = NULL;
@ -1602,7 +1602,7 @@ static bool test_session_expire_disconnect(struct torture_context *tctx)
struct smbcli_options options; struct smbcli_options options;
const char *host = torture_setting_string(tctx, "host", NULL); const char *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; struct smb2_tree *tree = NULL;
enum credentials_use_kerberos use_kerberos; enum credentials_use_kerberos use_kerberos;
char fname[256]; 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 *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx); TALLOC_CTX *mem_ctx = talloc_new(tctx);
char fname[256]; 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"); torture_assert(tctx, session1_2 != NULL, "smb2_session_channel failed");
status = smb2_session_setup_spnego(session1_2, status = smb2_session_setup_spnego(session1_2,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0 /* previous_session_id */); 0 /* previous_session_id */);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done, torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"smb2_session_setup_spnego failed"); "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"); torture_assert(tctx, session2_1 != NULL, "smb2_session_channel failed");
status = smb2_session_setup_spnego(session2_1, status = smb2_session_setup_spnego(session2_1,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0 /* previous_session_id */); 0 /* previous_session_id */);
torture_assert_ntstatus_ok_goto(tctx, status, ret, done, torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"smb2_session_setup_spnego failed"); "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 *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", 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; NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx); TALLOC_CTX *mem_ctx = talloc_new(tctx);
char fname1[256]; char fname1[256];
@ -2448,7 +2448,7 @@ done:
static bool test_session_bind_invalid_auth(struct torture_context *tctx, struct smb2_tree *tree1) 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; struct cli_credentials *invalid_credentials = NULL;
bool ret = false; 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) 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); struct cli_credentials *credentials2 = torture_user2_credentials(tctx, tctx);
char *u1 = cli_credentials_get_unparsed_name(credentials1, tctx); char *u1 = cli_credentials_get_unparsed_name(credentials1, tctx);
char *u2 = cli_credentials_get_unparsed_name(credentials2, 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) 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; bool ret = false;
struct smb2_transport *transport0 = tree0->session->transport; struct smb2_transport *transport0 = tree0->session->transport;
struct smbcli_options options1; 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) 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; bool ret = false;
struct smb2_transport *transport0 = tree0->session->transport; struct smb2_transport *transport0 = tree0->session->transport;
struct smbcli_options options1; 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) 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; bool ret = false;
struct smb2_transport *transport0 = tree0->session->transport; struct smb2_transport *transport0 = tree0->session->transport;
struct smbcli_options options1; 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) 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; bool ret = false;
struct smb2_transport *transport0 = tree0->session->transport; struct smb2_transport *transport0 = tree0->session->transport;
struct smbcli_options options1; 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) 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; bool ret = false;
struct smb2_transport *transport0 = tree0->session->transport; struct smb2_transport *transport0 = tree0->session->transport;
struct smbcli_options options1; 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) 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; struct cli_credentials *credentials = NULL;
bool ret = false; bool ret = false;
struct smb2_transport *transport0 = tree0->session->transport; struct smb2_transport *transport0 = tree0->session->transport;

View File

@ -24,7 +24,7 @@
#include "libcli/smb2/smb2.h" #include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h" #include "libcli/smb2/smb2_calls.h"
#include "../libcli/smb/smbXcli_base.h" #include "../libcli/smb/smbXcli_base.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "system/time.h" #include "system/time.h"
#include "librpc/gen_ndr/ndr_security.h" #include "librpc/gen_ndr/ndr_security.h"
#include "param/param.h" #include "param/param.h"
@ -372,7 +372,7 @@ bool torture_smb2_session_setup(struct torture_context *tctx,
} }
status = smb2_session_setup_spnego(session, status = smb2_session_setup_spnego(session,
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
previous_session_id); previous_session_id);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
torture_comment(tctx, "session setup failed: %s\n", nt_errstr(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), lpcfg_smb_ports(tctx->lp_ctx),
share, share,
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
previous_session_id, previous_session_id,
tree, tree,
tctx->ev, tctx->ev,
@ -480,7 +480,7 @@ bool torture_smb2_con_sopt(struct torture_context *tctx,
lpcfg_smb_ports(tctx->lp_ctx), lpcfg_smb_ports(tctx->lp_ctx),
share, share,
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0, 0,
tree, tree,
tctx->ev, tctx->ev,

View File

@ -49,7 +49,7 @@ bld.SAMBA_MODULE('TORTURE_SMB2',
util.c util.c
''', ''',
subsystem='smbtorture', subsystem='smbtorture',
deps='LIBCLI_SMB2 POPT_CREDENTIALS torture NDR_IOCTL', deps='LIBCLI_SMB2 torture NDR_IOCTL',
internal_module=True, internal_module=True,
autoproto='proto.h', autoproto='proto.h',
init_function='torture_smb2_init' init_function='torture_smb2_init'

View File

@ -19,7 +19,7 @@
*/ */
#include "includes.h" #include "includes.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "system/time.h" #include "system/time.h"
#include "system/wait.h" #include "system/wait.h"
#include "system/filesys.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_DANGEROUS,OPT_SMB_PORTS,OPT_ASYNC,OPT_NUMPROGS,
OPT_EXTRA_USER,}; OPT_EXTRA_USER,};
TALLOC_CTX *mem_ctx = NULL; TALLOC_CTX *mem_ctx = NULL;
struct loadparm_context *lp_ctx = NULL;
bool ok;
struct poptOption long_options[] = { struct poptOption long_options[] = {
POPT_AUTOHELP POPT_AUTOHELP
@ -457,7 +459,8 @@ int main(int argc, const char *argv[])
POPT_COMMON_CONNECTION POPT_COMMON_CONNECTION
POPT_COMMON_CREDENTIALS POPT_COMMON_CREDENTIALS
POPT_COMMON_VERSION POPT_COMMON_VERSION
{0} POPT_LEGACY_S4
POPT_TABLEEND
}; };
setlinebuf(stdout); setlinebuf(stdout);
@ -473,36 +476,55 @@ int main(int argc, const char *argv[])
/* we are never interested in SIGPIPE */ /* we are never interested in SIGPIPE */
BlockSignals(true, SIGPIPE); BlockSignals(true, SIGPIPE);
pc = poptGetContext("smbtorture", argc, argv, long_options, ok = samba_cmdline_init(mem_ctx,
POPT_CONTEXT_KEEP_FIRST); 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 ..."); poptSetOtherOptionHelp(pc, "<binding>|<unc> TEST1 TEST2 ...");
lp_ctx = samba_cmdline_get_lp_ctx();
while((opt = poptGetNextOpt(pc)) != -1) { while((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) { switch (opt) {
case OPT_LOADFILE: case OPT_LOADFILE:
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:loadfile", poptGetOptArg(pc)); lpcfg_set_cmdline(lp_ctx, "torture:loadfile", poptGetOptArg(pc));
break; break;
case OPT_UNCLIST: case OPT_UNCLIST:
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:unclist", poptGetOptArg(pc)); lpcfg_set_cmdline(lp_ctx, "torture:unclist", poptGetOptArg(pc));
break; break;
case OPT_TIMELIMIT: case OPT_TIMELIMIT:
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:timelimit", poptGetOptArg(pc)); lpcfg_set_cmdline(lp_ctx, "torture:timelimit", poptGetOptArg(pc));
break; break;
case OPT_NUMPROGS: case OPT_NUMPROGS:
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:nprocs", poptGetOptArg(pc)); lpcfg_set_cmdline(lp_ctx, "torture:nprocs", poptGetOptArg(pc));
break; break;
case OPT_DNS: case OPT_DNS:
parse_dns(cmdline_lp_ctx, poptGetOptArg(pc)); parse_dns(lp_ctx, poptGetOptArg(pc));
break; break;
case OPT_DANGEROUS: case OPT_DANGEROUS:
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:dangerous", "Yes"); lpcfg_set_cmdline(lp_ctx, "torture:dangerous", "Yes");
break; break;
case OPT_ASYNC: case OPT_ASYNC:
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:async", "Yes"); lpcfg_set_cmdline(lp_ctx, "torture:async", "Yes");
break; break;
case OPT_SMB_PORTS: case OPT_SMB_PORTS:
lpcfg_set_cmdline(cmdline_lp_ctx, "smb ports", poptGetOptArg(pc)); lpcfg_set_cmdline(lp_ctx, "smb ports", poptGetOptArg(pc));
break; break;
case OPT_EXTRA_USER: case OPT_EXTRA_USER:
{ {
@ -515,7 +537,7 @@ int main(int argc, const char *argv[])
talloc_free(mem_ctx); talloc_free(mem_ctx);
exit(1); exit(1);
} }
lpcfg_set_cmdline(cmdline_lp_ctx, option, value); lpcfg_set_cmdline(lp_ctx, option, value);
talloc_free(option); talloc_free(option);
} }
break; break;
@ -542,54 +564,54 @@ int main(int argc, const char *argv[])
} }
if (strcmp(target, "samba3") == 0) { if (strcmp(target, "samba3") == 0) {
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:samba3", "true"); lpcfg_set_cmdline(lp_ctx, "torture:samba3", "true");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false"); lpcfg_set_cmdline(lp_ctx, "torture:resume_key_support", "false");
} else if (strcmp(target, "samba4") == 0) { } 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) { } else if (strcmp(target, "samba4-ntvfs") == 0) {
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:samba4", "true"); lpcfg_set_cmdline(lp_ctx, "torture:samba4", "true");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:samba4-ntvfs", "true"); lpcfg_set_cmdline(lp_ctx, "torture:samba4-ntvfs", "true");
} else if (strcmp(target, "winxp") == 0) { } 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) { } 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) { } else if (strcmp(target, "w2k8") == 0) {
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:w2k8", "true"); lpcfg_set_cmdline(lp_ctx, "torture:w2k8", "true");
lpcfg_set_cmdline(cmdline_lp_ctx, lpcfg_set_cmdline(lp_ctx,
"torture:invalid_lock_range_support", "false"); "torture:invalid_lock_range_support", "false");
} else if (strcmp(target, "w2k12") == 0) { } 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) { } else if (strcmp(target, "win7") == 0) {
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:win7", "true"); lpcfg_set_cmdline(lp_ctx, "torture:win7", "true");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false"); lpcfg_set_cmdline(lp_ctx, "torture:resume_key_support", "false");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:rewind_support", "false"); lpcfg_set_cmdline(lp_ctx, "torture:rewind_support", "false");
/* RAW-SEARCH for fails for inexplicable reasons against win7 */ /* 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"); "true");
} else if (strcmp(target, "onefs") == 0) { } else if (strcmp(target, "onefs") == 0) {
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:onefs", "true"); lpcfg_set_cmdline(lp_ctx, "torture:onefs", "true");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:openx_deny_dos_support", lpcfg_set_cmdline(lp_ctx, "torture:openx_deny_dos_support",
"false"); "false");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:range_not_locked_on_file_close", "false"); lpcfg_set_cmdline(lp_ctx, "torture:range_not_locked_on_file_close", "false");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:sacl_support", "false"); lpcfg_set_cmdline(lp_ctx, "torture:sacl_support", "false");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:ea_support", "false"); lpcfg_set_cmdline(lp_ctx, "torture:ea_support", "false");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:smbexit_pdu_support", lpcfg_set_cmdline(lp_ctx, "torture:smbexit_pdu_support",
"false"); "false");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:smblock_pdu_support", lpcfg_set_cmdline(lp_ctx, "torture:smblock_pdu_support",
"false"); "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"); "true");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:deny_dos_support", "false"); lpcfg_set_cmdline(lp_ctx, "torture:deny_dos_support", "false");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:deny_fcb_support", "false"); lpcfg_set_cmdline(lp_ctx, "torture:deny_fcb_support", "false");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:read_support", "false"); lpcfg_set_cmdline(lp_ctx, "torture:read_support", "false");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:writeclose_support", "false"); lpcfg_set_cmdline(lp_ctx, "torture:writeclose_support", "false");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false"); lpcfg_set_cmdline(lp_ctx, "torture:resume_key_support", "false");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:rewind_support", "false"); lpcfg_set_cmdline(lp_ctx, "torture:rewind_support", "false");
lpcfg_set_cmdline(cmdline_lp_ctx, "torture:raw_search_search", "false"); lpcfg_set_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:search_ea_size", "false");
} }
if (max_runtime) { if (max_runtime) {
@ -622,7 +644,6 @@ int main(int argc, const char *argv[])
print_testsuite_list(); print_testsuite_list();
poptFreeContext(pc); poptFreeContext(pc);
talloc_free(mem_ctx); talloc_free(mem_ctx);
popt_free_cmdline_credentials();
return 0; return 0;
} }
@ -646,7 +667,6 @@ int main(int argc, const char *argv[])
} }
poptFreeContext(pc); poptFreeContext(pc);
talloc_free(mem_ctx); talloc_free(mem_ctx);
popt_free_cmdline_credentials();
return 0; return 0;
} }
@ -702,7 +722,7 @@ int main(int argc, const char *argv[])
return 1; return 1;
} }
torture->lp_ctx = cmdline_lp_ctx; torture->lp_ctx = lp_ctx;
gensec_init(); gensec_init();
@ -721,7 +741,7 @@ int main(int argc, const char *argv[])
usage(pc); usage(pc);
torture->results->returncode = 1; torture->results->returncode = 1;
} else if (!torture_parse_target(torture, } else if (!torture_parse_target(torture,
cmdline_lp_ctx, argv_new[1])) { lp_ctx, argv_new[1])) {
/* Take the target name or binding. */ /* Take the target name or binding. */
usage(pc); usage(pc);
torture->results->returncode = 1; torture->results->returncode = 1;
@ -741,7 +761,6 @@ int main(int argc, const char *argv[])
if (torture->results->returncode && correct) { if (torture->results->returncode && correct) {
poptFreeContext(pc); poptFreeContext(pc);
talloc_free(mem_ctx); talloc_free(mem_ctx);
popt_free_cmdline_credentials();
return(0); return(0);
} else { } else {
poptFreeContext(pc); poptFreeContext(pc);

View File

@ -21,7 +21,7 @@
#include "libcli/libcli.h" #include "libcli/libcli.h"
#include "torture/util.h" #include "torture/util.h"
#include "torture/unix/proto.h" #include "torture/unix/proto.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libcli/resolve/resolve.h" #include "libcli/resolve/resolve.h"
#include "param/param.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, status = smbcli_full_connection(tctx, &cli, host,
lpcfg_smb_ports(tctx->lp_ctx), lpcfg_smb_ports(tctx->lp_ctx),
share, NULL, lpcfg_socket_options(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), lpcfg_resolve_context(tctx->lp_ctx),
tctx->ev, &options, &session_options, tctx->ev, &options, &session_options,
lpcfg_gensec_settings(tctx, tctx->lp_ctx)); lpcfg_gensec_settings(tctx, tctx->lp_ctx));

View File

@ -22,7 +22,7 @@
#include "libcli/raw/raw_proto.h" #include "libcli/raw/raw_proto.h"
#include "torture/torture.h" #include "torture/torture.h"
#include "torture/unix/proto.h" #include "torture/unix/proto.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "auth/credentials/credentials.h" #include "auth/credentials/credentials.h"
#include "param/param.h" #include "param/param.h"
#include "libcli/resolve/resolve.h" #include "libcli/resolve/resolve.h"
@ -372,7 +372,7 @@ bool torture_unix_whoami(struct torture_context *torture)
struct ldb_context *ldb; struct ldb_context *ldb;
const char *addc, *host; 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"); torture_assert(torture, cli, "connecting to server with authenticated credentials");
/* Test basic authenticated mapping. */ /* Test basic authenticated mapping. */
@ -389,7 +389,7 @@ bool torture_unix_whoami(struct torture_context *torture)
guest ? "YES" : "NO"); guest ? "YES" : "NO");
torture_assert(torture, torture_assert(torture,
cli_credentials_is_anonymous( cli_credentials_is_anonymous(
popt_get_cmdline_credentials()) == guest, samba_cmdline_get_creds()) == guest,
"login did not credentials map to guest"); "login did not credentials map to guest");
} else { } else {
torture_comment(torture, "server does not support SMB_WHOAMI_GUEST flag\n"); 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) { if (addc) {
ldb = ldb_wrap_connect(torture, torture->ev, torture->lp_ctx, talloc_asprintf(torture, "ldap://%s", 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"); torture_assert(torture, ldb, "ldb connect failed");
/* We skip this testing if we could not contact the LDAP server */ /* We skip this testing if we could not contact the LDAP server */

View File

@ -19,7 +19,7 @@
*/ */
#include "includes.h" #include "includes.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libcli/raw/libcliraw.h" #include "libcli/raw/libcliraw.h"
#include "libcli/raw/raw_proto.h" #include "libcli/raw/raw_proto.h"
#include "../libcli/smb/smb_constants.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), lpcfg_smb_ports(tctx->lp_ctx),
sharename, NULL, sharename, NULL,
lpcfg_socket_options(tctx->lp_ctx), lpcfg_socket_options(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
ev, &options, &session_options, ev, &options, &session_options,
lpcfg_gensec_settings(tctx, tctx->lp_ctx)); 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, struct cli_credentials *torture_user2_credentials(struct torture_context *tctx,
TALLOC_CTX *mem_ctx) 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 *user1domain = cli_credentials_get_domain(credentials1);
const char *user2name = torture_setting_string(tctx, "user2name", NULL); const char *user2name = torture_setting_string(tctx, "user2name", NULL);
const char *user2domain = torture_setting_string(tctx, "user2domain", user1domain); const char *user2domain = torture_setting_string(tctx, "user2domain", user1domain);

View File

@ -18,7 +18,7 @@
*/ */
#include "includes.h" #include "includes.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "libcli/smb2/smb2.h" #include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h" #include "libcli/smb2/smb2_calls.h"
#include "libcli/smb/smbXcli_base.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), lpcfg_smb_ports(tctx->lp_ctx),
share, share,
lpcfg_resolve_context(tctx->lp_ctx), lpcfg_resolve_context(tctx->lp_ctx),
popt_get_cmdline_credentials(), samba_cmdline_get_creds(),
0, 0,
tree, tree,
tctx->ev, tctx->ev,

View File

@ -25,7 +25,7 @@
#include "libcli/smb2/smb2.h" #include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h" #include "libcli/smb2/smb2_calls.h"
#include "libcli/smb/smb2_create_ctx.h" #include "libcli/smb/smb2_create_ctx.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "param/param.h" #include "param/param.h"
#include "libcli/resolve/resolve.h" #include "libcli/resolve/resolve.h"
#include "MacExtensions.h" #include "MacExtensions.h"

View File

@ -24,7 +24,7 @@
#include "libcli/smb2/smb2.h" #include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h" #include "libcli/smb2/smb2_calls.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "param/param.h" #include "param/param.h"
#include "libcli/resolve/resolve.h" #include "libcli/resolve/resolve.h"

View File

@ -29,7 +29,7 @@
#include "auth/kerberos/kerberos.h" #include "auth/kerberos/kerberos.h"
#include "auth/credentials/credentials.h" #include "auth/credentials/credentials.h"
#include "param/param.h" #include "param/param.h"
#include "lib/cmdline/popt_common.h" #include "lib/cmdline/cmdline.h"
#include "auth/kerberos/pac_utils.h" #include "auth/kerberos/pac_utils.h"
#include "wbclient.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"); torture_assert_ntstatus_ok(tctx, status, "gensec_set_target_hostname (client) failed");
status = gensec_set_credentials(gensec_client_context, 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"); torture_assert_ntstatus_ok(tctx, status, "gensec_set_credentials (client) failed");
if (sasl_mech) { if (sasl_mech) {

View File

@ -5,7 +5,7 @@ samba_net = bld.pyembed_libname('samba-net')
bld.SAMBA_SUBSYSTEM('TORTURE_UTIL', bld.SAMBA_SUBSYSTEM('TORTURE_UTIL',
source='util_smb.c', source='util_smb.c',
public_deps='torture popt POPT_CREDENTIALS', public_deps='torture',
deps='smbclient-raw' deps='smbclient-raw'
) )
@ -13,7 +13,7 @@ bld.SAMBA_SUBSYSTEM('TORTURE_UTIL',
bld.SAMBA_MODULE('TORTURE_BASIC', 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', 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', 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, internal_module=True,
autoproto='basic/proto.h', autoproto='basic/proto.h',
init_function='torture_base_init', init_function='torture_base_init',
@ -26,7 +26,7 @@ bld.SAMBA_MODULE('TORTURE_RAW',
autoproto='raw/proto.h', autoproto='raw/proto.h',
subsystem='smbtorture', subsystem='smbtorture',
init_function='torture_raw_init', 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, internal_module=True,
enabled=bld.PYTHON_BUILD_IS_ENABLED() enabled=bld.PYTHON_BUILD_IS_ENABLED()
) )
@ -172,7 +172,7 @@ bld.SAMBA_MODULE('torture_rpc',
%s %s
LIBCLI_AUTH LIBCLI_AUTH
popt popt
POPT_CREDENTIALS CMDLINE_S4
TORTURE_LDAP TORTURE_LDAP
TORTURE_UTIL TORTURE_UTIL
TORTURE_RAP TORTURE_RAP
@ -221,7 +221,7 @@ bld.SAMBA_MODULE('TORTURE_AUTH',
source='auth/ntlmssp.c auth/pac.c auth/smbencrypt.c', source='auth/ntlmssp.c auth/pac.c auth/smbencrypt.c',
autoproto='auth/proto.h', autoproto='auth/proto.h',
subsystem='smbtorture', 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 internal_module=True
) )
@ -262,7 +262,7 @@ bld.SAMBA_MODULE('TORTURE_LDAP',
ldap/session_expiry.c ldap/session_expiry.c
''', ''',
subsystem='smbtorture', subsystem='smbtorture',
deps='cli-ldap cli_cldap samdb popt POPT_CREDENTIALS torture ldbsamba', deps='cli-ldap cli_cldap samdb torture ldbsamba',
internal_module=True, internal_module=True,
autoproto='ldap/proto.h', autoproto='ldap/proto.h',
init_function='torture_ldap_init' init_function='torture_ldap_init'
@ -285,7 +285,7 @@ bld.SAMBA_MODULE('TORTURE_NET',
autoproto='libnet/proto.h', autoproto='libnet/proto.h',
subsystem='smbtorture', subsystem='smbtorture',
init_function='torture_net_init', 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, internal_module=True,
enabled=bld.PYTHON_BUILD_IS_ENABLED() enabled=bld.PYTHON_BUILD_IS_ENABLED()
) )
@ -296,7 +296,7 @@ bld.SAMBA_MODULE('TORTURE_NTP',
autoproto='ntp/proto.h', autoproto='ntp/proto.h',
subsystem='smbtorture', subsystem='smbtorture',
init_function='torture_ntp_init', init_function='torture_ntp_init',
deps='popt POPT_CREDENTIALS torture_rpc', deps='torture_rpc',
internal_module=True, internal_module=True,
enabled=bld.PYTHON_BUILD_IS_ENABLED() enabled=bld.PYTHON_BUILD_IS_ENABLED()
) )
@ -304,7 +304,7 @@ bld.SAMBA_MODULE('TORTURE_NTP',
bld.SAMBA_MODULE('TORTURE_VFS', bld.SAMBA_MODULE('TORTURE_VFS',
source='vfs/vfs.c vfs/fruit.c vfs/acl_xattr.c', source='vfs/vfs.c vfs/fruit.c vfs/acl_xattr.c',
subsystem='smbtorture', 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, internal_module=True,
autoproto='vfs/proto.h', autoproto='vfs/proto.h',
init_function='torture_vfs_init' 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', bld.SAMBA_SUBSYSTEM('torturemain',
source='smbtorture.c torture.c shell.c', source='smbtorture.c torture.c shell.c',
subsystem_name='smbtorture', 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() enabled=bld.PYTHON_BUILD_IS_ENABLED()
) )
@ -323,7 +323,7 @@ bld.SAMBA_BINARY('smbtorture',
source=[], source=[],
manpages='man/smbtorture.1', manpages='man/smbtorture.1',
private_headers='smbtorture.h', 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, pyembed=True,
enabled=bld.PYTHON_BUILD_IS_ENABLED() enabled=bld.PYTHON_BUILD_IS_ENABLED()
) )