summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-11-12 12:17:26 -0800
committerKarolin Seeger <kseeger@samba.org>2013-11-13 08:56:31 +0100
commitd984e764073df34729e5410026d6fa618699126f (patch)
treefdce6085383bafbdd5c3f3adaaa9164c068cfc7c
parentc2287276eb6533586ca1eac8b445ac1f93bcee98 (diff)
downloadsamba-d984e764073df34729e5410026d6fa618699126f.tar.gz
xattr: fix listing EAs on *BSD for non-root users
Thanks to Stefan Rompf for reporting. This fixes bug #10247 Back-ported to 3.6.next from master commit 374b2cfde74e0c61f4b2da724b30d0e430596092 Signed-off-by: Bjoern Jacke <bj@sernet.de> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/lib/system.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 1ca2f5e82ce..d0e34bc20e5 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -1801,6 +1801,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 < (sizeof(extattr)/sizeof(extattr[0])); 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: