vfs_fruit: add fio->created
authorRalph Boehme <slow@samba.org>
Mon, 22 Oct 2018 14:56:46 +0000 (16:56 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 31 Oct 2018 20:27:21 +0000 (21:27 +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>
source3/modules/vfs_fruit.c

index d0ed0201ecbfb400406d1ca0278960388ec12195..f638d2b00472adc09cfbe8e2886d11ea6e63b2e0 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;
 };
 
 /*
@@ -5885,6 +5888,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)) {
@@ -5935,6 +5939,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;