vfs_fruit: use "fake_fd" instead of "created"
authorRalph Boehme <slow@samba.org>
Fri, 11 Dec 2020 12:00:09 +0000 (13:00 +0100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 13 Jan 2021 12:41:13 +0000 (12:41 +0000)
Both have basically the same semantics.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14596

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(back-ported from commit 36eb30fd7d4b82bffd0e1ab471c088f678d700a4)

source3/modules/vfs_fruit.c

index a376cc2f82d3cbdf6e26ac06e219eaf5bc0c80ea..a61a7393adac6b9ed5073da35aac0f2f738f8f84 100644 (file)
@@ -178,9 +178,6 @@ struct fio {
        /* Denote stream type, meta or rsrc */
        adouble_type_t type;
 
-       /* Whether the create created the stream */
-       bool created;
-
        /*
         * AFP_AfpInfo stream created, but not written yet, thus still a fake
         * pipe fd. This is set to true in fruit_open_meta if there was no
@@ -2300,7 +2297,7 @@ static ssize_t fruit_pread_meta(vfs_handle_struct *handle,
                return -1;
        }
 
-       if (nread == -1 && fio->created) {
+       if (nread == -1 && fio->fake_fd) {
                AfpInfo *ai = NULL;
                char afpinfo_buf[AFP_INFO_SIZE];
 
@@ -3999,7 +3996,6 @@ 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;
        bool internal_open = (oplock_request & INTERNAL_OPEN_ONLY);
        int ret;
 
@@ -4072,11 +4068,6 @@ 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_named_stream(smb_fname)
            || fsp->is_directory) {
                return status;