public SID getDomainSid() { return new SID(this, SID_TYPE_DOMAIN, this.domainName, null, getType() != SID_TYPE_DOMAIN); } public int getRid() {
public SID getDomainSid() { return new SID(this, SID_TYPE_DOMAIN, this.domainName, null, getType() != SID_TYPE_DOMAIN); } public int getRid() {
public SID readId () throws IOException, PACDecodingException { byte[] bytes = new byte[4]; readFully(bytes); byte[] sidBytes = new byte[8 + bytes.length]; sidBytes[ 0 ] = 1; sidBytes[ 1 ] = (byte) ( bytes.length / 4 ); System.arraycopy(new byte[] { 0, 0, 0, 0, 0, 5 }, 0, sidBytes, 2, 6); System.arraycopy(bytes, 0, sidBytes, 8, bytes.length); return new SID(sidBytes, 0); }
public SID getDomainSid() { return new SID(this, SID_TYPE_DOMAIN, this.domainName, null, getType() != SID_TYPE_DOMAIN); } public int getRid() {
/** * * @return domain SID */ @Override public SID getDomainSid () { return new SID(this, SID_TYPE_DOMAIN, this.domainName, null, getType() != SID_TYPE_DOMAIN); }
public SID getDomainSid() { return new SID(this, SID_TYPE_DOMAIN, this.domainName, null, getType() != SID_TYPE_DOMAIN); } public int getRid() {
public SID readId () throws IOException, PACDecodingException { byte[] bytes = new byte[4]; readFully(bytes); byte[] sidBytes = new byte[8 + bytes.length]; sidBytes[ 0 ] = 1; sidBytes[ 1 ] = (byte) ( bytes.length / 4 ); System.arraycopy(new byte[] { 0, 0, 0, 0, 0, 5 }, 0, sidBytes, 2, 6); System.arraycopy(bytes, 0, sidBytes, 8, bytes.length); return new SID(sidBytes, 0); }
/** * * @return domain SID */ @Override public SID getDomainSid () { return new SID(this, SID_TYPE_DOMAIN, this.domainName, null, getType() != SID_TYPE_DOMAIN); }
public SID readSid () throws IOException, PACDecodingException { int sidSize = readInt(); byte[] bytes = new byte[8 + sidSize * 4]; readFully(bytes); return new SID(bytes, 0); }
@Override public int decode ( byte[] buf, int bi, int len ) { this.allow = buf[ bi++ ] == (byte) 0x00; this.flags = buf[ bi++ ] & 0xFF; int size = SMBUtil.readInt2(buf, bi); bi += 2; this.access = SMBUtil.readInt4(buf, bi); bi += 4; this.sid = new SID(buf, bi); return size; }
int decode( byte[] buf, int bi ) { allow = buf[bi++] == (byte)0x00; flags = buf[bi++] & 0xFF; int size = ServerMessageBlock.readInt2(buf, bi); bi += 2; access = ServerMessageBlock.readInt4(buf, bi); bi += 4; sid = new SID(buf, bi); return size; }
int decode( byte[] buf, int bi ) { allow = buf[bi++] == (byte)0x00; flags = buf[bi++] & 0xFF; int size = ServerMessageBlock.readInt2(buf, bi); bi += 2; access = ServerMessageBlock.readInt4(buf, bi); bi += 4; sid = new SID(buf, bi); return size; }
int decode( byte[] buf, int bi ) { allow = buf[bi++] == (byte)0x00; flags = buf[bi++] & 0xFF; int size = ServerMessageBlock.readInt2(buf, bi); bi += 2; access = ServerMessageBlock.readInt4(buf, bi); bi += 4; sid = new SID(buf, bi); return size; }
public SID readSid () throws IOException, PACDecodingException { int sidSize = readInt(); byte[] bytes = new byte[8 + sidSize * 4]; readFully(bytes); return new SID(bytes, 0); }
@Override public int decode ( byte[] buf, int bi, int len ) { this.allow = buf[ bi++ ] == (byte) 0x00; this.flags = buf[ bi++ ] & 0xFF; int size = SMBUtil.readInt2(buf, bi); bi += 2; this.access = SMBUtil.readInt4(buf, bi); bi += 4; this.sid = new SID(buf, bi); return size; }
int decode( byte[] buf, int bi ) { allow = buf[bi++] == (byte)0x00; flags = buf[bi++] & 0xFF; int size = ServerMessageBlock.readInt2(buf, bi); bi += 2; access = ServerMessageBlock.readInt4(buf, bi); bi += 4; sid = new SID(buf, bi); return size; }
@Override public SID getServerSid ( CIFSContext tc, String server ) throws CIFSException { lsarpc.LsarDomainInfo info = new lsarpc.LsarDomainInfo(); MsrpcQueryInformationPolicy rpc; synchronized ( this.sidCache ) { try ( DcerpcHandle handle = DcerpcHandle.getHandle("ncacn_np:" + server + "[\\PIPE\\lsarpc]", tc) ) { // NetApp doesn't like the 'generic' access mask values try ( LsaPolicyHandle policyHandle = new LsaPolicyHandle(handle, null, 0x00000001) ) { rpc = new MsrpcQueryInformationPolicy(policyHandle, (short) lsarpc.POLICY_INFO_ACCOUNT_DOMAIN, info); handle.sendrecv(rpc); if ( rpc.retval != 0 ) throw new SmbException(rpc.retval, false); } return new SID(info.sid, jcifs.SID.SID_TYPE_DOMAIN, ( new UnicodeString(info.name, false) ).toString(), null, false); } catch ( IOException e ) { throw new CIFSException("Failed to get SID from server", e); } } }
@Override public SID getServerSid ( CIFSContext tc, String server ) throws CIFSException { lsarpc.LsarDomainInfo info = new lsarpc.LsarDomainInfo(); MsrpcQueryInformationPolicy rpc; synchronized ( this.sidCache ) { try ( DcerpcHandle handle = DcerpcHandle.getHandle("ncacn_np:" + server + "[\\PIPE\\lsarpc]", tc) ) { // NetApp doesn't like the 'generic' access mask values try ( LsaPolicyHandle policyHandle = new LsaPolicyHandle(handle, null, 0x00000001) ) { rpc = new MsrpcQueryInformationPolicy(policyHandle, (short) lsarpc.POLICY_INFO_ACCOUNT_DOMAIN, info); handle.sendrecv(rpc); if ( rpc.retval != 0 ) throw new SmbException(rpc.retval, false); } return new SID(info.sid, jcifs.SID.SID_TYPE_DOMAIN, ( new UnicodeString(info.name, false) ).toString(), null, false); } catch ( IOException e ) { throw new CIFSException("Failed to get SID from server", e); } } }
throw new SmbException(rpc.retval, false); return new SID(info.sid, SID.SID_TYPE_DOMAIN, (new UnicodeString(info.name, false)).toString(),
sids[ i ] = new SID(rpc.sids.sids[ i ].sid, 0, null, null, false); sids[ i ].origin_server = origin_server; sids[ i ].origin_ctx = origin_ctx;