From d8ddb03e906d47a9b75238a2848d860228ab35a7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 5 Nov 2004 11:49:37 +0000 Subject: r3550: fixed initial attribute on file create (inlusion of FILE_ATTRIBUTE_ARCHIVE) (This used to be commit b07feaafd16e42e84ba51004a6a9d4a3cb8f9a37) --- source4/ntvfs/posix/pvfs_open.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index d640bae279..2430f9becb 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -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); -- cgit