]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Temporarily add protection to get_ea_value() for fsp==NULL and smb_fname...
authorJeremy Allison <jra@samba.org>
Wed, 23 Jun 2021 00:31:41 +0000 (17:31 -0700)
committerRalph Boehme <slow@samba.org>
Fri, 25 Jun 2021 15:53:31 +0000 (15:53 +0000)
This will go away once get_ea_value() is fully handle-based
and renamed to get_ea_value_fsp().

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

index 5c4f60821c9670bb18d8d318335ab63303a481c5..40391a4a9c17e15cac058cfe96f2b5a7313b30a6 100644 (file)
@@ -245,6 +245,14 @@ NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx,
        if (fsp) {
                sizeret = SMB_VFS_FGETXATTR(fsp, ea_name, val, attr_size);
        } else {
+               if (smb_fname == NULL) {
+                       /*
+                        * fsp == NULL and smb_fname == NULL.
+                        * This check will go away once get_ea_value()
+                        * is completely fsp-based.
+                        */
+                       return NT_STATUS_INVALID_HANDLE;
+               }
                sizeret = SMB_VFS_GETXATTR(conn, smb_fname,
                                ea_name, val, attr_size);
        }