summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnoop C S <anoopcs@redhat.com>2019-01-23 15:40:43 +0530
committerKarolin Seeger <kseeger@samba.org>2019-02-05 20:31:37 +0100
commit1be33edc670f26fc77bef45fa7275d524d54fd59 (patch)
tree517ddb8df4129cfb04bdd9711dc3e1c3f1610a55
parent3db3eff31200022106f417c26c4d23f4870d07ab (diff)
downloadsamba-1be33edc670f26fc77bef45fa7275d524d54fd59.tar.gz
s3-vfs: Use ENOATTR in errno comparison for getxattr
* ENODATA is not defined in FreeBSD * ENOATTR is defined to be a synonym for ENODATA in Linux * In its absence Samba already defines ENOATTR to either ENODATA or ENOENT Thus it is safe and correct to compare with ENOATTR rather than ENODATA. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13774 Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jan 23 21:59:10 CET 2019 on sn-devel-144 (cherry picked from commit c99402724a65f4e1f8ed4dcd236a43e0603bef0a) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Tue Feb 5 20:31:37 CET 2019 on sn-devel-144
-rw-r--r--source3/modules/posixacl_xattr.c4
-rw-r--r--source3/modules/vfs_glusterfs.c2
-rw-r--r--source3/modules/vfs_glusterfs_fuse.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/source3/modules/posixacl_xattr.c b/source3/modules/posixacl_xattr.c
index 8f6f365bff9..6f016e17e0b 100644
--- a/source3/modules/posixacl_xattr.c
+++ b/source3/modules/posixacl_xattr.c
@@ -379,7 +379,7 @@ SMB_ACL_T posixacl_xattr_acl_get_file(vfs_handle_struct *handle,
if (ret > 0) {
return posixacl_xattr_to_smb_acl(buf, ret, mem_ctx);
}
- if (ret == 0 || errno == ENOATTR || errno == ENODATA) {
+ if (ret == 0 || errno == ENOATTR) {
mode_t mode = 0;
TALLOC_CTX *frame = talloc_stackframe();
struct smb_filename *smb_fname_tmp =
@@ -434,7 +434,7 @@ SMB_ACL_T posixacl_xattr_acl_get_fd(vfs_handle_struct *handle,
if (ret > 0) {
return posixacl_xattr_to_smb_acl(buf, ret, mem_ctx);
}
- if (ret == 0 || errno == ENOATTR || errno == ENODATA) {
+ if (ret == 0 || errno == ENOATTR) {
SMB_STRUCT_STAT sbuf;
ret = SMB_VFS_FSTAT(fsp, &sbuf);
if (ret == 0)
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index e4f81ced284..7d407a21b31 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -1469,7 +1469,7 @@ static int vfs_gluster_get_real_filename(struct vfs_handle_struct *handle,
ret = glfs_getxattr(handle->data, path, key_buf, val_buf, NAME_MAX + 1);
if (ret == -1) {
- if (errno == ENODATA) {
+ if (errno == ENOATTR) {
errno = EOPNOTSUPP;
}
return -1;
diff --git a/source3/modules/vfs_glusterfs_fuse.c b/source3/modules/vfs_glusterfs_fuse.c
index 64c1b0035c1..8855cd18d01 100644
--- a/source3/modules/vfs_glusterfs_fuse.c
+++ b/source3/modules/vfs_glusterfs_fuse.c
@@ -42,7 +42,7 @@ static int vfs_gluster_fuse_get_real_filename(struct vfs_handle_struct *handle,
ret = getxattr(path, key_buf, val_buf, NAME_MAX + 1);
if (ret == -1) {
- if (errno == ENODATA) {
+ if (errno == ENOATTR) {
errno = EOPNOTSUPP;
}
return -1;