vfs_streams_xattr: Do not attempt to write empty attribute twice
authorChristof Schmitt <christof.schmitt@us.ibm.com>
Wed, 12 Jun 2013 21:55:15 +0000 (14:55 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 17 Jun 2013 17:41:46 +0000 (10:41 -0700)
commit4cd7e1d283f060e794023d5b0a48a7ec97d33820
treea5ac00fe4e1cc14f4ae8f53442482e9ead80e4cd
parent9f25ad44a93da09b3a7c14a4a1a0e78c5a1b529c
vfs_streams_xattr: Do not attempt to write empty attribute twice

The create disposition FILE_OVERWRITE_IF is mapped to the flags
O_CREAT|O_TRUNC. In vfs_streams_xattr, this triggers two calls to
SMB_VFS_SETXATTR. The second can fail if O_EXCL is also set, resulting
in an unnecessary error.

Merge the identical code to handle O_CREAT and O_TRUNC to avoid setting
an empty attribute twice. Also add the flags parameter to the debug
message.

Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/modules/vfs_streams_xattr.c