Tabnine Logo
LsaPolicyHandle
Code IndexAdd Tabnine to your IDE (free)

How to use
LsaPolicyHandle
in
jcifs.dcerpc.msrpc

Best Java code snippets using jcifs.dcerpc.msrpc.LsaPolicyHandle (Showing top 12 results out of 315)

origin: jcifs/jcifs

  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();
      }
    }
}
  }
 
origin: AgNO3/jcifs-ng

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);
    }
  }
}
origin: org.codelibs/jcifs

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);
    }
  }
}
origin: org.samba.jcifs/jcifs

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();
    }
  }
}
origin: AgNO3/jcifs-ng

@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);
    }
  }
}
origin: com.jaeksoft/jcifs-krb5-jdk7

  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();
      }
    }
}
  }
 
origin: org.codelibs/jcifs

@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);
    }
  }
}
origin: kohsuke/jcifs

  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();
      }
    }
}
  }
 
origin: org.samba.jcifs/jcifs

    "[\\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();
origin: jcifs/jcifs

    "[\\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();
origin: com.jaeksoft/jcifs-krb5-jdk7

    "[\\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();
origin: kohsuke/jcifs

    "[\\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();
jcifs.dcerpc.msrpcLsaPolicyHandle

Most used methods

  • <init>
  • close

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • setScale (BigDecimal)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Collectors (java.util.stream)
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now