[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Mon Nov 7 13:12:01 MST 2011


The branch, master has been updated
       via  60b7dae Add the SEC_DIR_LIST check to dptr_create().
      from  ce8b5d5 s4:samba-tool - fix Gémes Géza patch regarding parameter handling

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 60b7dae3fad482c2dabd6c0569e99cd23838d824
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Nov 4 16:46:47 2011 -0700

    Add the SEC_DIR_LIST check to dptr_create().
    
    Autobuild-User: Jeremy Allison <jra at samba.org>
    Autobuild-Date: Mon Nov  7 21:11:03 CET 2011 on sn-devel-104

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

Summary of changes:
 source3/smbd/dir.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index a11c131..322c2fe 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -452,6 +452,33 @@ NTSTATUS dptr_create(connection_struct *conn, files_struct *fsp,
 		}
 		dir_hnd = OpenDir_fsp(NULL, conn, fsp, wcard, attr);
 	} else {
+		int ret;
+		struct smb_filename *smb_dname = NULL;
+		NTSTATUS status = create_synthetic_smb_fname(talloc_tos(),
+						path,
+						NULL,
+						NULL,
+						&smb_dname);
+		if (!NT_STATUS_IS_OK(status)) {
+			return status;
+		}
+		if (lp_posix_pathnames()) {
+			ret = SMB_VFS_LSTAT(conn, smb_dname);
+		} else {
+			ret = SMB_VFS_STAT(conn, smb_dname);
+		}
+		if (ret == -1) {
+			return map_nt_error_from_unix(errno);
+		}
+		if (!S_ISDIR(smb_dname->st.st_ex_mode)) {
+			return NT_STATUS_NOT_A_DIRECTORY;
+		}
+		status = smbd_check_access_rights(conn,
+						smb_dname,
+						SEC_DIR_LIST);
+		if (!NT_STATUS_IS_OK(status)) {
+			return status;
+		}
 		dir_hnd = OpenDir(NULL, conn, path, wcard, attr);
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list