]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Pass fsp instead of filename for parent to possibly_set_archive()
authorVolker Lendecke <vl@samba.org>
Wed, 17 Sep 2025 13:57:42 +0000 (06:57 -0700)
committerRalph Boehme <slow@samba.org>
Tue, 21 Oct 2025 17:33:29 +0000 (17:33 +0000)
Lift the ->fsp dereference up one level

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/open.c

index 13a6e57f39eddd14d8da94caef782d291227292e..02a3f6631e969e9cb2579017996cc2953aaa69ad 100644 (file)
@@ -3513,7 +3513,7 @@ static void open_ntcreate_lock_cleanup_entry(struct share_mode_lock *lck,
 static void possibly_set_archive(struct connection_struct *conn,
                                 struct files_struct *fsp,
                                 struct smb_filename *smb_fname,
-                                struct smb_filename *parent_dir_fname,
+                                struct files_struct *dirfsp,
                                 int info,
                                 uint32_t dosattrs,
                                 mode_t *unx_mode)
@@ -3538,7 +3538,7 @@ static void possibly_set_archive(struct connection_struct *conn,
        ret = file_set_dosmode(conn,
                               smb_fname,
                               dosattrs | FILE_ATTRIBUTE_ARCHIVE,
-                              parent_dir_fname->fsp,
+                              dirfsp,
                               true);
        if (ret != 0) {
                return;
@@ -4254,7 +4254,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
        possibly_set_archive(conn,
                             fsp,
                             smb_fname,
-                            parent_dir_fname,
+                            parent_dir_fname->fsp,
                             info,
                             new_dos_attributes,
                             &unx_mode);