]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fruit: add fio->created
authorRalph Boehme <slow@samba.org>
Mon, 22 Oct 2018 14:56:46 +0000 (16:56 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 6 Nov 2018 08:10:25 +0000 (09:10 +0100)
fio->created tracks whether a create created a stream.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 1e055a79541eb69eb2deeae897dde3665c5ffee2)

source3/modules/vfs_fruit.c

index e5b3897b6e4cc28520f223e79c18215bfb9ab52e..bbfacad7811e7798b3d5147333faf907c462c6fc 100644 (file)
@@ -514,6 +514,9 @@ struct fio {
 
        /* Denote stream type, meta or rsrc */
        adouble_type_t type;
+
+       /* Whether the create created the stream */
+       bool created;
 };
 
 /*
@@ -5860,6 +5863,7 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle,
        NTSTATUS status;
        struct fruit_config_data *config = NULL;
        files_struct *fsp = NULL;
+       struct fio *fio = NULL;
 
        status = check_aapl(handle, req, in_context_blobs, out_context_blobs);
        if (!NT_STATUS_IS_OK(status)) {
@@ -5910,6 +5914,11 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle,
                goto fail;
        }
 
+       fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
+       if (fio != NULL && pinfo != NULL && *pinfo == FILE_WAS_CREATED) {
+               fio->created = true;
+       }
+
        if (is_ntfs_stream_smb_fname(smb_fname)
            || fsp->is_directory) {
                return status;