summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-11-22 16:21:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:31 -0500
commit056f06915e9c667393046a674581754d8a581d29 (patch)
tree65307d39d34b177b8018e9bbdc03b06049f74b60 /source3
parentf2ecd4fed0ed11b73fa330588501a0ac37583174 (diff)
downloadsamba-056f06915e9c667393046a674581754d8a581d29.tar.gz
samba-056f06915e9c667393046a674581754d8a581d29.tar.bz2
samba-056f06915e9c667393046a674581754d8a581d29.zip
r11861: Fix inspired by Thomas Neumann <t.neumann@iku-ag.de> to ensure that
default case applies only to new files and correctly examines 8.3 and long names. Jeremy. (This used to be commit ba931a015132f7e8fffa52c617cd8345a1da35d2)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/filename.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index b389b9c1ae..2ee8ba1e4f 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -150,9 +150,6 @@ BOOL unix_convert(pstring name,connection_struct *conn,char *saved_last_componen
pstrcpy(saved_last_component, name);
}
- if (!conn->case_preserve || (mangle_is_8_3(name, False, SNUM(conn)) && !conn->short_case_preserve))
- strnorm(name, lp_defaultcase(SNUM(conn)));
-
start = name;
pstrcpy(orig_path, name);
@@ -301,16 +298,17 @@ BOOL unix_convert(pstring name,connection_struct *conn,char *saved_last_componen
return(False);
}
- /*
+ /*
* Just the last part of the name doesn't exist.
- * We may need to strupper() or strlower() it in case
- * this conversion is being used for file creation
- * purposes. If the filename is of mixed case then
- * don't normalise it.
+ * We need to strupper() or strlower() it as
+ * this conversion may be used for file creation
+ * purposes. Fix inspired by Thomas Neumann <t.neumann@iku-ag.de>.
*/
-
- if (!conn->case_preserve && (!strhasupper(start) || !strhaslower(start)))
+ if (!conn->case_preserve ||
+ (mangle_is_8_3(start, False, SNUM(conn)) &&
+ !conn->short_case_preserve)) {
strnorm(start, lp_defaultcase(SNUM(conn)));
+ }
/*
* check on the mangled stack to see if we can recover the