idl/ioctl: change QAR response array to a DATA_BLOB
authorDavid Disseldorp <ddiss@samba.org>
Thu, 12 Feb 2015 09:58:20 +0000 (10:58 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 9 Mar 2015 20:27:07 +0000 (21:27 +0100)
[MS-FSCC] specifies:
  The number of FILE_ALLOCATED_RANGE_BUFFER elements returned is
  computed by dividing the size of the returned output buffer (from
  either SMB or SMB2, the lower-layer protocol that carries the FSCTL)
  by the size of the FILE_ALLOCATED_RANGE_BUFFER element.

Ideally, this requirement could be defined in idl with the following:
  [flag(NDR_REMAINING)] file_alloced_range_buf array[];

However, this is not currently supported by PIDL, so just use an opaque
data blob for now.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
librpc/idl/ioctl.idl
source4/torture/smb2/ioctl.c

index 77606441737c4e603bbdd4e370ddcbc6357ed6a6..d037956ab70f6175611d274546b8b0c27f918622 100644 (file)
@@ -164,9 +164,13 @@ interface sparse
         * computed by dividing the size of the returned output buffer (from
         * either SMB or SMB2, the lower-layer protocol that carries the FSCTL)
         * by the size of the FILE_ALLOCATED_RANGE_BUFFER element.
+        *
+        * This logic can't (currently) be represented in pidl, so just use a
+        * blob. Perhaps in future we'll support:
+        *      [flag(NDR_REMAINING)] file_alloced_range_buf array[];
         */
        typedef [public] struct {
-               file_alloced_range_buf *array;
+               [flag(NDR_REMAINING)] DATA_BLOB far_buf_array;
        } fsctl_query_alloced_ranges_rsp;
 
        /* 2.3.65 FSCTL_SET_ZERO_DATA Request */
index 931a013b79845dc60641147c5defe24fea3b4d84..d04fb4962e405066edbb54568f2af1cab1a24720 100644 (file)
@@ -2922,6 +2922,9 @@ static NTSTATUS test_ioctl_qar_req(struct torture_context *torture,
                        status = NT_STATUS_UNSUCCESSFUL;
                        goto err_out;
                }
+               /* move to next buffer */
+               ioctl.smb2.out.out.data += sizeof(far_buf);
+               ioctl.smb2.out.out.length -= sizeof(far_buf);
        }
 
 done: