s4:torture: Migrate smbtorture to new cmdline option parser
authorAndreas Schneider <asn@samba.org>
Wed, 2 Dec 2020 16:24:22 +0000 (17:24 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 16 Jun 2021 00:34:38 +0000 (00:34 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
84 files changed:
nsswitch/libwbclient/tests/wbclient.c
selftest/knownfail
selftest/knownfail.d/ntlmv2-restrictions
selftest/knownfail.d/smb1-tests
source3/selftest/tests.py
source4/selftest/tests.py
source4/torture/auth/ntlmssp.c
source4/torture/basic/misc.c
source4/torture/dns/dlz_bind9.c
source4/torture/drs/rpc/dssync.c
source4/torture/drs/rpc/msds_intid.c
source4/torture/drs/wscript_build
source4/torture/krb5/kdc-canon-heimdal.c
source4/torture/krb5/kdc-heimdal.c
source4/torture/krb5/kdc-mit.c
source4/torture/krb5/wscript_build
source4/torture/ldap/basic.c
source4/torture/ldap/ldap_sort.c
source4/torture/ldap/nested_search.c
source4/torture/ldap/schema.c
source4/torture/ldap/session_expiry.c
source4/torture/ldap/uptodatevector.c
source4/torture/libnet/libnet_BecomeDC.c
source4/torture/libnet/libnet_domain.c
source4/torture/libnet/libnet_group.c
source4/torture/libnet/libnet_lookup.c
source4/torture/libnet/libnet_rpc.c
source4/torture/libnet/libnet_share.c
source4/torture/libnet/libnet_user.c
source4/torture/libnet/utils.c
source4/torture/libnetapi/libnetapi.c
source4/torture/libnetapi/wscript_build
source4/torture/libsmbclient/libsmbclient.c
source4/torture/libsmbclient/wscript_build
source4/torture/local/wscript_build
source4/torture/raw/composite.c
source4/torture/raw/context.c
source4/torture/raw/lock.c
source4/torture/raw/lockbench.c
source4/torture/raw/openbench.c
source4/torture/raw/oplock.c
source4/torture/raw/session.c
source4/torture/raw/tconrate.c
source4/torture/rpc/async_bind.c
source4/torture/rpc/backupkey.c
source4/torture/rpc/bind.c
source4/torture/rpc/dfs.c
source4/torture/rpc/dsgetinfo.c
source4/torture/rpc/fsrvp.c
source4/torture/rpc/iremotewinspool_driver.c
source4/torture/rpc/mdssvc.c
source4/torture/rpc/netlogon.c
source4/torture/rpc/remote_pac.c
source4/torture/rpc/rpc.c
source4/torture/rpc/samba3rpc.c
source4/torture/rpc/samlogon.c
source4/torture/rpc/schannel.c
source4/torture/rpc/session_key.c
source4/torture/rpc/spoolss.c
source4/torture/rpc/spoolss_access.c
source4/torture/rpc/testjoin.c
source4/torture/rpc/witness.c
source4/torture/rpc/wkssvc.c
source4/torture/shell.c
source4/torture/smb2/acls.c
source4/torture/smb2/create.c
source4/torture/smb2/multichannel.c
source4/torture/smb2/notify.c
source4/torture/smb2/notify_disabled.c
source4/torture/smb2/oplock.c
source4/torture/smb2/replay.c
source4/torture/smb2/scan.c
source4/torture/smb2/session.c
source4/torture/smb2/util.c
source4/torture/smb2/wscript_build
source4/torture/smbtorture.c
source4/torture/unix/unix_info2.c
source4/torture/unix/whoami.c
source4/torture/util_smb.c
source4/torture/vfs/acl_xattr.c
source4/torture/vfs/fruit.c
source4/torture/vfs/vfs.c
source4/torture/winbind/winbind.c
source4/torture/wscript_build

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