diff options
author | Gerald Carter <jerry@samba.org> | 2000-12-11 22:51:57 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2000-12-11 22:51:57 +0000 |
commit | 93e98d02818e079c9d714e3b5a7894238ead312a (patch) | |
tree | eef48b628ab38abf901a91dac501d101072f48e5 /source3 | |
parent | 60337746ea0d0f324ec39a16e3b8bee836b8ef51 (diff) | |
download | samba-93e98d02818e079c9d714e3b5a7894238ead312a.tar.gz samba-93e98d02818e079c9d714e3b5a7894238ead312a.tar.bz2 samba-93e98d02818e079c9d714e3b5a7894238ead312a.zip |
subtle bug where files which missed the stat_cache but were added
to the cache during the look returned a blank stat struct. Made
weird occurrences such as...
$ smbclient //pogo/print$
smb:\ > cd w32x86
ERROR: Invalid path
smb:\ > cd w32x86
smb:\w32x86\ >
(This used to be commit 8938dc183112b039c21a5a0beadb60068a8c5b00)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/filename.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index aedd2e820f..4962297428 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -387,20 +387,17 @@ BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, } /* - * Don't cache a name with mangled or wildcard components - * as this can change the size. - */ - - if(!component_was_mangled && !name_has_wildcard) - stat_cache_add(orig_path, name); - - /* + * If we get to here, the filename should have ben added + * to the stat_cache. Therefore a stat_cache_lookup() is needed here + * to fill in the SMB_STRUCT_STAT. + * * If we ended up resolving the entire path then return a valid * stat struct if we got one. */ - - if (VALID_STAT(st) && (strlen(orig_path) == strlen(name))) + if (stat_cache_lookup(conn, name, dirpath, &start, &st) + && (strlen(orig_path) == strlen(name))) { *pst = st; + } /* * The name has been resolved. |