diff options
author | Jeremy Allison <jra@samba.org> | 2000-12-12 00:11:34 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-12-12 00:11:34 +0000 |
commit | 4c639caa1f16dae804c4736eb59ffb65ccd15278 (patch) | |
tree | fcb19291bda942f74bce499381a8dc222f6d7cc5 | |
parent | 71acf4cd1f80b1c8cb78aa0f36cc23d185c7fac3 (diff) | |
download | samba-4c639caa1f16dae804c4736eb59ffb65ccd15278.tar.gz samba-4c639caa1f16dae804c4736eb59ffb65ccd15278.tar.bz2 samba-4c639caa1f16dae804c4736eb59ffb65ccd15278.zip |
Sorry Gerald, I think the original code was better (plus safer as I'm sure
it's working :-).
Jeremy.
(This used to be commit e18c104ee35d00dcbe2e73e6c9699300a3947364)
-rw-r--r-- | source3/smbd/filename.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 4962297428..aedd2e820f 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -387,17 +387,20 @@ BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, } /* - * 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. - * + * 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 ended up resolving the entire path then return a valid * stat struct if we got one. */ - if (stat_cache_lookup(conn, name, dirpath, &start, &st) - && (strlen(orig_path) == strlen(name))) { + + if (VALID_STAT(st) && (strlen(orig_path) == strlen(name))) *pst = st; - } /* * The name has been resolved. |