]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: remove seperate flag FSP_POSIX_FLAGS_PATHNAMES
authorRalph Boehme <slow@samba.org>
Fri, 4 Oct 2024 17:05:36 +0000 (19:05 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 25 Oct 2024 10:42:32 +0000 (10:42 +0000)
Essentially FSP_POSIX_FLAGS_OPEN implies FSP_POSIX_FLAGS_PATHNAMES, so we can
just remove FSP_POSIX_FLAGS_PATHNAMES and simplify things.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/include/vfs.h
source3/modules/vfs_acl_common.c
source3/smbd/files.c
source3/smbd/smb2_reply.c

index 1d4f78e3733a4cc86fa149f4728c4165f9b63b74..522bf6e4fe49b53de2538d39c0234bdb1f17fb8b 100644 (file)
@@ -685,11 +685,9 @@ typedef struct files_struct {
  */
 
 #define FSP_POSIX_FLAGS_OPEN           0x01
-#define FSP_POSIX_FLAGS_PATHNAMES      0x04
 
 #define FSP_POSIX_FLAGS_ALL                    \
-       (FSP_POSIX_FLAGS_OPEN |                 \
-        FSP_POSIX_FLAGS_PATHNAMES)
+       FSP_POSIX_FLAGS_OPEN
 
 struct vuid_cache_entry {
        struct auth_session_info *session_info;
@@ -893,7 +891,7 @@ struct smb_filename {
  * to keep the numeric values consistent.
  */
 
-#define SMB_FILENAME_POSIX_PATH                FSP_POSIX_FLAGS_PATHNAMES
+#define SMB_FILENAME_POSIX_PATH                FSP_POSIX_FLAGS_OPEN
 
 enum vfs_translate_direction {
        vfs_translate_to_unix = 0,
index e04b672cf9ae7ddb2f561ba7f85217d49d9426c9..f38029cf221b4967ee5fdbc5e19235a789aa3ce4 100644 (file)
@@ -1172,7 +1172,7 @@ int unlink_acl_common(struct vfs_handle_struct *handle,
 int fchmod_acl_module_common(struct vfs_handle_struct *handle,
                             struct files_struct *fsp, mode_t mode)
 {
-       if (fsp->posix_flags & FSP_POSIX_FLAGS_PATHNAMES
+       if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN
            || fsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH) {
                /* Only allow this on POSIX opens. */
                return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
index 50bf9b588517059e06bce8b969514a281d88a561..dcb6c286d8dee30999455d32002886e296d0153e 100644 (file)
@@ -2625,7 +2625,7 @@ static bool fsp_generic_ask_sharemode(struct files_struct *fsp)
                return false;
        }
 
-       if (fsp->posix_flags & FSP_POSIX_FLAGS_PATHNAMES) {
+       if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
                /* Always use filesystem for UNIX mtime query. */
                return false;
        }
index 98377547bb3659e3748e01f505002fd0c1916b37..8c314360b4aad5874e1eb1fa19365cbec6454121 100644 (file)
@@ -1470,7 +1470,7 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
                 * can check them separately.
                 */
 
-               if (fsp->posix_flags & FSP_POSIX_FLAGS_PATHNAMES) {
+               if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
                        /* POSIX - no stream component. */
                        orig_lcomp_path = talloc_strdup(ctx,
                                                dst_original_lcomp);