fix make test for EAs again
authorAndrew Tridgell <tridge@samba.org>
Thu, 22 May 2008 14:07:12 +0000 (00:07 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 22 May 2008 14:07:12 +0000 (00:07 +1000)
- go back to 4 byte alignment until I work out the rules that Vista
  wants more exactly
- add the zero sized EA handling for SMB2 more generically
(This used to be commit 326b69bc8064cbea357864cecd6bd27b50c57184)

source4/libcli/smb2/create.c
source4/ntvfs/posix/pvfs_fileinfo.c
source4/ntvfs/posix/pvfs_qfileinfo.c
source4/smb_server/blob.c

index 9d28bbf8c46a101e7bd9b287e973bfc09ad2ed4e..b1b8b0ccfaf85a1a4e004d0eaaf6ccff91ce221c 100644 (file)
@@ -117,8 +117,8 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
 
        if (io->in.eas.num_eas != 0) {
                DATA_BLOB b = data_blob_talloc(req, NULL, 
-                                              ea_list_size_chained(io->in.eas.num_eas, io->in.eas.eas, 8));
-               ea_put_list_chained(b.data, io->in.eas.num_eas, io->in.eas.eas, 8);
+                                              ea_list_size_chained(io->in.eas.num_eas, io->in.eas.eas, 4));
+               ea_put_list_chained(b.data, io->in.eas.num_eas, io->in.eas.eas, 4);
                status = smb2_create_blob_add(req, &io->in.blobs,
                                              SMB2_CREATE_TAG_EXTA, b);
                if (!NT_STATUS_IS_OK(status)) {
index 4c383ed45d721263c77ea280f06b3b879eda8cd1..e35f42e955566c8613bd136affdceb450e0d7eae 100644 (file)
@@ -75,6 +75,11 @@ NTSTATUS pvfs_fill_dos_info(struct pvfs_state *pvfs, struct pvfs_filename *name,
        name->dos.alloc_size = pvfs_round_alloc_size(pvfs, name->st.st_size);
        name->dos.nlink = name->st.st_nlink;
        name->dos.ea_size = 4;
+       if (pvfs->ntvfs->ctx->protocol == PROTOCOL_SMB2) {
+               /* SMB2 represents a null EA with zero bytes */
+               name->dos.ea_size = 0;
+       }
+       
        name->dos.file_id = (((uint64_t)name->st.st_dev)<<32) | name->st.st_ino;
        name->dos.flags = 0;
 
index 102660a0bfba388ef95f9d6cac552c9651e77d62..6e3092b744fc1aa2d4ceaaad92d3e6be7ba52a61 100644 (file)
@@ -298,10 +298,6 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
                        (name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY)? 1 : 0;
                info->all_info2.out.file_id        = name->dos.file_id;
                info->all_info2.out.ea_size        = name->dos.ea_size;
-               if (info->all_info2.out.ea_size == 4) {
-                       /* SMB2 uses zero for a empty EA set */
-                       info->all_info2.out.ea_size = 0;
-               }
                info->all_info2.out.access_mask    = 0; /* only set by qfileinfo */
                info->all_info2.out.position       = 0; /* only set by qfileinfo */
                info->all_info2.out.mode           = 0; /* only set by qfileinfo */
index cea4c60e5905f26a385a1a8177e3d9b479893de8..368b81d18e5cf9d29929aa04161c9e3d2d05f934 100644 (file)
@@ -476,12 +476,12 @@ NTSTATUS smbsrv_push_passthru_fileinfo(TALLOC_CTX *mem_ctx,
                }
 
                list_size = ea_list_size_chained(st->all_eas.out.num_eas,
-                                                st->all_eas.out.eas, 8);
+                                                st->all_eas.out.eas, 4);
                BLOB_CHECK(smbsrv_blob_grow_data(mem_ctx, blob, list_size));
 
                ea_put_list_chained(blob->data,
                                    st->all_eas.out.num_eas,
-                                   st->all_eas.out.eas, 8);
+                                   st->all_eas.out.eas, 4);
                return NT_STATUS_OK;
 
        case RAW_FILEINFO_SMB2_ALL_INFORMATION: