Bug 15751 - copy_chunk on POSIX handle fails with STATUS_INVALID_HANDLE
Summary: copy_chunk on POSIX handle fails with STATUS_INVALID_HANDLE
Status: ASSIGNED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Ralph Böhme
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-11 10:02 UTC by Ralph Böhme
Modified: 2024-11-11 10:02 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2024-11-11 10:02:28 UTC
Samba master if mount with "posix" then FSCTL_SRV_COPYCHUNK_WRITE will return "STATUS_INVALID_HANDLE" where the same thing works fine if you mount without "posix".

Client requests an access_mask including FILE_APPEND_DATA on the destination handle which lets us take the true path in this if condition

        if (posix_open && (access_mask & FILE_APPEND_DATA)) {
                flags |= O_APPEND;
        } 

so we open the destination file with O_APPEND. This then failes in copy_file_range() because O_APPEND is not allowed on the destination file handle.