Skip to content

Commit 11335f5

Browse files
author
John Dumais
committed
Adding comments about getting the user name out of tyhe security principal in a file's DACL.
1 parent 77fd8f1 commit 11335f5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ds3-metadata/src/main/java/com/spectralogic/ds3client/metadata/WindowsMetadataStore.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ private void saveWindowsfilePermissions(final Path file) throws IOException {
168168
final StringBuilder userDisplayList = new StringBuilder();
169169
final Map<String, Set<Integer>> stringSetMap = new HashMap<>();
170170
for (final AclEntry aclEntry : aclEntries) {
171+
/*
172+
If a file has no Windoze dacl entries, as may happen on a network-mounted file system, there won't be a principal entry.
173+
A principal is a combination of security provider, like NT AUTHORITY, and user name, e.g. NT AUTHORITY\Gracie.
174+
This code is looking for the user name -- the second half of the principal. With no principal, there is no
175+
second half of the principal.
176+
*/
171177
final String[] principalFields = aclEntry.principal().getName().split("\\\\");
172178

173179
if (principalFields.length < 2) {

0 commit comments

Comments
 (0)