summaryrefslogtreecommitdiff
path: root/source4/auth
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-14 05:16:51 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-01-14 19:53:06 +0100
commit3b16c532f21202696d54ef87f8fa74d066812898 (patch)
treeefe40b4053cc286332387545ccb4ef8a1d42802f /source4/auth
parentda72bff5b72658c6cfb1980ac97475ebbc21b6f5 (diff)
downloadsamba-3b16c532f21202696d54ef87f8fa74d066812898.tar.gz
samba-3b16c532f21202696d54ef87f8fa74d066812898.tar.bz2
samba-3b16c532f21202696d54ef87f8fa74d066812898.zip
pidl/python: Pass credentials and loadparm context when connecting using DCE/RPC.
(This used to be commit 4c87af95310e4aaee3f2e2da02d0ea70ed1ec25b)
Diffstat (limited to 'source4/auth')
-rw-r--r--source4/auth/credentials/credentials.i17
-rw-r--r--source4/auth/credentials/credentials_wrap.c16
2 files changed, 33 insertions, 0 deletions
diff --git a/source4/auth/credentials/credentials.i b/source4/auth/credentials/credentials.i
index 8f09ff4b18..ee09b43a75 100644
--- a/source4/auth/credentials/credentials.i
+++ b/source4/auth/credentials/credentials.i
@@ -95,3 +95,20 @@ typedef struct cli_credentials {
bool wrong_password(void);
}
} cli_credentials;
+
+%{
+struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj)
+{
+ struct cli_credentials *ret;
+
+ if (py_obj == Py_None) {
+ return cli_credentials_init_anon(NULL);
+ }
+
+ if (SWIG_ConvertPtr(py_obj, (void *)&ret, SWIGTYPE_p_cli_credentials, 0 | 0 ) < 0) {
+ return NULL;
+ }
+ return ret;
+}
+
+%}
diff --git a/source4/auth/credentials/credentials_wrap.c b/source4/auth/credentials/credentials_wrap.c
index ebf7162c5b..146a81abaf 100644
--- a/source4/auth/credentials/credentials_wrap.c
+++ b/source4/auth/credentials/credentials_wrap.c
@@ -2774,6 +2774,22 @@ SWIGINTERNINLINE PyObject*
}
SWIGINTERN void delete_cli_credentials(cli_credentials *self){ talloc_free(self); }
+
+struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj)
+{
+ struct cli_credentials *ret;
+
+ if (py_obj == Py_None) {
+ return cli_credentials_init_anon(NULL);
+ }
+
+ if (SWIG_ConvertPtr(py_obj, (void *)&ret, SWIGTYPE_p_cli_credentials, 0 | 0 ) < 0) {
+ return NULL;
+ }
+ return ret;
+}
+
+
#ifdef __cplusplus
extern "C" {
#endif