[PATCH] xattr: fix listing EAs on *BSD for non-root users

Björn Jacke bj at sernet.de
Wed Nov 6 04:37:07 MST 2013


Thanks to Stefan Rompf for reporting.

This fixes bug #10247

Signed-off-by: Bjoern Jacke <bj at sernet.de>
---
 lib/replace/xattr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/replace/xattr.c b/lib/replace/xattr.c
index a26ff67..459b7f3b 100644
--- a/lib/replace/xattr.c
+++ b/lib/replace/xattr.c
@@ -194,6 +194,10 @@ static ssize_t bsd_attr_list (int type, extattr_arg arg, char *list, size_t size
 	char *buf;
 	/* Iterate through extattr(2) namespaces */
 	for(t = 0; t < ARRAY_SIZE(extattr); t++) {
+		if (t != EXTATTR_NAMESPACE_USER && geteuid() != 0) {
+			/* ignore all but user namespace when we are not root, see bug 10247 */
+			continue;
+		}
 		switch(type) {
 #if defined(HAVE_EXTATTR_LIST_FILE)
 			case 0:
-- 
1.8.3.4



More information about the samba-technical mailing list