mirror of
https://github.com/samba-team/samba.git
synced 2025-11-05 04:23:51 +03:00
r6208: Add cli_credentials support for swig wrappers. For the moment it
only does anonymous connections.
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
c35887ca64
commit
b09a472353
@@ -153,13 +153,12 @@ void set_werror_exception(int status)
|
|||||||
|
|
||||||
%rename(pipe_connect) dcerpc_pipe_connect;
|
%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 *binding,
|
||||||
const char *pipe_uuid,
|
const char *pipe_uuid,
|
||||||
uint32_t pipe_version,
|
uint32_t pipe_version,
|
||||||
const char *domain,
|
struct cli_credentials *credentials);
|
||||||
const char *username,
|
|
||||||
const char *password);
|
|
||||||
|
|
||||||
%typemap(in) DATA_BLOB * (DATA_BLOB temp_data_blob) {
|
%typemap(in) DATA_BLOB * (DATA_BLOB temp_data_blob) {
|
||||||
temp_data_blob.data = PyString_AsString($input);
|
temp_data_blob.data = PyString_AsString($input);
|
||||||
|
|||||||
@@ -60,3 +60,9 @@
|
|||||||
%typemap(out) NTSTATUS {
|
%typemap(out) NTSTATUS {
|
||||||
$result = PyLong_FromUnsignedLong(NT_STATUS_V($1));
|
$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);
|
||||||
|
}
|
||||||
|
|||||||
@@ -48,4 +48,4 @@ for test in args:
|
|||||||
if not hasattr(module, 'runtests'):
|
if not hasattr(module, 'runtests'):
|
||||||
print 'Module "%s" does not have a runtests function' % test
|
print 'Module "%s" does not have a runtests function' % test
|
||||||
|
|
||||||
module.runtests(binding, domain, username, password)
|
module.runtests(binding, (domain, username, password))
|
||||||
|
|||||||
@@ -721,13 +721,12 @@ def test_EnumDomains(pipe, connect_handle):
|
|||||||
for domain in connect_handle.EnumDomains():
|
for domain in connect_handle.EnumDomains():
|
||||||
test_LookupDomain(pipe, connect_handle, domain)
|
test_LookupDomain(pipe, connect_handle, domain)
|
||||||
|
|
||||||
def runtests(binding, domain, username, password):
|
def runtests(binding, creds):
|
||||||
|
|
||||||
print 'Testing SAMR pipe'
|
print 'Testing SAMR pipe'
|
||||||
|
|
||||||
pipe = dcerpc.pipe_connect(binding,
|
pipe = dcerpc.pipe_connect(binding,
|
||||||
dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
|
dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION), creds)
|
||||||
domain, username, password)
|
|
||||||
|
|
||||||
handle = test_Connect(pipe)
|
handle = test_Connect(pipe)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user