From e49893c68ef29f71ac6301f3955a7404e9c6daba Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 15 Apr 2011 10:49:34 -0700 Subject: Use handle based xattr set if available. Autobuild-User: Jeremy Allison Autobuild-Date: Fri Apr 15 22:11:12 CEST 2011 on sn-devel-104 --- source3/smbd/dosmode.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3') diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index 1ea4c686d5..a9b6dfef78 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -348,8 +348,6 @@ static bool set_ea_dos_attribute(connection_struct *conn, struct xattr_DOSATTRIB dosattrib; enum ndr_err_code ndr_err; DATA_BLOB blob; - files_struct *fsp = NULL; - bool ret = false; if (!lp_store_dos_attributes(SNUM(conn))) { return False; @@ -387,6 +385,9 @@ static bool set_ea_dos_attribute(connection_struct *conn, if (SMB_VFS_SETXATTR(conn, smb_fname->base_name, SAMBA_XATTR_DOS_ATTRIB, blob.data, blob.length, 0) == -1) { + bool ret = false; + files_struct *fsp = NULL; + if((errno != EPERM) && (errno != EACCES)) { if (errno == ENOSYS #if defined(ENOTSUP) @@ -419,9 +420,9 @@ static bool set_ea_dos_attribute(connection_struct *conn, if (!NT_STATUS_IS_OK(open_file_fchmod(conn, smb_fname, &fsp))) - return ret; + return false; become_root(); - if (SMB_VFS_SETXATTR(conn, smb_fname->base_name, + if (SMB_VFS_FSETXATTR(fsp, SAMBA_XATTR_DOS_ATTRIB, blob.data, blob.length, 0) == 0) { ret = true; -- cgit