diff options
author | Samba Release Account <samba-bugs@samba.org> | 1997-02-13 20:36:58 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1997-02-13 20:36:58 +0000 |
commit | 64a16d9c2aae0405437f28dbb00e68080c09a7a1 (patch) | |
tree | c409b9ae13ea9b7c9f2ddc3869c994ef508a39dc /source/lib/util.c | |
parent | a8b58121074bcc2ecce4a45a4346a6d13704b21c (diff) | |
download | samba-64a16d9c2aae0405437f28dbb00e68080c09a7a1.tar.gz |
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
Diffstat (limited to 'source/lib/util.c')
-rw-r--r-- | source/lib/util.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/lib/util.c b/source/lib/util.c index 44184f8d468..a43de46c511 100644 --- a/source/lib/util.c +++ b/source/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); } |