static void resolveSids0(String authorityServerName, NtlmPasswordAuthentication auth, SID[] sids) throws IOException { DcerpcHandle handle = null; LsaPolicyHandle policyHandle = null; synchronized (sid_cache) { try { handle = DcerpcHandle.getHandle("ncacn_np:" + authorityServerName + "[\\PIPE\\lsarpc]", auth); String server = authorityServerName; int dot = server.indexOf('.'); if (dot > 0 && Character.isDigit(server.charAt(0)) == false) server = server.substring(0, dot); policyHandle = new LsaPolicyHandle(handle, "\\\\" + server, 0x00000800); SID.resolveSids(handle, policyHandle, sids); } finally { if (handle != null) { if (policyHandle != null) { policyHandle.close(); } handle.close(); } } } }
void resolveSids0 ( String authorityServerName, CIFSContext tc, jcifs.SID[] sids ) throws CIFSException { synchronized ( this.sidCache ) { try ( DcerpcHandle handle = DcerpcHandle.getHandle("ncacn_np:" + authorityServerName + "[\\PIPE\\lsarpc]", tc) ) { String server = authorityServerName; int dot = server.indexOf('.'); if ( dot > 0 && Character.isDigit(server.charAt(0)) == false ) server = server.substring(0, dot); try ( LsaPolicyHandle policyHandle = new LsaPolicyHandle(handle, "\\\\" + server, 0x00000800) ) { resolveSids(handle, policyHandle, sids); } } catch ( IOException e ) { throw new CIFSException("Failed to resolve SIDs", e); } } }
void resolveSids0 ( String authorityServerName, CIFSContext tc, jcifs.SID[] sids ) throws CIFSException { synchronized ( this.sidCache ) { try ( DcerpcHandle handle = DcerpcHandle.getHandle("ncacn_np:" + authorityServerName + "[\\PIPE\\lsarpc]", tc) ) { String server = authorityServerName; int dot = server.indexOf('.'); if ( dot > 0 && Character.isDigit(server.charAt(0)) == false ) server = server.substring(0, dot); try ( LsaPolicyHandle policyHandle = new LsaPolicyHandle(handle, "\\\\" + server, 0x00000800) ) { resolveSids(handle, policyHandle, sids); } } catch ( IOException e ) { throw new CIFSException("Failed to resolve SIDs", e); } } }
static void resolveSids0(String authorityServerName, NtlmPasswordAuthentication auth, SID[] sids) throws IOException { DcerpcHandle handle = null; LsaPolicyHandle policyHandle = null; try { handle = DcerpcHandle.getHandle("ncacn_np:" + authorityServerName + "[\\PIPE\\lsarpc]", auth); String server = authorityServerName; int dot = server.indexOf('.'); if (dot > 0 && Character.isDigit(server.charAt(0)) == false) server = server.substring(0, dot); policyHandle = new LsaPolicyHandle(handle, "\\\\" + server, 0x00000800); SID.resolveSids(handle, policyHandle, sids); } finally { if (handle != null) { if (policyHandle != null) { policyHandle.close(); } handle.close(); } } }
@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); } } }
static void resolveSids0(String authorityServerName, NtlmPasswordAuthentication auth, SID[] sids) throws IOException { DcerpcHandle handle = null; LsaPolicyHandle policyHandle = null; synchronized (sid_cache) { try { handle = DcerpcHandle.getHandle("ncacn_np:" + authorityServerName + "[\\PIPE\\lsarpc]", auth); String server = authorityServerName; int dot = server.indexOf('.'); if (dot > 0 && Character.isDigit(server.charAt(0)) == false) server = server.substring(0, dot); policyHandle = new LsaPolicyHandle(handle, "\\\\" + server, 0x00000800); SID.resolveSids(handle, policyHandle, sids); } finally { if (handle != null) { if (policyHandle != null) { policyHandle.close(); } handle.close(); } } } }
@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); } } }
static void resolveSids0(String authorityServerName, NtlmPasswordAuthentication auth, SID[] sids) throws IOException { DcerpcHandle handle = null; LsaPolicyHandle policyHandle = null; synchronized (sid_cache) { try { handle = DcerpcHandle.getHandle("ncacn_np:" + authorityServerName + "[\\PIPE\\lsarpc]", auth); String server = authorityServerName; int dot = server.indexOf('.'); if (dot > 0 && Character.isDigit(server.charAt(0)) == false) server = server.substring(0, dot); policyHandle = new LsaPolicyHandle(handle, "\\\\" + server, 0x00000800); SID.resolveSids(handle, policyHandle, sids); } finally { if (handle != null) { if (policyHandle != null) { policyHandle.close(); } handle.close(); } } } }
"[\\PIPE\\lsarpc]", auth); policyHandle = new LsaPolicyHandle(handle, null, 0x00000001); rpc = new MsrpcQueryInformationPolicy(policyHandle, (short)lsarpc.POLICY_INFO_ACCOUNT_DOMAIN, if (handle != null) { if (policyHandle != null) { policyHandle.close();
"[\\PIPE\\lsarpc]", auth); policyHandle = new LsaPolicyHandle(handle, null, 0x00000001); rpc = new MsrpcQueryInformationPolicy(policyHandle, (short)lsarpc.POLICY_INFO_ACCOUNT_DOMAIN, if (handle != null) { if (policyHandle != null) { policyHandle.close();
"[\\PIPE\\lsarpc]", auth); policyHandle = new LsaPolicyHandle(handle, null, 0x00000001); rpc = new MsrpcQueryInformationPolicy(policyHandle, (short)lsarpc.POLICY_INFO_ACCOUNT_DOMAIN, if (handle != null) { if (policyHandle != null) { policyHandle.close();
"[\\PIPE\\lsarpc]", auth); policyHandle = new LsaPolicyHandle(handle, null, 0x00000001); rpc = new MsrpcQueryInformationPolicy(policyHandle, (short)lsarpc.POLICY_INFO_ACCOUNT_DOMAIN, if (handle != null) { if (policyHandle != null) { policyHandle.close();