1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-01 16:23:49 +03:00

r6208: Add cli_credentials support for swig wrappers. For the moment it

only does anonymous connections.
This commit is contained in:
Tim Potter
2005-04-05 07:58:02 +00:00
committed by Gerald (Jerry) Carter
parent c35887ca64
commit b09a472353
4 changed files with 12 additions and 8 deletions

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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))

View File

@@ -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)