Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba
[ira/wip.git] / source4 / libcli / smb_composite / appendacl.c
index 0a5b56b90d747da7a87cfe3c4ef6b4da562e5852..c1a964f151b22747335610b74d0080b95518c82b 100644 (file)
@@ -1,7 +1,8 @@
 #include "includes.h"
 #include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
 #include "libcli/composite/composite.h"
-#include "libcli/security/proto.h"
+#include "libcli/security/security.h"
 #include "libcli/smb_composite/smb_composite.h"
 
 /* the stages of this call */
@@ -37,15 +38,15 @@ static NTSTATUS appendacl_open(struct composite_context *c,
        NT_STATUS_HAVE_NO_MEMORY(state->io_fileinfo);
        
        state->io_fileinfo->query_secdesc.level = RAW_FILEINFO_SEC_DESC;
-       state->io_fileinfo->query_secdesc.in.fnum = state->io_open->ntcreatex.out.fnum;
-       state->io_fileinfo->query_secdesc.secinfo_flags = SECINFO_DACL;
+       state->io_fileinfo->query_secdesc.in.file.fnum = state->io_open->ntcreatex.out.file.fnum;
+       state->io_fileinfo->query_secdesc.in.secinfo_flags = SECINFO_DACL;
 
        state->req = smb_raw_fileinfo_send(tree, state->io_fileinfo);
        NT_STATUS_HAVE_NO_MEMORY(state->req);
 
        /* set the handler */
        state->req->async.fn = appendacl_handler;
-       state->req->async.private = c;
+       state->req->async.private_data = c;
        state->stage = APPENDACL_GET;
        
        talloc_free (state->io_open);
@@ -69,7 +70,7 @@ static NTSTATUS appendacl_get(struct composite_context *c,
        NT_STATUS_HAVE_NO_MEMORY(state->io_setfileinfo);
        
        state->io_setfileinfo->set_secdesc.level            = RAW_SFILEINFO_SEC_DESC;
-       state->io_setfileinfo->set_secdesc.file.fnum        = state->io_fileinfo->query_secdesc.in.fnum;
+       state->io_setfileinfo->set_secdesc.in.file.fnum     = state->io_fileinfo->query_secdesc.in.file.fnum;
        
        state->io_setfileinfo->set_secdesc.in.secinfo_flags = SECINFO_DACL;
        state->io_setfileinfo->set_secdesc.in.sd            = state->io_fileinfo->query_secdesc.out.sd;
@@ -91,7 +92,7 @@ static NTSTATUS appendacl_get(struct composite_context *c,
 
        /* call handler when done setting new security descriptor on file */
        state->req->async.fn = appendacl_handler;
-       state->req->async.private = c;
+       state->req->async.private_data = c;
        state->stage = APPENDACL_SET;
 
        talloc_free (state->io_fileinfo);
@@ -115,15 +116,15 @@ static NTSTATUS appendacl_set(struct composite_context *c,
        
 
        state->io_fileinfo->query_secdesc.level = RAW_FILEINFO_SEC_DESC;
-       state->io_fileinfo->query_secdesc.in.fnum = state->io_setfileinfo->set_secdesc.file.fnum;
-       state->io_fileinfo->query_secdesc.secinfo_flags = SECINFO_DACL;
+       state->io_fileinfo->query_secdesc.in.file.fnum = state->io_setfileinfo->set_secdesc.in.file.fnum;
+       state->io_fileinfo->query_secdesc.in.secinfo_flags = SECINFO_DACL;
 
        state->req = smb_raw_fileinfo_send(tree, state->io_fileinfo);
        NT_STATUS_HAVE_NO_MEMORY(state->req);
 
        /* set the handler */
        state->req->async.fn = appendacl_handler;
-       state->req->async.private = c;
+       state->req->async.private_data = c;
        state->stage = APPENDACL_GETAGAIN;
        
        talloc_free (state->io_setfileinfo);
@@ -150,7 +151,7 @@ static NTSTATUS appendacl_getagain(struct composite_context *c,
        NT_STATUS_HAVE_NO_MEMORY(io_close);
        
        io_close->close.level = RAW_CLOSE_CLOSE;
-       io_close->close.in.fnum = state->io_fileinfo->query_secdesc.in.fnum;
+       io_close->close.in.file.fnum = state->io_fileinfo->query_secdesc.in.file.fnum;
        io_close->close.in.write_time = 0;
 
        state->req = smb_raw_close_send(tree, io_close);
@@ -158,7 +159,7 @@ static NTSTATUS appendacl_getagain(struct composite_context *c,
 
        /* call the handler */
        state->req->async.fn = appendacl_handler;
-       state->req->async.private = c;
+       state->req->async.private_data = c;
        state->stage = APPENDACL_CLOSEPATH;
 
        talloc_free (state->io_fileinfo);
@@ -187,7 +188,7 @@ static NTSTATUS appendacl_close(struct composite_context *c,
 */
 static void appendacl_handler(struct smbcli_request *req)
 {
-       struct composite_context *c = req->async.private;
+       struct composite_context *c = (struct composite_context *)req->async.private_data;
        struct appendacl_state *state = talloc_get_type(c->private_data, struct appendacl_state);
 
        /* when this handler is called, the stage indicates what
@@ -253,7 +254,7 @@ struct composite_context *smb_composite_appendacl_send(struct smbcli_tree *tree,
        if (state->io_open == NULL) goto failed;
        
        state->io_open->ntcreatex.level               = RAW_OPEN_NTCREATEX;
-       state->io_open->ntcreatex.in.root_fid = 0;
+       state->io_open->ntcreatex.in.root_fid.fnum    = 0;
        state->io_open->ntcreatex.in.flags            = 0;
        state->io_open->ntcreatex.in.access_mask      = SEC_FLAG_MAXIMUM_ALLOWED;
        state->io_open->ntcreatex.in.file_attr        = FILE_ATTRIBUTE_NORMAL;
@@ -269,7 +270,7 @@ struct composite_context *smb_composite_appendacl_send(struct smbcli_tree *tree,
 
        /* setup the callback handler */
        state->req->async.fn = appendacl_handler;
-       state->req->async.private = c;
+       state->req->async.private_data = c;
        state->stage = APPENDACL_OPENPATH;
 
        return c;