[SCM] Samba Shared Repository - branch v3-6-test updated

Karolin Seeger kseeger at samba.org
Fri Sep 28 00:39:43 MDT 2012


The branch, v3-6-test has been updated
       via  d0eb11f Fix bug #9189 - SMB2 Create doesn't return correct MAX ACCESS access mask in blob.
       via  0a1f8e7 Add some const to can_delete_file_in_directory().
      from  16a3b6e quota: add supprt for gfs2

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit d0eb11f521fb21dc0eed4279101e41102a123757
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Sep 24 16:43:12 2012 -0700

    Fix bug #9189 - SMB2 Create doesn't return correct MAX ACCESS access mask in blob.
    
    If we aren't already granted DELETE access, check if we have
    DELETE_CHILD in the containing directory.

commit 0a1f8e7de939c7eb71cfa8cc8f8eef4800d00b78
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Sep 24 16:42:57 2012 -0700

    Add some const to can_delete_file_in_directory().

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/file_access.c |    2 +-
 source3/smbd/open.c        |    6 ++++++
 source3/smbd/proto.h       |    2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/file_access.c b/source3/smbd/file_access.c
index bd65a70..1f5ee4f 100644
--- a/source3/smbd/file_access.c
+++ b/source3/smbd/file_access.c
@@ -87,7 +87,7 @@ bool can_access_file_acl(struct connection_struct *conn,
 ****************************************************************************/
 
 bool can_delete_file_in_directory(connection_struct *conn,
-				  struct smb_filename *smb_fname)
+				  const struct smb_filename *smb_fname)
 {
 	TALLOC_CTX *ctx = talloc_tos();
 	char *dname = NULL;
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 7d6a25f..6b94a6d 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1410,6 +1410,12 @@ NTSTATUS smbd_calculate_access_mask(connection_struct *conn,
 				return NT_STATUS_ACCESS_DENIED;
 			}
 
+			if (!(access_granted & DELETE_ACCESS)) {
+				if (can_delete_file_in_directory(conn, smb_fname)) {
+					access_granted |= DELETE_ACCESS;
+				}
+			}
+
 			access_mask = access_granted;
 		} else {
 			access_mask = FILE_GENERIC_ALL;
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index e80e01e..d6f7511 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -301,7 +301,7 @@ bool can_access_file_acl(struct connection_struct *conn,
 			 const struct smb_filename *smb_fname,
 			 uint32_t access_mask);
 bool can_delete_file_in_directory(connection_struct *conn,
-				  struct smb_filename *smb_fname);
+				  const struct smb_filename *smb_fname);
 bool can_access_file_data(connection_struct *conn,
 			  const struct smb_filename *smb_fname,
 			  uint32 access_mask);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list