Skip to content

Conversation

GraciesPadre
Copy link
Contributor

Fix for https://jira.spectralogic.com/browse/BPBROWSER-63

If a file has no Windoze dacl entries, as may happen on a network-mounted file system, there won't be a principal entry. A principal is a combination of
security provider, like NT AUTHORITY, and user name, e.g. NT AUTHORITY\Gracie. This code is looking for the user name -- the second half of the
principal. With no principal, there is no second half of the principal.

GraciesPadre and others added 6 commits February 27, 2017 17:19
…throwing an exception, because the Windoze record and

restore doesn't work if you don't own the files it is trying to access or if you are not running as admin.
…nstead of throwing an exception, because the Windoze record and

restore doesn't work if you don't own the files it is trying to access or if you are not running as admin.
…whether to log or not based on the type of exception contained in the event we emit.
If a file has no dacl entries, as may happen on a network-mounted file system, there wont be a principal entry.  A principal is a combination of
security provider, like NT AUTHORITY, and user name, e.g. NT AUTHORITY\Gracie.  This code is looking for the user name -- the second half of the
principal.  With no principal, there is no second half of the principal.
Removing redundant error logging.
userDisplay = aclEntry.principal().getName().split("\\\\")[1];
final String[] principalFields = aclEntry.principal().getName().split("\\\\");

if (principalFields.length < 2) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment here explaining this behavior would be useful to refer to in the future

Adding comments about  getting the user name out of tyhe security principal in a file's DACL.
@rpmoore rpmoore merged commit aedce8a into 3_2_13_dev Mar 3, 2017
@GraciesPadre GraciesPadre deleted the metadata_dacl_parsing_bug branch March 3, 2017 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants