r3550: fixed initial attribute on file create (inlusion of FILE_ATTRIBUTE_ARCHIVE)
authorAndrew Tridgell <tridge@samba.org>
Fri, 5 Nov 2004 11:49:37 +0000 (11:49 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:05:31 +0000 (13:05 -0500)
(This used to be commit b07feaafd16e42e84ba51004a6a9d4a3cb8f9a37)

source4/ntvfs/posix/pvfs_open.c

index d640bae27925b3a2104e23cdf696dbf44e66180d..2430f9becba93650dabb02a0ba745fc88e9dd9bc 100644 (file)
@@ -284,6 +284,7 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
        uint32_t share_access = io->generic.in.share_access;
        uint32_t access_mask = io->generic.in.access_mask;
        mode_t mode;
+       uint32_t attrib;
 
        if ((io->ntcreatex.in.file_attr & FILE_ATTRIBUTE_READONLY) &&
            (create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE)) {
@@ -313,7 +314,8 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
                return NT_STATUS_TOO_MANY_OPENED_FILES;
        }
 
-       mode = pvfs_fileperms(pvfs, io->ntcreatex.in.file_attr | FILE_ATTRIBUTE_ARCHIVE);
+       attrib = io->ntcreatex.in.file_attr | FILE_ATTRIBUTE_ARCHIVE;
+       mode = pvfs_fileperms(pvfs, attrib);
 
        /* create the file */
        fd = open(name->full_name, flags | O_CREAT | O_EXCL, mode);
@@ -330,7 +332,7 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
                return status;
        }
 
-       name->dos.attrib = io->ntcreatex.in.file_attr;
+       name->dos.attrib = attrib;
        status = pvfs_dosattrib_save(pvfs, name, fd);
        if (!NT_STATUS_IS_OK(status)) {
                idr_remove(pvfs->idtree_fnum, fnum);