Skip to content

Commit

Permalink
HPCC-29246 Check read permission only for read action
Browse files Browse the repository at this point in the history
Signed-off-by: wangkx <[email protected]>
  • Loading branch information
wangkx committed Jul 12, 2023
1 parent 6b789aa commit c355ce2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dali/dfu/dfurun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ class CDFUengine: public CInterface, implements IDFUengine
auditflags |= DALI_LDAP_WRITE_WANTED;
SecAccessFlags perm = queryDistributedFileDirectory().getFDescPermissions(fd,user,auditflags);
IDFS_Exception *e = NULL;
if (!HASREADPERMISSION(perm))
if (!write&&!HASREADPERMISSION(perm))
throw MakeStringException(DFSERR_LookupAccessDenied,"Lookup permission denied for physical file(s)");
if (write&&!HASWRITEPERMISSION(perm))
throw MakeStringException(DFSERR_CreateAccessDenied,"Create permission denied for physical file(s)");
Expand Down Expand Up @@ -637,10 +637,10 @@ class CDFUengine: public CInterface, implements IDFUengine
throw makeStringExceptionV(-1, "Invalid DropZone directory %s.", dir);

perm = queryDistributedFileDirectory().getDropZoneScopePermissions(planeName,relativePath.str(),user,auditflags);
if ((!HASREADPERMISSION(perm) || (write&&!HASWRITEPERMISSION(perm))) && checkLegacyPhysicalPerms)
if ((!write&&!HASREADPERMISSION(perm) || (write&&!HASWRITEPERMISSION(perm))) && checkLegacyPhysicalPerms)
perm = queryDistributedFileDirectory().getFDescPermissions(fd,user,auditflags);
}
if (!HASREADPERMISSION(perm))
if (!write&&!HASREADPERMISSION(perm))
throw makeStringException(DFSERR_LookupAccessDenied,"Lookup permission denied for physical file(s)");
if (write&&!HASWRITEPERMISSION(perm))
throw makeStringException(DFSERR_CreateAccessDenied,"Create permission denied for physical file(s)");
Expand Down

0 comments on commit c355ce2

Please sign in to comment.