1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-22 16:59:09 +03:00

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 commit is contained in:
Tim Potter
-
parent 36ed06cb50
commit d35cad359d
11 changed files with 137 additions and 109 deletions

View File

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