summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1997-02-13 20:36:58 +0000
committerSamba Release Account <samba-bugs@samba.org>1997-02-13 20:36:58 +0000
commitd557ec04622a7c461e77f9a3aff27c2222f7beba (patch)
tree1114d7d4ec2205dace7f9e959f215be154c4b357 /source3
parent2cf19029f0c2f28636021b8fc6571a2ba912c054 (diff)
downloadsamba-d557ec04622a7c461e77f9a3aff27c2222f7beba.tar.gz
samba-d557ec04622a7c461e77f9a3aff27c2222f7beba.tar.bz2
samba-d557ec04622a7c461e77f9a3aff27c2222f7beba.zip
Fixed bugs in my YOST replacement code. Doing a trim_string
in unix_clean_name caused directory names to go from ./ to "". This is now checked for, unix_clean name returns ./ in these cases. jra@cygnus.com (This used to be commit 64a16d9c2aae0405437f28dbb00e68080c09a7a1)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 44184f8d46..a43de46c51 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1185,7 +1185,11 @@ void unix_clean_name(char *s)
string_sub(s, "//","/");
/* Remove leading ./ characters */
- trim_string(s, "./", NULL);
+ if(strncmp(s, "./", 2) == 0) {
+ trim_string(s, "./", NULL);
+ if(*s == 0)
+ strcpy(s,"./");
+ }
while ((p = strstr(s,"/../")) != NULL)
{
@@ -1381,6 +1385,10 @@ BOOL reduce_name(char *s,char *dir,BOOL widelinks)
DEBUG(3,("Illegal file name? (%s)\n",s));
return(False);
}
+
+ if (strlen(s) == 0)
+ strcpy(s,"./");
+
return(True);
}