From d557ec04622a7c461e77f9a3aff27c2222f7beba Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 13 Feb 1997 20:36:58 +0000 Subject: 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) --- source3/lib/util.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/lib/util.c b/source3/lib/util.c index 44184f8d468..a43de46c511 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); } -- cgit