1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

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 64a16d9c2a)
This commit is contained in:
Samba Release Account 1997-02-13 20:36:58 +00:00
parent 2cf19029f0
commit d557ec0462

View File

@ -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);
}