r25598: Add missing become_root/unbecome_root around calls of add_aliases.
[samba.git] / source / python / py_smb.c
index 679c113f397b2533ad511b0139adfce16d65fe29..17b2a2d5aa13782b35f07e517089f7dea0a5f798 100644 (file)
@@ -5,7 +5,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -14,8 +14,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "python/py_smb.h"
@@ -43,12 +42,12 @@ static PyObject *py_smb_connect(PyObject *self, PyObject *args, PyObject *kw)
        if (!PyArg_ParseTupleAndKeywords(args, kw, "s", kwlist, &server))
                return NULL;
 
-       if (!(cli = cli_initialise(NULL)))
+       if (!(cli = cli_initialise()))
                return NULL;
 
        ZERO_STRUCT(ip);
 
-       if (!cli_connect(cli, server, &ip))
+       if (!NT_STATUS_IS_OK(cli_connect(cli, server, &ip)))
                return NULL;
 
        return new_cli_state_object(cli);
@@ -99,7 +98,7 @@ static PyObject *py_smb_session_setup(PyObject *self, PyObject *args,
        static char *kwlist[] = { "creds", NULL };
        PyObject *creds;
        char *username, *domain, *password, *errstr;
-       BOOL result;
+       NTSTATUS result;
 
        if (!PyArg_ParseTupleAndKeywords(args, kw, "|O", kwlist, &creds))
                return NULL;
@@ -118,7 +117,7 @@ static PyObject *py_smb_session_setup(PyObject *self, PyObject *args,
                return NULL;
        }
 
-       return Py_BuildValue("i", result);
+       return Py_BuildValue("i", NT_STATUS_IS_OK(result));
 }
 
 static PyObject *py_smb_tconx(PyObject *self, PyObject *args, PyObject *kw)