]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: add vfs_stat()
authorRalph Boehme <slow@samba.org>
Fri, 16 Oct 2020 12:35:10 +0000 (14:35 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:31 +0000 (09:08 +0000)
Deals with POSIX paths and either calls lstat() for POSIX or stat().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/proto.h
source3/smbd/vfs.c

index 1924762b8ba98f43336910593445f87358532872..6192e22fda6c63f199e8d3c4977734d0612c998d 100644 (file)
@@ -1298,6 +1298,8 @@ NTSTATUS check_reduced_name(connection_struct *conn,
 NTSTATUS check_reduced_name_with_privilege(connection_struct *conn,
                        const struct smb_filename *smb_fname,
                        struct smb_request *smbreq);
+int vfs_stat(struct connection_struct *conn,
+            struct smb_filename *smb_fname);
 int vfs_stat_smb_basename(struct connection_struct *conn,
                        const struct smb_filename *smb_fname_in,
                        SMB_STRUCT_STAT *psbuf);
index 3e30805b6907dd7c4fba8f886370cb267f07bf50..45e1b9989bcbab62fee67fc1e18e2dd5de3fee59 100644 (file)
@@ -1492,6 +1492,18 @@ NTSTATUS check_reduced_name(connection_struct *conn,
        return NT_STATUS_OK;
 }
 
+/*
+ * Ensure LSTAT is called for POSIX paths.
+ */
+int vfs_stat(struct connection_struct *conn,
+            struct smb_filename *smb_fname)
+{
+       if (smb_fname->flags & SMB_FILENAME_POSIX_PATH) {
+               return SMB_VFS_LSTAT(conn, smb_fname);
+       }
+       return SMB_VFS_STAT(conn, smb_fname);
+}
+
 /**
  * XXX: This is temporary and there should be no callers of this once
  * smb_filename is plumbed through all path based operations.