Does Samba 4.3.11 support for opening file with “APPEND” mode?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Does Samba 4.3.11 support for opening file with “APPEND” mode?

Samba - General mailing list

I set a file's inode.i_flags to "S_APPEND" in linux kernel, so the
file can only be opened with 'append' mode. In linux system it works
fine as expected. Like, echo "test" > append.txt, permission deny.
echo "test" >> append.txt, OK.

I share the directory to windows with samba server running on Ubuntu
14.4 and the directory is mounted as disk z in Window 7. Do the echo
test in Git Bash, and all I get are "permission deny". But the ">>"
operation should not fail.

I try to access the file with Win32API CreateFile in append mode,
unfortunately I get code error 5(stands for "Access is Denied"). The
API CreateFile is called as CreateFile("append.txt", FILE_APPEND_DATA,

When I look into Samba source code, in function smbd_smb2_create_send,
the FILE_FLAG_POSIX_SEMANTICS is removed from in_file_attributes. In
function calculate_open_access_flags, FILE_APPEND_DATA is just treated

So I wonder, samba server maybe not support for opening file in append
mode. Is that right?

Many thanks for your guidance in advance.


Thanks & Regards,

wei dong

To unsubscribe from this list go to the following URL and read the