SecurityDescriptorpublic class SecurityDescriptor extends Object
Fields Summary |
---|
public int | type | public ACE[] | aces |
Constructors Summary |
---|
public SecurityDescriptor()
| public SecurityDescriptor(byte[] buffer, int bufferIndex, int len)
this.decode(buffer, bufferIndex, len);
|
Methods Summary |
---|
public int | decode(byte[] buffer, int bufferIndex, int len)
int start = bufferIndex;
bufferIndex++; // revision
bufferIndex++;
type = ServerMessageBlock.readInt2(buffer, bufferIndex);
bufferIndex += 2;
ServerMessageBlock.readInt4(buffer, bufferIndex); // offset to owner sid
bufferIndex += 4;
ServerMessageBlock.readInt4(buffer, bufferIndex); // offset to group sid
bufferIndex += 4;
ServerMessageBlock.readInt4(buffer, bufferIndex); // offset to sacl
bufferIndex += 4;
int daclOffset = ServerMessageBlock.readInt4(buffer, bufferIndex);
bufferIndex = start + daclOffset;
bufferIndex++; // revision
bufferIndex++;
int size = ServerMessageBlock.readInt2(buffer, bufferIndex);
bufferIndex += 2;
int numAces = ServerMessageBlock.readInt4(buffer, bufferIndex);
bufferIndex += 4;
if (numAces > 4096)
throw new IOException( "Invalid SecurityDescriptor" );
if (daclOffset != 0) {
aces = new ACE[numAces];
for (int i = 0; i < numAces; i++) {
aces[i] = new ACE();
bufferIndex += aces[i].decode(buffer, bufferIndex);
}
} else {
aces = null;
}
return bufferIndex - start;
| public java.lang.String | toString()
String ret = "SecurityDescriptor:\n";
if (aces != null) {
for (int ai = 0; ai < aces.length; ai++) {
ret += aces[ai].toString() + "\n";
}
} else {
ret += "NULL";
}
return ret;
|
|