Skip to content

Commit

Permalink
xroot: fixed check for xattr prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Dec 17, 2024
1 parent 5104246 commit 01edcf5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/xrootiface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -318,7 +318,7 @@ def setxattr(endpoint, filepath, _userid, key, value, lockmd):

def _getxattr(endpoint, filepath, key):
'''Internal only: get the extended attribute <key> 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:
Expand All @@ -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',
Expand Down

0 comments on commit 01edcf5

Please sign in to comment.