summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-04-05 07:58:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:26 -0500
commite1e8928840b632297e3cbbd19aeef5e075ff7798 (patch)
tree3ab3b7cc29bd773cc041b797a440d3faa433fd23 /source4/scripting
parentcf52d62ec998ae30f4460e75817b0503894aff5d (diff)
downloadsamba-e1e8928840b632297e3cbbd19aeef5e075ff7798.tar.gz
samba-e1e8928840b632297e3cbbd19aeef5e075ff7798.tar.bz2
samba-e1e8928840b632297e3cbbd19aeef5e075ff7798.zip
r6208: Add cli_credentials support for swig wrappers. For the moment it
only does anonymous connections. (This used to be commit b09a4723539235fc924134aa50fc4aed040afb33)
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/swig/dcerpc.i7
-rw-r--r--source4/scripting/swig/samba.i6
-rwxr-xr-xsource4/scripting/swig/torture/pytorture2
-rwxr-xr-xsource4/scripting/swig/torture/torture_samr.py5
4 files changed, 12 insertions, 8 deletions
diff --git a/source4/scripting/swig/dcerpc.i b/source4/scripting/swig/dcerpc.i
index a1261f997d..a76e1301af 100644
--- a/source4/scripting/swig/dcerpc.i
+++ b/source4/scripting/swig/dcerpc.i
@@ -153,13 +153,12 @@ void set_werror_exception(int status)
%rename(pipe_connect) dcerpc_pipe_connect;
-NTSTATUS dcerpc_pipe_connect(struct dcerpc_pipe **OUT,
+NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx,
+ struct dcerpc_pipe **OUT,
const char *binding,
const char *pipe_uuid,
uint32_t pipe_version,
- const char *domain,
- const char *username,
- const char *password);
+ struct cli_credentials *credentials);
%typemap(in) DATA_BLOB * (DATA_BLOB temp_data_blob) {
temp_data_blob.data = PyString_AsString($input);
diff --git a/source4/scripting/swig/samba.i b/source4/scripting/swig/samba.i
index c7b8b46e66..620d908699 100644
--- a/source4/scripting/swig/samba.i
+++ b/source4/scripting/swig/samba.i
@@ -60,3 +60,9 @@
%typemap(out) NTSTATUS {
$result = PyLong_FromUnsignedLong(NT_STATUS_V($1));
}
+
+%typemap(in) struct cli_credentials * {
+ $1 = cli_credentials_init(arg1);
+ cli_credentials_set_anonymous($1);
+// cli_credentials_set_workstation($1, "FROGURT", CRED_SPECIFIED);
+}
diff --git a/source4/scripting/swig/torture/pytorture b/source4/scripting/swig/torture/pytorture
index fd4a92eeb4..e0123447e8 100755
--- a/source4/scripting/swig/torture/pytorture
+++ b/source4/scripting/swig/torture/pytorture
@@ -48,4 +48,4 @@ for test in args:
if not hasattr(module, 'runtests'):
print 'Module "%s" does not have a runtests function' % test
- module.runtests(binding, domain, username, password)
+ module.runtests(binding, (domain, username, password))
diff --git a/source4/scripting/swig/torture/torture_samr.py b/source4/scripting/swig/torture/torture_samr.py
index 929420695d..2064d28044 100755
--- a/source4/scripting/swig/torture/torture_samr.py
+++ b/source4/scripting/swig/torture/torture_samr.py
@@ -721,13 +721,12 @@ def test_EnumDomains(pipe, connect_handle):
for domain in connect_handle.EnumDomains():
test_LookupDomain(pipe, connect_handle, domain)
-def runtests(binding, domain, username, password):
+def runtests(binding, creds):
print 'Testing SAMR pipe'
pipe = dcerpc.pipe_connect(binding,
- dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
- domain, username, password)
+ dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION), creds)
handle = test_Connect(pipe)