]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: In openat_pathref_dirfsp_nosymlink() ensure we call fsp_smb_fname_link...
authorJeremy Allison <jra@samba.org>
Tue, 26 Jul 2022 21:29:21 +0000 (14:29 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 27 Jul 2022 16:51:34 +0000 (16:51 +0000)
Instead of just assigning smb_fname->fsp = fsp.

This makes the logic match that of openat_pathref_fullname() and parent_pathref()
when returning smb_fnames with associated pathref fsp's.

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

index 5d8e292714f5d3365b266b41692e78572c4a566f..9a81a16b3ec745584c4bcf79d5c143939ff44870 100644 (file)
@@ -944,7 +944,12 @@ next:
                goto nomem;
        }
 
-       result->fsp = fsp;
+       status = fsp_smb_fname_link(fsp,
+                                       &result->fsp_link,
+                                       &result->fsp);
+       if (!NT_STATUS_IS_OK(status)) {
+               goto fail;
+       }
        talloc_set_destructor(result, smb_fname_fsp_destructor);
 
        *_smb_fname = result;