summaryrefslogtreecommitdiff
path: root/source3/smbd/statcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/statcache.c')
-rw-r--r--source3/smbd/statcache.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c
index da52cc05d4..db347b5b7e 100644
--- a/source3/smbd/statcache.c
+++ b/source3/smbd/statcache.c
@@ -175,8 +175,7 @@ bool stat_cache_lookup(connection_struct *conn,
DATA_BLOB data_val;
char *name;
TALLOC_CTX *ctx = talloc_tos();
- struct smb_filename *smb_fname = NULL;
- NTSTATUS status;
+ struct smb_filename smb_fname;
*pp_dirpath = NULL;
*pp_start = *pp_name;
@@ -276,25 +275,18 @@ bool stat_cache_lookup(connection_struct *conn,
"-> [%s]\n", chk_name, translated_path ));
DO_PROFILE_INC(statcache_hits);
- status = create_synthetic_smb_fname(talloc_tos(), translated_path,
- NULL, NULL, &smb_fname);
- if (!NT_STATUS_IS_OK(status)) {
- TALLOC_FREE(chk_name);
- TALLOC_FREE(translated_path);
- return false;
- }
+ ZERO_STRUCT(smb_fname);
+ smb_fname.base_name = translated_path;
- if (SMB_VFS_STAT(conn, smb_fname) != 0) {
+ if (SMB_VFS_STAT(conn, &smb_fname) != 0) {
/* Discard this entry - it doesn't exist in the filesystem. */
memcache_delete(smbd_memcache(), STAT_CACHE,
data_blob_const(chk_name, strlen(chk_name)));
TALLOC_FREE(chk_name);
TALLOC_FREE(translated_path);
- TALLOC_FREE(smb_fname);
return False;
}
- *pst = smb_fname->st;
- TALLOC_FREE(smb_fname);
+ *pst = smb_fname.st;
if (!sizechanged) {
memcpy(*pp_name, translated_path,