idl: more lsa.idl merges.
[idra/samba.git] / source4 / libcli / util / clilsa.c
index ad2006756b582555d5ee9d348c2852dd7b97a522..abca8f49b2f014f61a7eedc9d368447ca08a651b 100644 (file)
@@ -7,7 +7,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,
@@ -16,8 +16,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 "includes.h"
 #include "libcli/raw/libcliraw.h"
+#include "libcli/libcli.h"
+#include "libcli/security/security.h"
 #include "librpc/gen_ndr/ndr_lsa.h"
+#include "librpc/gen_ndr/ndr_lsa_c.h"
+#include "libcli/util/clilsa.h"
+#include "param/param.h"
 
 struct smblsa_state {
        struct dcerpc_pipe *pipe;
@@ -58,7 +62,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli)
                return NT_STATUS_NO_MEMORY;
        }
 
-       lsa->ipc_tree = smbcli_tree_init(cli->session, lsa, False);
+       lsa->ipc_tree = smbcli_tree_init(cli->session, lsa, false);
        if (lsa->ipc_tree == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -69,28 +73,29 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli)
        tcon.tconx.in.password = data_blob(NULL, 0);
        tcon.tconx.in.path = "ipc$";
        tcon.tconx.in.device = "IPC";   
-       status = smb_tree_connect(lsa->ipc_tree, lsa, &tcon);
+       status = smb_raw_tcon(lsa->ipc_tree, lsa, &tcon);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(lsa);
                return status;
        }
        lsa->ipc_tree->tid = tcon.tconx.out.tid;
 
-       lsa->pipe = dcerpc_pipe_init(lsa, cli->transport->socket->event.ctx);
+       lsa->pipe = dcerpc_pipe_init(lsa, cli->transport->socket->event.ctx,
+                                    lp_iconv_convenience(global_loadparm));
        if (lsa->pipe == NULL) {
                talloc_free(lsa);
                return NT_STATUS_NO_MEMORY;
        }
 
        /* open the LSA pipe */
-       status = dcerpc_pipe_open_smb(lsa->pipe->conn, lsa->ipc_tree, DCERPC_LSARPC_NAME);
+       status = dcerpc_pipe_open_smb(lsa->pipe, lsa->ipc_tree, NDR_LSARPC_NAME);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(lsa);
                return status;
        }
 
        /* bind to the LSA pipe */
-       status = dcerpc_bind_auth_none(lsa->pipe, DCERPC_LSARPC_UUID, DCERPC_LSARPC_VERSION);
+       status = dcerpc_bind_auth_none(lsa->pipe, &ndr_table_lsarpc);
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(lsa);
                 return status;
@@ -344,7 +349,7 @@ NTSTATUS smblsa_sid_del_privileges(struct smbcli_state *cli, struct dom_sid *sid
 
        r.in.handle = &cli->lsa->handle;
        r.in.sid = sid;
-       r.in.unknown = 0;
+       r.in.remove_all = 0;
        r.in.rights = rights;
 
        return dcerpc_lsa_RemoveAccountRights(cli->lsa->pipe, mem_ctx, &r);