summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-03-08 23:54:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:30 -0500
commit540911001d1bf25d9534b72b90a32fc7e5efc4b0 (patch)
treee9ed5f9507e4d8b4980aadcc12a71796a1a93192 /source3/lib/util.c
parenta39f08eec29235d9b09c169e3a95eba0484c7847 (diff)
downloadsamba-540911001d1bf25d9534b72b90a32fc7e5efc4b0.tar.gz
samba-540911001d1bf25d9534b72b90a32fc7e5efc4b0.tar.bz2
samba-540911001d1bf25d9534b72b90a32fc7e5efc4b0.zip
r21768: Fix the client dfs code such that smbclient can
process deep dfs links (ie. links that go to non root parts of a share). Make the directory handling conanonical in POSIX and Windows pathname processing. dfs should not be fully working in client tools. Please bug me if not. Jeremy. (This used to be commit 1c9e10569cd97ee41de39f9f012bea4e4c932b5d)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index b29f459c02..aa8aaa0628 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -579,6 +579,13 @@ void dos_clean_name(char *s)
/* remove any double slashes */
all_string_sub(s, "\\\\", "\\", 0);
+ /* Remove leading .\\ characters */
+ if(strncmp(s, ".\\", 2) == 0) {
+ trim_string(s, ".\\", NULL);
+ if(*s == 0)
+ pstrcpy(s,".\\");
+ }
+
while ((p = strstr_m(s,"\\..\\")) != NULL) {
pstring s1;
@@ -593,7 +600,6 @@ void dos_clean_name(char *s)
}
trim_string(s,NULL,"\\..");
-
all_string_sub(s, "\\.\\", "\\", 0);
}
@@ -631,6 +637,13 @@ void unix_clean_name(char *s)
}
trim_string(s,NULL,"/..");
+ all_string_sub(s, "/./", "/", 0);
+}
+
+void clean_name(char *s)
+{
+ dos_clean_name(s);
+ unix_clean_name(s);
}
/*******************************************************************