diff options
author | Tim Potter <tpot@samba.org> | 2002-05-16 04:00:31 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-05-16 04:00:31 +0000 |
commit | 286d3a80fdcd316ebbf63b007a24e787143313a4 (patch) | |
tree | 7eeabd842ec6e6f1721f5b3ecb19d350092d53e8 /source3/python/py_samr.c | |
parent | ce03ce2e5629930e582f9fd17445e52ce1b08907 (diff) | |
download | samba-286d3a80fdcd316ebbf63b007a24e787143313a4.tar.gz samba-286d3a80fdcd316ebbf63b007a24e787143313a4.tar.bz2 samba-286d3a80fdcd316ebbf63b007a24e787143313a4.zip |
More cleanups.
- removed dodgy fprintf() error handling
- return an error string from open_pipe_creds() so the appropriate
exception can be raised by the caller
- reformatting
(This used to be commit d35cad359df3bd53e6bb49f6655d4c7b9993abb0)
Diffstat (limited to 'source3/python/py_samr.c')
-rw-r--r-- | source3/python/py_samr.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/python/py_samr.c b/source3/python/py_samr.c index 66d6266d10..d0573171f3 100644 --- a/source3/python/py_samr.c +++ b/source3/python/py_samr.c @@ -275,7 +275,7 @@ static PyObject *samr_connect(PyObject *self, PyObject *args, PyObject *kw) { static char *kwlist[] = { "server", "creds", "access", NULL }; uint32 desired_access = MAXIMUM_ALLOWED_ACCESS; - char *server_name; + char *server, *errstr; struct cli_state *cli; POLICY_HND hnd; TALLOC_CTX *mem_ctx; @@ -283,12 +283,16 @@ static PyObject *samr_connect(PyObject *self, PyObject *args, PyObject *kw) NTSTATUS ntstatus; if (!PyArg_ParseTupleAndKeywords( - args, kw, "s|O!i", kwlist, &server_name, &PyDict_Type, + args, kw, "s|O!i", kwlist, &server, &PyDict_Type, &creds, &desired_access)) return NULL; - if (!(cli = open_pipe_creds(server_name, creds, cli_samr_initialise))) - goto done; + if (!(cli = open_pipe_creds( + server, creds, cli_lsa_initialise, &errstr))) { + PyErr_SetString(samr_error, errstr); + free(errstr); + return NULL; + } if (!(mem_ctx = talloc_init())) { PyErr_SetString(samr_ntstatus, |