[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Apr 15 23:31:04 MDT 2015


The branch, master has been updated
       via  4491817 s3: smbd: Make sure we do not pass paths with ./ on the front to VFS routines.
      from  07d3ba4 Change the registry subsystem to use uint32_t from uint32. Also change session.h.

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


- Log -----------------------------------------------------------------
commit 449181768f5858587742476ec494af17a7108c34
Author: Richard Sharpe <rsharpe at samba.org>
Date:   Wed Apr 15 13:53:09 2015 -0700

    s3: smbd: Make sure we do not pass paths with ./ on the front to VFS routines.
    
    Signed-off-by: Richard Sharpe <rsharpe at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Apr 16 07:30:30 CEST 2015 on sn-devel-104

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

Summary of changes:
 source3/smbd/dir.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 073ac2f..3cddc4a 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -1068,6 +1068,7 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
 	connection_struct *conn = dirptr->conn;
 	size_t slashlen;
 	size_t pathlen;
+	bool dirptr_path_is_dot = ISDOT(dirptr->path);
 
 	*_smb_fname = NULL;
 	*_mode = 0;
@@ -1132,10 +1133,18 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
 			return false;
 		}
 
-		memcpy(pathreal, dirptr->path, pathlen);
-		pathreal[pathlen] = '/';
-		memcpy(pathreal + slashlen + pathlen, dname,
-		       talloc_get_size(dname));
+		/*
+		 * We don't want to pass ./xxx to modules below us so don't
+		 * add the path if it is just . by itself.
+		 */
+		if (dirptr_path_is_dot) {
+			memcpy(pathreal, dname, talloc_get_size(dname));
+		} else {
+			memcpy(pathreal, dirptr->path, pathlen);
+			pathreal[pathlen] = '/';
+			memcpy(pathreal + slashlen + pathlen, dname,
+			       talloc_get_size(dname));
+		}
 
 		/* Create smb_fname with NULL stream_name. */
 		smb_fname = (struct smb_filename) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list