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

Karolin Seeger kseeger at samba.org
Fri Dec 25 22:43:42 MST 2009


The branch, v3-3-test has been updated
       via  e3be5dd... Fix bug 7005 - mangle method = hash truncates files with dot '. ' character
      from  f249d2d... Fix bug #6939 - mangling method = hash breaks long filenames.

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


- Log -----------------------------------------------------------------
commit e3be5ddae764fae7ff4a3ef502e8461d0535bdc5
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Dec 21 21:16:15 2009 -0800

    Fix bug 7005 - mangle method = hash truncates files with dot '. ' character
    
    Don't change the contents of a const string via a pointer
    alias (or if you do, change it back.....).
    
    Jeremy.

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

Summary of changes:
 source/smbd/mangle_hash.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/mangle_hash.c b/source/smbd/mangle_hash.c
index 5de69e2..7073c3c 100644
--- a/source/smbd/mangle_hash.c
+++ b/source/smbd/mangle_hash.c
@@ -432,6 +432,13 @@ static void cache_mangled_name( const char mangled_name[13],
 		if( !s1[i] && !s2[i] ) {
 			/* Truncate at the '.' */
 			*s1 = '\0';
+			/*
+			 * DANGER WILL ROBINSON - this
+			 * is changing a const string via
+			 * an aliased pointer ! Remember to
+			 * put it back once we've used it.
+			 * JRA
+			 */
 			*s2 = '\0';
 		}
 	}
@@ -443,6 +450,8 @@ static void cache_mangled_name( const char mangled_name[13],
 	} else {
 		DEBUG(5,("cache_mangled_name: Stored entry %s -> %s\n", mangled_name_key, raw_name));
 	}
+	/* Restore the change we made to the const string. */
+	*s2 = '.';
 }
 
 /* ************************************************************************** **


-- 
Samba Shared Repository


More information about the samba-cvs mailing list