summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-03-04 22:24:07 +0000
committerJeremy Allison <jra@samba.org>1998-03-04 22:24:07 +0000
commitf3eeb2f1fa528b0d952d2519f719d30f4a2489fa (patch)
treebdc2c9fb6841f8cdf026e5c11babd76d81c8fcd4 /source3
parent3fb9f9db569e0fe02777e1e7805f20e668309cfe (diff)
downloadsamba-f3eeb2f1fa528b0d952d2519f719d30f4a2489fa.tar.gz
samba-f3eeb2f1fa528b0d952d2519f719d30f4a2489fa.tar.bz2
samba-f3eeb2f1fa528b0d952d2519f719d30f4a2489fa.zip
Removed broken change I made to mangle.c (ooops. Andrew's original
algorithm was correct). Finally (I think) fixed the mangled directory stack issue in scan_directory() correctly. Mangled & non-mangled names are now being checked correctly. Hurrah to Ulrik Dickow <ukd@kampsax.dk> who helped isolate this one. Jeremy. (This used to be commit 37f5f7b557aa59c7eba4a9f2f2f323d7cec62fc7)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/mangle.c2
-rw-r--r--source3/smbd/server.c11
2 files changed, 4 insertions, 9 deletions
diff --git a/source3/smbd/mangle.c b/source3/smbd/mangle.c
index d0d5ada247..8aa53bc35a 100644
--- a/source3/smbd/mangle.c
+++ b/source3/smbd/mangle.c
@@ -42,7 +42,7 @@ int str_checksum(char *s)
while( *s )
{
c = *s;
- res ^= (c << (15-(i%15))) ^ (c >> (i % 15));
+ res ^= (c << (i % 15)) ^ (c >> (15-(i%15)));
s++; i++;
}
return(res);
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index e6807bdf31..e290027d0a 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -456,11 +456,7 @@ static BOOL scan_directory(char *path, char *name,int cnum,BOOL docache)
return(True);
}
-#if 0
- /*
- * This code I believe is incorrect - and commenting it out
- * is the correct fix for the bug mentioned below in the
- * comment 'name2 here was changed to dname - since 1.9.16p2 - not sure of reason (jra)'.
+ /*
* The incoming name can be mangled, and if we de-mangle it
* here it will not compare correctly against the filename (name2)
* read from the directory and then mangled by the name_map_mangle()
@@ -468,8 +464,7 @@ static BOOL scan_directory(char *path, char *name,int cnum,BOOL docache)
* (JRA).
*/
if (mangled)
- check_mangled_stack(name);
-#endif
+ mangled = !check_mangled_stack(name);
/* open the directory */
if (!(cur_dir = OpenDir(cnum, path, True)))
@@ -489,7 +484,7 @@ static BOOL scan_directory(char *path, char *name,int cnum,BOOL docache)
if (!name_map_mangle(name2,False,SNUM(cnum))) continue;
if ((mangled && mangled_equal(name,name2))
- || fname_equal(name, name2)) /* name2 here was changed to dname - since 1.9.16p2 - not sure of reason (jra) */
+ || fname_equal(name, name2))
{
/* we've found the file, change it's name and return */
if (docache) DirCacheAdd(path,name,dname,SNUM(cnum));