r25598: Add missing become_root/unbecome_root around calls of add_aliases.
[samba.git] / source / python / py_common.c
index 70d478b9797fae75fef9117d6424508c97a957e2..d4230998ddd02f4f10cbaaa6b7359ff3c55df0ac 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_common.h"
@@ -45,6 +44,8 @@ void py_samba_init(void)
        if (initialised)
                return;
 
+       load_case_tables();
+
        /* Load configuration file */
 
        if (!lp_load(dyn_CONFIGFILE, True, False, False, True))
@@ -212,6 +213,7 @@ struct cli_state *open_pipe_creds(char *server, PyObject *creds,
 {
        char *username, *password, *domain;
        struct cli_state *cli;
+       struct rpc_pipe_client *pipe_hnd;
        NTSTATUS result;
        
        /* Extract credentials from the python dictionary */
@@ -230,7 +232,8 @@ struct cli_state *open_pipe_creds(char *server, PyObject *creds,
                return NULL;
        }
 
-       if (!cli_nt_session_open(cli, pipe_idx)) {
+       pipe_hnd = cli_rpc_pipe_open_noauth(cli, pipe_idx, &result);
+       if (!pipe_hnd) {
                cli_shutdown(cli);
                asprintf(errstr, "error opening pipe index %d", pipe_idx);
                return NULL;