Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-30581 Improve invalid remote usage error of legacy DFS #17930

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions dali/base/dadfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -8241,6 +8243,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 <IDistributedFile>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)
Expand Down
3 changes: 2 additions & 1 deletion dali/base/dadfs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,8 @@ enum DistributedFileSystemError
DFSERR_RestrictedFileAccessDenied,
DFSERR_EmptyStoragePlane,
DFSERR_MissingStoragePlane,
DFSERR_PhysicalCompressedPartInvalid
DFSERR_PhysicalCompressedPartInvalid,
DFSERR_InvalidRemoteFileContext
};


Expand Down
Loading