Skip to content

Commit

Permalink
Merge pull request #17808 from kenrowland/HPCC-30335
Browse files Browse the repository at this point in the history
HPCC-30335 Improve scope denied log message

Reviewed-By: Russ Whitehead <[email protected]>
Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Sep 26, 2023
2 parents f8e2ee2 + ac9e106 commit 442ebef
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions dali/base/dadfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1379,9 +1379,23 @@ static void checkLogicalScope(const char *scopename,IUserDescriptor *user,bool r
SecAccessFlags perm = getScopePermissions(scopename,user,auditflags);
IDFS_Exception *e = NULL;
if (readreq&&!HASREADPERMISSION(perm))
e = new CDFS_Exception(DFSERR_LookupAccessDenied,scopename);
{
StringBuffer scopeDescription;
StringBuffer username("");
if (user)
user->getUserName(username);
scopeDescription.appendf("%s user '%s', assigned access %s (%d)", scopename, username.str(), getSecAccessFlagName(perm), perm);
e = new CDFS_Exception(DFSERR_LookupAccessDenied,scopeDescription);
}
else if (createreq&&!HASWRITEPERMISSION(perm))
e = new CDFS_Exception(DFSERR_CreateAccessDenied,scopename);
{
StringBuffer scopeDescription;
StringBuffer username("");
if (user)
user->getUserName(username);
scopeDescription.appendf("%s user '%s', assigned access %s (%d)", scopename, username.str(), getSecAccessFlagName(perm), perm);
e = new CDFS_Exception(DFSERR_CreateAccessDenied,scopeDescription);
}
if (e)
throw e;
}
Expand Down

0 comments on commit 442ebef

Please sign in to comment.