Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add field for SID_NAME_USE #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/main/java/com/rapid7/client/dcerpc/dto/SID.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class SID {
private final byte revision;
private final byte[] identifierAuthority;
private final long[] subAuthorities;
private int type;

public SID(final byte revision, final byte[] identifierAuthority, final long[] subAuthorities) {
if (identifierAuthority == null) {
Expand Down Expand Up @@ -87,6 +88,14 @@ public Long getRelativeID() {
return subAuthorities[subAuthorities.length-1];
}

public int getType() {
return this.type;
}

public void setType(int type) {
this.type = type;
}

/**
* @param relativeID The relative identifier (RID) used to construct a new {@link SID} object.
* @return A new {@link SID} object as a clone of this object, with the provided relativeID appended to the subauthorities.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ public SID[] lookupSIDsForNames(final PolicyHandle policyHandle, final LSAPLooku
final SID dtoSID = parseRPCSID(sid, false);
//add RID to SID
sids[i] = dtoSID.resolveRelativeID(translatedSID.getRelativeId());
// add type
sids[i].setType(translatedSID.getUse());
}
return sids;
}
Expand Down