summaryrefslogtreecommitdiff
path: root/source3/smbd/filename.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-03-03 20:55:40 +0000
committerJeremy Allison <jra@samba.org>2004-03-03 20:55:40 +0000
commit74307e350635a195ebaa4841651f555c27fbcff4 (patch)
treebcb6a413835d4a81aa8e08cde73b1125eca5b5a0 /source3/smbd/filename.c
parent0dd6ea2f3a18290283a62888c9fa702aa343eed2 (diff)
downloadsamba-74307e350635a195ebaa4841651f555c27fbcff4.tar.gz
samba-74307e350635a195ebaa4841651f555c27fbcff4.tar.bz2
samba-74307e350635a195ebaa4841651f555c27fbcff4.zip
Use a common function to parse all pathnames from the wire. This allows
much closer emulation of Win2k3 error return codes. Jeremy. (This used to be commit 883f89a0184e37bff4f5877a25d31b994996ab08)
Diffstat (limited to 'source3/smbd/filename.c')
-rw-r--r--source3/smbd/filename.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 643e315c06..a71e8a806c 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -114,29 +114,30 @@ BOOL unix_convert(pstring name,connection_struct *conn,char *saved_last_componen
DEBUG(5, ("unix_convert called on file \"%s\"\n", name));
/*
- * Convert to basic unix format - removing \ chars and cleaning it up.
+ * Conversion to basic unix format is already done in check_path_syntax().
*/
- unix_format(name);
- unix_clean_name(name);
-
/*
- * Names must be relative to the root of the service - trim any leading /.
- * also trim trailing /'s.
+ * Names must be relative to the root of the service - any leading /.
+ * and trailing /'s should have been trimmed by check_path_syntax().
*/
- trim_char(name,'/','/');
+#ifdef DEVELOPER
+ SMB_ASSERT(*name != '/');
+#endif
/*
* If we trimmed down to a single '\0' character
* then we should use the "." directory to avoid
* searching the cache, but not if we are in a
* printing share.
+ * As we know this is valid we can return true here.
*/
if (!*name) {
name[0] = '.';
name[1] = '\0';
+ return(True);
}
/*
@@ -154,19 +155,7 @@ BOOL unix_convert(pstring name,connection_struct *conn,char *saved_last_componen
if (!case_sensitive && (!case_preserve || (mangle_is_8_3(name, False) && !short_case_preserve)))
strnorm(name);
- /*
- * If we trimmed down to a single '\0' character
- * then we will be using the "." directory.
- * As we know this is valid we can return true here.
- */
-
- if(!*name)
- return(True);
-
start = name;
- while (start[0] == '.' && start[1] == '/')
- start += 2;
-
pstrcpy(orig_path, name);
if(!case_sensitive && stat_cache_lookup(conn, name, dirpath, &start, &st)) {