The Samba-Bugzilla – Attachment 6149 Details for
Bug 7815
sparse bit handling needs to be more windows-like
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
0008-Move-checks-inside-file_set_sparse-to-allow-it-to-be.patch
0008-Move-checks-inside-file_set_sparse-to-allow-it-to-be.patch (text/plain), 2.73 KB, created by
Jeremy Allison
on 2010-12-17 14:27:30 UTC
(
hide
)
Description:
0008-Move-checks-inside-file_set_sparse-to-allow-it-to-be.patch
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2010-12-17 14:27:30 UTC
Size:
2.73 KB
patch
obsolete
>From 5726a37474a200a5b7bf3fd24cc3caa33ad8fb11 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Thu, 16 Dec 2010 16:50:31 -0800 >Subject: [PATCH 8/8] Move checks inside file_set_sparse() to allow it to be called from anywhere. > >--- > source3/smbd/dosmode.c | 22 +++++++++++++++++++++- > source3/smbd/nttrans.c | 18 ------------------ > 2 files changed, 21 insertions(+), 19 deletions(-) > >diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c >index 86f7807..628f887 100644 >--- a/source3/smbd/dosmode.c >+++ b/source3/smbd/dosmode.c >@@ -20,6 +20,7 @@ > > #include "includes.h" > #include "librpc/gen_ndr/ndr_xattr.h" >+#include "../libcli/security/security.h" > > static uint32_t filter_mode_by_protocol(uint32_t mode) > { >@@ -855,6 +856,25 @@ NTSTATUS file_set_sparse(connection_struct *conn, > uint32_t new_dosmode; > NTSTATUS status; > >+ if (!CAN_WRITE(conn)) { >+ DEBUG(9,("file_set_sparse: fname[%s] set[%u] " >+ "on readonly share[%s]\n", >+ smb_fname_str_dbg(fsp->fsp_name), >+ sparse, >+ lp_servicename(SNUM(conn)))); >+ return NT_STATUS_MEDIA_WRITE_PROTECTED; >+ } >+ >+ if (!(fsp->access_mask & FILE_WRITE_DATA) && >+ !(fsp->access_mask & FILE_WRITE_ATTRIBUTES)) { >+ DEBUG(9,("file_set_sparse: fname[%s] set[%u] " >+ "access_mask[0x%08X] - access denied\n", >+ smb_fname_str_dbg(fsp->fsp_name), >+ sparse, >+ fsp->access_mask)); >+ return NT_STATUS_ACCESS_DENIED; >+ } >+ > DEBUG(10,("file_set_sparse: setting sparse bit %u on file %s\n", > sparse, smb_fname_str_dbg(fsp->fsp_name))); > >@@ -888,7 +908,7 @@ NTSTATUS file_set_sparse(connection_struct *conn, > > notify_fname(conn, NOTIFY_ACTION_MODIFIED, > FILE_NOTIFY_CHANGE_ATTRIBUTES, >- smb_fname->base_name); >+ fsp->fsp_name->base_name); > > return NT_STATUS_OK; > } >diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c >index 55804b9..cccb47a 100644 >--- a/source3/smbd/nttrans.c >+++ b/source3/smbd/nttrans.c >@@ -2122,24 +2122,6 @@ static void call_nt_transact_ioctl(connection_struct *conn, > return; > } > >- if (!CAN_WRITE(conn)) { >- DEBUG(9,("FSCTL_SET_SPARSE: fname[%s] set[%u] " >- "on readonly share[%s]\n", >- smb_fname_str_dbg(fsp->fsp_name), set_sparse, >- lp_servicename(SNUM(conn)))); >- reply_nterror(req, NT_STATUS_MEDIA_WRITE_PROTECTED); >- return; >- } >- >- if (!(fsp->access_mask & FILE_WRITE_DATA) && >- !(fsp->access_mask & FILE_WRITE_ATTRIBUTES)) { >- DEBUG(9,("FSCTL_SET_SPARSE: fname[%s] set[%u] " >- "access_mask[0x%08X] - access denied\n", >- smb_fname_str_dbg(fsp->fsp_name), set_sparse, fsp->access_mask)); >- reply_nterror(req, NT_STATUS_ACCESS_DENIED); >- return; >- } >- > status = file_set_sparse(conn, fsp, set_sparse); > if (!NT_STATUS_IS_OK(status)) { > DEBUG(9,("FSCTL_SET_SPARSE: fname[%s] set[%u] - %s\n", >-- >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
Actions:
View
Attachments on
bug 7815
:
6139
|
6140
|
6141
|
6142
|
6143
|
6144
|
6145
|
6146
|
6147
|
6148
| 6149 |
6150
|
6155