diff options
author | Jeremy Allison <jra@samba.org> | 2004-03-05 01:37:12 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2004-03-05 01:37:12 +0000 |
commit | 893d5eba5d17a1efe600d67c0e82b401ead248ce (patch) | |
tree | 18b4fd6d5303ced1c0ed0d0b0f0ecc031c0957c0 /source3/smbd/filename.c | |
parent | 4020fadb1af8823d9341faa58920477485d888e5 (diff) | |
download | samba-893d5eba5d17a1efe600d67c0e82b401ead248ce.tar.gz samba-893d5eba5d17a1efe600d67c0e82b401ead248ce.tar.xz samba-893d5eba5d17a1efe600d67c0e82b401ead248ce.zip |
all_string_sub() is broken as it doesn't handle mb chars correctly (and
so breaks when substitution '/' and '\'). It's used by unix_clean_name(),
which is used by reduce_name, which is used by check_name() (phew!).
Now that we know all filenames passed to check_name() are in a "good"
format (no double slashes, all '\\' chars translated to '/' etc.) due
to the new check_path_syntax() we can avoid calling reduce_name unless
widelinks are denied. After this check-in I can fix all_string_sub() to
handle mb chars correctly as it won't be in the direct path in the
main path handling code.
Jeremy.
(This used to be commit 6080186fc4c2e7c59dd12a177539bfb77eb525cb)
Diffstat (limited to 'source3/smbd/filename.c')
-rw-r--r-- | source3/smbd/filename.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index a71e8a806c1..8300674d614 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -387,7 +387,7 @@ BOOL unix_convert(pstring name,connection_struct *conn,char *saved_last_componen BOOL check_name(pstring name,connection_struct *conn) { - BOOL ret; + BOOL ret = True; errno = 0; @@ -398,7 +398,9 @@ BOOL check_name(pstring name,connection_struct *conn) } } - ret = reduce_name(conn,name,conn->connectpath,lp_widelinks(SNUM(conn))); + if (!lp_widelinks(SNUM(conn))) { + ret = reduce_name(conn,name,conn->connectpath); + } /* Check if we are allowing users to follow symlinks */ /* Patch from David Clerc <David.Clerc@cui.unige.ch> |