The Samba-Bugzilla – Attachment 6451 Details for
Bug 8144
touch /mnt/newfile fails to set timestamp with CIFS client.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 3.6.0rc1
0001-Fix-bug-8144-touch-mnt-newfile-fails-to-set-timestam.patch (text/plain), 2.90 KB, created by
Jeremy Allison
on 2011-05-17 23:35:52 UTC
(
hide
)
Description:
Patch for 3.6.0rc1
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2011-05-17 23:35:52 UTC
Size:
2.90 KB
patch
obsolete
>From 500b77715b44f7cc6f9c84848bcf0db114cd443c Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Tue, 17 May 2011 16:18:51 -0700 >Subject: [PATCH] Fix bug #8144 - touch /mnt/newfile fails to set timestamp with CIFS client. > >The extra checks added for Windows correctness in our metadata changing paths >to ensure the file handle has been opened with the correct access mask to >allow FILE_WRITE_ATTRIBUTES etc. caused problems with the POSIX open code. > >The old POSIX open code maped O_RDONLY into FILE_READ, O_WRONLY into FILE_WRITE, >and O_RDWR into FILE_READ|FILE_WRITE. This patch extends the mapping to add >FILE_WRITE_ATTRIBUTES, FILE_READ_ATTRIBUTES and FILE_WRITE_EA, FILE_READ_EA to >allow POSIX opens to set these values. >--- > source3/smbd/trans2.c | 25 +++++++++++++++---------- > 1 files changed, 15 insertions(+), 10 deletions(-) > >diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c >index 733f1bc..75d0a41 100644 >--- a/source3/smbd/trans2.c >+++ b/source3/smbd/trans2.c >@@ -7226,6 +7226,9 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn, > Open/Create a file with POSIX semantics. > ****************************************************************************/ > >+#define SMB_O_RDONLY_MAPPING (FILE_READ_DATA|FILE_READ_ATTRIBUTES|FILE_READ_EA) >+#define SMB_O_WRONLY_MAPPING (FILE_WRITE_DATA|FILE_WRITE_ATTRIBUTES|FILE_WRITE_EA) >+ > static NTSTATUS smb_posix_open(connection_struct *conn, > struct smb_request *req, > char **ppdata, >@@ -7271,13 +7274,14 @@ static NTSTATUS smb_posix_open(connection_struct *conn, > > switch (wire_open_mode & SMB_ACCMODE) { > case SMB_O_RDONLY: >- access_mask = FILE_READ_DATA; >+ access_mask = SMB_O_RDONLY_MAPPING; > break; > case SMB_O_WRONLY: >- access_mask = FILE_WRITE_DATA; >+ access_mask = SMB_O_WRONLY_MAPPING; > break; > case SMB_O_RDWR: >- access_mask = FILE_READ_DATA|FILE_WRITE_DATA; >+ access_mask = (SMB_O_RDONLY_MAPPING| >+ SMB_O_WRONLY_MAPPING); > break; > default: > DEBUG(5,("smb_posix_open: invalid open mode 0x%x\n", >@@ -7355,20 +7359,21 @@ static NTSTATUS smb_posix_open(connection_struct *conn, > if (wire_open_mode & SMB_O_SYNC) { > create_options |= FILE_WRITE_THROUGH; > } >+ if (wire_open_mode & SMB_O_APPEND) { >+ access_mask |= FILE_APPEND_DATA; >+ } >+ if (wire_open_mode & SMB_O_DIRECT) { >+ mod_unixmode |= FILE_FLAG_NO_BUFFERING; >+ } >+ > if ((wire_open_mode & SMB_O_DIRECTORY) || > VALID_STAT_OF_DIR(smb_fname->st)) { >- if (access_mask != FILE_READ_DATA) { >+ if (access_mask != SMB_O_RDONLY_MAPPING) { > return NT_STATUS_FILE_IS_A_DIRECTORY; > } > create_options &= ~FILE_NON_DIRECTORY_FILE; > create_options |= FILE_DIRECTORY_FILE; > } >- if (wire_open_mode & SMB_O_APPEND) { >- access_mask |= FILE_APPEND_DATA; >- } >- if (wire_open_mode & SMB_O_DIRECT) { >- mod_unixmode |= FILE_FLAG_NO_BUFFERING; >- } > > DEBUG(10,("smb_posix_open: file %s, smb_posix_flags = %u, mode 0%o\n", > smb_fname_str_dbg(smb_fname), >-- >1.7.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
vl
:
review+
jlayton
:
review+
jra
:
review?
(
sfrench
)
Actions:
View
Attachments on
bug 8144
: 6451