From 01edcf5b613ec148fa23380d825ba15558135006 Mon Sep 17 00:00:00 2001 From: Giuseppe Lo Presti Date: Tue, 17 Dec 2024 08:46:45 +0100 Subject: [PATCH] xroot: fixed check for xattr prefix --- src/core/xrootiface.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/xrootiface.py b/src/core/xrootiface.py index 55ed7357..c381b1dc 100644 --- a/src/core/xrootiface.py +++ b/src/core/xrootiface.py @@ -309,7 +309,7 @@ def setxattr(endpoint, filepath, _userid, key, value, lockmd): appname = 'wopi' if lockmd: appname, _ = lockmd - if 'user' not in key and 'sys' not in key: + if key[:5] != 'user.' and key[:4] != 'sys': # if nothing is given, assume it's a user attr key = 'user.' + key _xrootcmd(endpoint, 'attr', 'set', '0:0', 'mgm.attr.key=' + key + '&mgm.attr.value=' + str(value) @@ -318,7 +318,7 @@ def setxattr(endpoint, filepath, _userid, key, value, lockmd): def _getxattr(endpoint, filepath, key): '''Internal only: get the extended attribute via a special open.''' - if 'user' not in key and 'sys' not in key: + if key[:5] != 'user.' and key[:4] != 'sys': # if nothing is given, assume it's a user attr key = 'user.' + key try: @@ -339,7 +339,7 @@ def rmxattr(endpoint, filepath, _userid, key, lockmd): appname = 'wopi' if lockmd: appname, _ = lockmd - if 'user' not in key and 'sys' not in key: + if key[:5] != 'user.' and key[:4] != 'sys': # if nothing is given, assume it's a user attr key = 'user.' + key _xrootcmd(endpoint, 'attr', 'rm', '0:0',