s4:libcli/raw: make short_name available in buffer
authorRalph Boehme <rb@sernet.de>
Wed, 1 Oct 2014 12:36:43 +0000 (14:36 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 4 Dec 2014 21:11:08 +0000 (22:11 +0100)
This will be used in smb2/create AAPL context torture tests, where the
server returns an Mac OS X specific data blob in the short name
buffer. It's not a string, so the existing string extraction doesn't
cut it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/libcli/raw/interfaces.h
source4/libcli/raw/rawsearch.c

index dd0c3bd90ae585e3e5f9136cb09f44693a813d20..5804a6beff9ab23139e50767750eb85a2f70ed6e 100644 (file)
@@ -2740,6 +2740,7 @@ union smb_search_data {
                uint32_t  attrib;
                uint32_t  ea_size;
                uint64_t file_id;
+               uint8_t short_name_buf[24];
                struct smb_wire_string short_name;
                struct smb_wire_string name;
        } id_both_directory_info;
index 0705faa4e3ed3d43df18fad6e494f816ab3ef74f..6035cc244e0e4b2bb0d4e622c8c5ade2b7ff0dc8 100644 (file)
@@ -456,6 +456,7 @@ NTSTATUS smb_raw_search_common(TALLOC_CTX *mem_ctx,
                smbcli_blob_pull_string(NULL, mem_ctx, blob,
                                     &data->id_both_directory_info.short_name,
                                     68, 70, STR_LEN8BIT | STR_UNICODE);
+               memcpy(data->id_both_directory_info.short_name_buf, blob->data + 70, 24);
                data->id_both_directory_info.file_id     = BVAL(blob->data,            96);
                len = smbcli_blob_pull_string(NULL, mem_ctx, blob,
                                              &data->id_both_directory_info.name,