1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

s3: if we know a file is immutable, report it to be readonly

on *BSD we get the immutable flag via st_flags, we should use that if possible.
This commit is contained in:
Björn Jacke 2012-07-04 00:33:41 +02:00 committed by Bjoern Jacke
parent 74bf0c6ec6
commit b40fb6eec5

View File

@ -170,6 +170,12 @@ static uint32 dos_mode_from_sbuf(connection_struct *conn,
int result = 0;
enum mapreadonly_options ro_opts = (enum mapreadonly_options)lp_map_readonly(SNUM(conn));
#if defined(UF_IMMUTABLE) && defined(SF_IMMUTABLE)
/* if we can find out if a file is immutable we should report it r/o */
if (smb_fname->st.st_ex_flags & (UF_IMMUTABLE | SF_IMMUTABLE)) {
result |= FILE_ATTRIBUTE_READONLY;
}
#endif
if (ro_opts == MAP_READONLY_YES) {
/* Original Samba method - map inverse of user "w" bit. */
if ((smb_fname->st.st_ex_mode & S_IWUSR) == 0) {