Samba, GPFS, wordpad and create mask = 0777
Richard Sharpe
realrichardsharpe at gmail.com
Tue Aug 30 11:14:19 MDT 2011
Hi,
Somewhere between Samba 3.5.3 and 3.5.8 a small change was made in
source3/smbd/open.c:open_file_ntcreate.
The change was to change these lines:
if ((flags2 & O_CREAT) && lp_inherit_acls(SNUM(conn)) &&
(def_acl = directory_has_default_acl(conn, parent_dir))) {
unx_mode = 0777;
}
to these:
if ((flags2 & O_CREAT) && lp_inherit_acls(SNUM(conn)) &&
(def_acl = directory_has_default_acl(conn, parent_dir))) {
unx_mode = (0777 & lp_create_mask(SNUM(conn)));
}
That is, lp_create_mask is anded with 0777 now, rather than 0777 being used.
This causes a problem with wordpad on gpfs when you go to overwrite an
existing rtf file (seemingly because wordpad uses FILE_OVERWRITE_IF,
and saving any updates to an rtf file fails with "Unexpected error".
I have tested with Word, Notepad and wordpad, and only wordpad seems
to use this behavior, and it seems very specific to GPFS.
I do not yet have a test for the underlying problem, but I might develop one.
The workaround is to add "create mask = 0777" to any GPFS-based shares.
--
Regards,
Richard Sharpe
More information about the samba-technical
mailing list