smbd: Don't use "sbuf" in smbd_dirptr_get_entry()
authorVolker Lendecke <vl@samba.org>
Tue, 20 Jun 2023 10:03:35 +0000 (12:03 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 23 Jun 2023 17:34:30 +0000 (17:34 +0000)
openat_pathref_fsp() does not need this anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/dir.c

index ef3230b047d5a2d710904735be330b4c73c0d03d..0daa1d16c9890364fc254c5163faad2743acadb8 100644 (file)
@@ -536,7 +536,6 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
        const char *dpath = dir_hnd->dir_smb_fname->base_name;
        bool dirptr_path_is_dot = ISDOT(dpath);
        NTSTATUS status;
-       int ret;
 
        *_smb_fname = NULL;
        *_mode = 0;
@@ -633,7 +632,7 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
                smb_fname = synthetic_smb_fname(talloc_tos(),
                                                pathreal,
                                                NULL,
-                                               &sbuf,
+                                               NULL,
                                                dir_hnd->dir_smb_fname->twrp,
                                                dir_hnd->dir_smb_fname->flags);
                TALLOC_FREE(pathreal);
@@ -643,27 +642,11 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
                        return false;
                }
 
-               if (!VALID_STAT(smb_fname->st)) {
-                       /*
-                        * If stat() fails with ENOENT it might be a
-                        * msdfs-symlink in Windows context, this is checked
-                        * below, for now we just want to fill stat info as good
-                        * as we can.
-                        */
-                       ret = vfs_stat(conn, smb_fname);
-                       if (ret != 0 && errno != ENOENT) {
-                               TALLOC_FREE(smb_fname);
-                               TALLOC_FREE(dname);
-                               TALLOC_FREE(fname);
-                               continue;
-                       }
-               }
-
                /* Create smb_fname with NULL stream_name. */
                atname = synthetic_smb_fname(talloc_tos(),
                                             dname,
                                             NULL,
-                                            &smb_fname->st,
+                                            NULL,
                                             dir_hnd->dir_smb_fname->twrp,
                                             dir_hnd->dir_smb_fname->flags);
                if (atname == NULL) {