return result;
}
+static NTSTATUS vxfs_set_ea_dos_attributes(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ uint32_t dosmode)
+{
+ NTSTATUS err;
+ int ret = 0;
+ bool attrset = false;
+
+ DBG_DEBUG("Entered function\n");
+
+ if (!(dosmode & FILE_ATTRIBUTE_READONLY)) {
+ ret = vxfs_checkwxattr_path(smb_fname->base_name);
+ if (ret == -1) {
+ DBG_DEBUG("ret:%d\n", ret);
+ if ((errno != EOPNOTSUPP) && (errno != ENOENT)) {
+ return map_nt_error_from_unix(errno);
+ }
+ }
+ }
+ if (dosmode & FILE_ATTRIBUTE_READONLY) {
+ ret = vxfs_setwxattr_path(smb_fname->base_name);
+ DBG_DEBUG("ret:%d\n", ret);
+ if (ret == -1) {
+ if ((errno != EOPNOTSUPP) && (errno != EINVAL)) {
+ return map_nt_error_from_unix(errno);
+ }
+ } else {
+ attrset = true;
+ }
+ }
+ err = SMB_VFS_NEXT_SET_DOS_ATTRIBUTES(handle, smb_fname, dosmode);
+ if (!NT_STATUS_IS_OK(err)) {
+ if (attrset) {
+ ret = vxfs_clearwxattr_path(smb_fname->base_name);
+ DBG_DEBUG("ret:%d\n", ret);
+ if ((ret == -1) && (errno != ENOENT)) {
+ return map_nt_error_from_unix(errno);
+ }
+ }
+ }
+
+ return err;
+}
+
+static NTSTATUS vxfs_fset_ea_dos_attributes(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ uint32_t dosmode)
+{
+ NTSTATUS err;
+ int ret = 0;
+ bool attrset = false;
+
+ DBG_DEBUG("Entered function\n");
+
+ if (!(dosmode & FILE_ATTRIBUTE_READONLY)) {
+ ret = vxfs_checkwxattr_fd(fsp->fh->fd);
+ if (ret == -1) {
+ DBG_DEBUG("ret:%d\n", ret);
+ if ((errno != EOPNOTSUPP) && (errno != ENOENT)) {
+ return map_nt_error_from_unix(errno);
+ }
+ }
+ }
+ if (dosmode & FILE_ATTRIBUTE_READONLY) {
+ ret = vxfs_setwxattr_fd(fsp->fh->fd);
+ DBG_DEBUG("ret:%d\n", ret);
+ if (ret == -1) {
+ if ((errno != EOPNOTSUPP) && (errno != EINVAL)) {
+ return map_nt_error_from_unix(errno);
+ }
+ } else {
+ attrset = true;
+ }
+ }
+ err = SMB_VFS_NEXT_FSET_DOS_ATTRIBUTES(handle, fsp, dosmode);
+ if (!NT_STATUS_IS_OK(err)) {
+ if (attrset) {
+ ret = vxfs_clearwxattr_fd(fsp->fh->fd);
+ DBG_DEBUG("ret:%d\n", ret);
+ if ((ret == -1) && (errno != ENOENT)) {
+ return map_nt_error_from_unix(errno);
+ }
+ }
+ }
+ return err;
+}
+
static int vfs_vxfs_connect(struct vfs_handle_struct *handle,
const char *service, const char *user)
{
.sys_acl_set_fd_fn = vxfs_sys_acl_set_fd,
#endif
+ .set_dos_attributes_fn = vxfs_set_ea_dos_attributes,
+ .fset_dos_attributes_fn = vxfs_fset_ea_dos_attributes,
.getxattr_fn = vxfs_get_xattr,
.fgetxattr_fn = vxfs_fget_xattr,
.listxattr_fn = vxfs_listxattr,