From c87f8edd8918546630cbc1b7e02f99f17b782873 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Jacke?= Date: Wed, 6 Nov 2013 12:37:07 +0100 Subject: [PATCH] xattr: fix listing EAs on *BSD for non-root users Thanks to Stefan Rompf for reporting. This fixes bug #10247 Signed-off-by: Bjoern Jacke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Fri Nov 8 20:43:30 CET 2013 on sn-devel-104 (cherry picked from commit 374b2cfde74e0c61f4b2da724b30d0e430596092) Autobuild-User(v4-0-test): Karolin Seeger Autobuild-Date(v4-0-test): Tue Nov 12 13:31:21 CET 2013 on sn-devel-104 --- lib/replace/xattr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/replace/xattr.c b/lib/replace/xattr.c index a26ff674a13..459b7f3b65d 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: -- 2.11.4.GIT