diff --git a/dali/base/dadfs.cpp b/dali/base/dadfs.cpp index cbe2f957fc8..223ee8fd22d 100644 --- a/dali/base/dadfs.cpp +++ b/dali/base/dadfs.cpp @@ -316,6 +316,8 @@ class DECL_EXCEPTION CDFS_Exception: implements IDFS_Exception, public CInterfac return str.append(": Storage plane missing: ").append(errstr); case DFSERR_PhysicalCompressedPartInvalid: return str.append(": Compressed part is not in the valid format: ").append(errstr); + case DFSERR_InvalidRemoteFileContext: + return str.append(": Lookup of remote files must use wsdfs::lookup - file: ").append(errstr); } return str.append("Unknown DFS Exception"); } @@ -8247,6 +8249,11 @@ IDistributedFile *CDistributedFileDirectory::dolookup(CDfsLogicalFileName &_logi IDistributedFile *CDistributedFileDirectory::lookup(CDfsLogicalFileName &logicalname, IUserDescriptor *user, AccessMode accessMode, bool hold, bool lockSuperOwner, IDistributedFileTransaction *transaction, bool privilegedUser, unsigned timeout) { + if (logicalname.isRemote()) + { + PrintStackReport(); // to help locate contexts it was called in + throw new CDFS_Exception(DFSERR_InvalidRemoteFileContext, logicalname.get()); + } Owned distributedFile = dolookup(logicalname, user, accessMode, hold, lockSuperOwner, transaction, timeout); // Restricted access is currently designed to stop users viewing sensitive information. It is not designed to stop users deleting or overwriting existing restricted files if (!isWrite(accessMode) && distributedFile && distributedFile->isRestrictedAccess() && !privilegedUser) diff --git a/dali/base/dadfs.hpp b/dali/base/dadfs.hpp index 24fdb806f63..c1fa5f44a5c 100644 --- a/dali/base/dadfs.hpp +++ b/dali/base/dadfs.hpp @@ -803,7 +803,8 @@ enum DistributedFileSystemError DFSERR_RestrictedFileAccessDenied, DFSERR_EmptyStoragePlane, DFSERR_MissingStoragePlane, - DFSERR_PhysicalCompressedPartInvalid + DFSERR_PhysicalCompressedPartInvalid, + DFSERR_InvalidRemoteFileContext };