Samba, GPFS, wordpad and create mask = 0777
Jeremy Allison
jra at samba.org
Tue Aug 30 11:16:09 MDT 2011
On Tue, Aug 30, 2011 at 10:14:19AM -0700, Richard Sharpe wrote:
> 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.
The change was correct. In the 3.5.3 code the explicit "create mask" setting
was being ignored in this case - it should never be ignored when creating a
new file.
Jeremy.
More information about the samba-technical
mailing list