summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-04-15 10:49:34 -0700
committerJeremy Allison <jra@samba.org>2011-04-15 22:11:12 +0200
commite49893c68ef29f71ac6301f3955a7404e9c6daba (patch)
treebbe7d1c234f617da2e6110ad88bc735d923d6678 /source3
parent525ccd589ede79e97e83699629a1d98538855803 (diff)
downloadsamba-e49893c68ef29f71ac6301f3955a7404e9c6daba.tar.gz
samba-e49893c68ef29f71ac6301f3955a7404e9c6daba.tar.bz2
samba-e49893c68ef29f71ac6301f3955a7404e9c6daba.zip
Use handle based xattr set if available.
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Apr 15 22:11:12 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/dosmode.c9
1 files changed, 5 insertions, 4 deletions
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;