From 02f707296bce89295c2f2b01595b769093d1e09b Mon Sep 17 00:00:00 2001 From: Giuseppe Lo Presti Date: Mon, 21 Mar 2022 10:32:25 +0100 Subject: [PATCH] Removed protection as this is currently implemented in the WOPI logic itself, not by the storage layers --- src/core/localiface.py | 4 ---- src/core/xrootiface.py | 8 -------- 2 files changed, 12 deletions(-) diff --git a/src/core/localiface.py b/src/core/localiface.py index e9bd3fab..12f4b81e 100644 --- a/src/core/localiface.py +++ b/src/core/localiface.py @@ -127,10 +127,6 @@ def refreshlock(endpoint, filepath, _userid, appname, value): log.warning('msg="Failed to refreshlock" filepath="%s" appname="%s" reason="%s"' % (filepath, appname, 'File is not locked')) raise IOError('File was not locked') - if l['app_name'] != appname and l['app_name'] != 'wopi': - log.warning('msg="Failed to refreshlock" filepath="%s" appname="%s" reason="%s"' % - (filepath, appname, 'File is locked by %s' % l['app_name'])) - raise IOError('File is locked by %s' % l['app_name']) log.debug('msg="Invoked refreshlock" filepath="%s" value="%s"' % (filepath, value)) # this is non-atomic, but the lock was already held setxattr(endpoint, filepath, '0:0', common.LOCKKEY, common.genrevalock(appname, value), None) diff --git a/src/core/xrootiface.py b/src/core/xrootiface.py index 27c12ce7..191f9c1b 100644 --- a/src/core/xrootiface.py +++ b/src/core/xrootiface.py @@ -287,10 +287,6 @@ def refreshlock(endpoint, filepath, userid, appname, value): log.warning('msg="Failed to refreshlock" filepath="%s" appname="%s" reason="%s"' % (filepath, appname, 'File is not locked')) raise IOError('File was not locked') - if l['app_name'] != appname and l['app_name'] != 'wopi': - log.warning('msg="Failed to refreshlock" filepath="%s" appname="%s" reason="%s"' % - (filepath, appname, 'File is locked by %s' % l['app_name'])) - raise IOError('File is locked by %s' % l['app_name']) log.debug('msg="Invoked refreshlock" filepath="%s" value="%s"' % (filepath, value)) # this is non-atomic, but the lock was already held setxattr(endpoint, filepath, userid, common.LOCKKEY, common.genrevalock(appname, value), None) @@ -303,10 +299,6 @@ def unlock(endpoint, filepath, userid, appname, value): log.warning('msg="Failed to unlock" filepath="%s" appname="%s" reason="%s"' % (filepath, appname, 'File is not locked')) raise IOError('File was not locked') - if l['app_name'] != appname and l['app_name'] != 'wopi': - log.warning('msg="Failed to unlock" filepath="%s" appname="%s" reason="%s"' % - (filepath, appname, 'File is locked by %s' % l['app_name'])) - raise IOError('File is locked by %s' % l['app_name']) log.debug('msg="Invoked unlock" filepath="%s" value="%s' % (filepath, value)) rmxattr(endpoint, filepath, userid, common.LOCKKEY, None)