The Samba-Bugzilla – Attachment 4222 Details for
Bug 6421
POSIX read-only open fails on read-only shares.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch under test.
look (text/plain), 1.61 KB, created by
Jeremy Allison
on 2009-05-30 14:19:45 UTC
(
hide
)
Description:
Patch under test.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2009-05-30 14:19:45 UTC
Size:
1.61 KB
patch
obsolete
>diff --git a/source3/smbd/open.c b/source3/smbd/open.c >index c1b29f6..fdfa999 100644 >--- a/source3/smbd/open.c >+++ b/source3/smbd/open.c >@@ -346,7 +346,7 @@ static NTSTATUS open_file(files_struct *fsp, > > if (!CAN_WRITE(conn)) { > /* It's a read-only share - fail if we wanted to write. */ >- if(accmode != O_RDONLY) { >+ if(accmode != O_RDONLY || (flags & O_TRUNC) || (flags & O_APPEND)) { > DEBUG(3,("Permission denied opening %s\n", path)); > return NT_STATUS_ACCESS_DENIED; > } else if(flags & O_CREAT) { >@@ -354,8 +354,8 @@ static NTSTATUS open_file(files_struct *fsp, > O_CREAT doesn't create the file if we have write > access into the directory. > */ >- flags &= ~O_CREAT; >- local_flags &= ~O_CREAT; >+ flags &= ~(O_CREAT|O_EXCL); >+ local_flags &= ~(O_CREAT|O_EXCL); > } > } > >diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c >index 1d95c20..d11bf08 100644 >--- a/source3/smbd/trans2.c >+++ b/source3/smbd/trans2.c >@@ -6870,16 +6870,20 @@ static void call_trans2setfilepathinfo(connection_struct *conn, > } > } > >- if (!CAN_WRITE(conn)) { >- reply_doserror(req, ERRSRV, ERRaccess); >- return; >- } >- > if (INFO_LEVEL_IS_UNIX(info_level) && !lp_unix_extensions()) { > reply_nterror(req, NT_STATUS_INVALID_LEVEL); > return; > } > >+ if (!CAN_WRITE(conn)) { >+ /* Allow POSIX opens. The open path will deny >+ * any non-readonly opens. */ >+ if (info_level != SMB_POSIX_PATH_OPEN) { >+ reply_doserror(req, ERRSRV, ERRaccess); >+ return; >+ } >+ } >+ > DEBUG(3,("call_trans2setfilepathinfo(%d) %s (fnum %d) info_level=%d totdata=%d\n", > tran_call,fname, fsp ? fsp->fnum : -1, info_level,total_data)); >
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:
jra
:
review+
Actions:
View
Attachments on
bug 6421
: 4222