Skip to content

Commit

Permalink
Merge pull request #129 from uPortal-Project/fix_null_ACE
Browse files Browse the repository at this point in the history
fix: NPE for ACEs check on samba share without NT rights
  • Loading branch information
jgribonvald authored Apr 19, 2023
2 parents bf1a52a + 9e31d20 commit 0bb6ebc
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,13 @@ private JsTreeFile resourceAsJsTreeFile(SmbFile resource, SharedUserPortletParam
if (!resourceWritable) {
try {
ACE[] ACEs = resource.getSecurity();
for(ACE ace: ACEs) {
if (this.userAuthenticator.getUsername().equals(ace.getSID().getAccountName())) {
if ((ace.getAccessMask() & ACE.FILE_WRITE_DATA)!=0) {
resourceWritable = true;
break;
if (ACEs != null) {
for (ACE ace : ACEs) {
if (this.userAuthenticator.getUsername().equals(ace.getSID().getAccountName())) {
if ((ace.getAccessMask() & ACE.FILE_WRITE_DATA) != 0) {
resourceWritable = true;
break;
}
}
}
}
Expand Down

0 comments on commit 0bb6ebc

Please sign in to comment.