mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
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
This commit is contained in:
parent
525ccd589e
commit
e49893c68e
@ -348,8 +348,6 @@ static bool set_ea_dos_attribute(connection_struct *conn,
|
|||||||
struct xattr_DOSATTRIB dosattrib;
|
struct xattr_DOSATTRIB dosattrib;
|
||||||
enum ndr_err_code ndr_err;
|
enum ndr_err_code ndr_err;
|
||||||
DATA_BLOB blob;
|
DATA_BLOB blob;
|
||||||
files_struct *fsp = NULL;
|
|
||||||
bool ret = false;
|
|
||||||
|
|
||||||
if (!lp_store_dos_attributes(SNUM(conn))) {
|
if (!lp_store_dos_attributes(SNUM(conn))) {
|
||||||
return False;
|
return False;
|
||||||
@ -387,6 +385,9 @@ static bool set_ea_dos_attribute(connection_struct *conn,
|
|||||||
if (SMB_VFS_SETXATTR(conn, smb_fname->base_name,
|
if (SMB_VFS_SETXATTR(conn, smb_fname->base_name,
|
||||||
SAMBA_XATTR_DOS_ATTRIB, blob.data, blob.length,
|
SAMBA_XATTR_DOS_ATTRIB, blob.data, blob.length,
|
||||||
0) == -1) {
|
0) == -1) {
|
||||||
|
bool ret = false;
|
||||||
|
files_struct *fsp = NULL;
|
||||||
|
|
||||||
if((errno != EPERM) && (errno != EACCES)) {
|
if((errno != EPERM) && (errno != EACCES)) {
|
||||||
if (errno == ENOSYS
|
if (errno == ENOSYS
|
||||||
#if defined(ENOTSUP)
|
#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,
|
if (!NT_STATUS_IS_OK(open_file_fchmod(conn, smb_fname,
|
||||||
&fsp)))
|
&fsp)))
|
||||||
return ret;
|
return false;
|
||||||
become_root();
|
become_root();
|
||||||
if (SMB_VFS_SETXATTR(conn, smb_fname->base_name,
|
if (SMB_VFS_FSETXATTR(fsp,
|
||||||
SAMBA_XATTR_DOS_ATTRIB, blob.data,
|
SAMBA_XATTR_DOS_ATTRIB, blob.data,
|
||||||
blob.length, 0) == 0) {
|
blob.length, 0) == 0) {
|
||||||
ret = true;
|
ret = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user