java.lang.Object
org.codelibs.jcifs.smb.impl.SIDCacheImpl
- All Implemented Interfaces:
SidResolver
Internal use only: SID resolver cache
- Author:
- mbechler
This class is intended for internal use.
-
Constructor Summary
ConstructorsConstructorDescriptionSIDCacheImpl(CIFSContext baseContext) Constructs a SID cache implementation. -
Method Summary
Modifier and TypeMethodDescriptionSID[]getGroupMemberSids(CIFSContext tc, String authorityServerName, SID domsid, int rid, int flags) Gets the SIDs of members of a group.getLocalGroupsMap(CIFSContext tc, String authorityServerName, int flags) This specialized method returns a Map of users and local groups for the target server where keys are SIDs representing an account and each value is an ArrayList of SIDs represents the local groups that the account is a member of.getServerSid(CIFSContext tc, String server) Gets the domain SID for the specified server.voidresolveSids(CIFSContext tc, String authorityServerName, SID[] sids) Resolve an array of SIDs using a cache and at most one MSRPC request.voidresolveSids(CIFSContext tc, String authorityServerName, SID[] sids, int offset, int length) Resolve part of an array of SIDs using a cache and at most one MSRPC request.
-
Constructor Details
-
SIDCacheImpl
Constructs a SID cache implementation.- Parameters:
baseContext- the CIFS context for this cache
-
-
Method Details
-
resolveSids
public void resolveSids(CIFSContext tc, String authorityServerName, SID[] sids, int offset, int length) throws CIFSException Description copied from interface:SidResolverResolve part of an array of SIDs using a cache and at most one MSRPC request.- Specified by:
resolveSidsin interfaceSidResolver- Parameters:
tc- the CIFS context to useauthorityServerName- the server to use for SID resolutionsids- the array of SIDs to resolveoffset- the starting offset in the arraylength- the number of SIDs to resolve- Throws:
CIFSException- if there is an error resolving the SIDs
-
resolveSids
public void resolveSids(CIFSContext tc, String authorityServerName, SID[] sids) throws CIFSException Resolve an array of SIDs using a cache and at most one MSRPC request.This method will attempt to resolve SIDs using a cache and cache the results of any SIDs that required resolving with the authority. SID cache entries are currently not expired because under normal circumstances SID information never changes.
- Specified by:
resolveSidsin interfaceSidResolver- Parameters:
authorityServerName- The hostname of the server that should be queried. For maximum efficiency this should be the hostname of a domain controller however a member server will work as well and a domain controller may not return names for SIDs corresponding to local accounts for which the domain controller is not an authority.tc- The context that should be used to communicate with the named server.sids- The SIDs that should be resolved. After this function is called, the names associated with the SIDs may be queried with thetoDisplayString,getDomainName, andgetAccountNamemethods.- Throws:
CIFSException- if there is an error resolving the SIDs
-
getServerSid
Description copied from interface:SidResolverGets the domain SID for the specified server.- Specified by:
getServerSidin interfaceSidResolver- Parameters:
tc- the CIFS context to useserver- the server name- Returns:
- the server's SID
- Throws:
CIFSException- if there is an error retrieving the server SID
-
getGroupMemberSids
public SID[] getGroupMemberSids(CIFSContext tc, String authorityServerName, SID domsid, int rid, int flags) throws CIFSException Description copied from interface:SidResolverGets the SIDs of members of a group.- Specified by:
getGroupMemberSidsin interfaceSidResolver- Parameters:
tc- the CIFS context to useauthorityServerName- the server to use for resolutiondomsid- the domain SIDrid- the group RIDflags- resolution flags- Returns:
- the SIDs of the group members
- Throws:
CIFSException- if there is an error retrieving group members
-
getLocalGroupsMap
public Map<SID,List<SID>> getLocalGroupsMap(CIFSContext tc, String authorityServerName, int flags) throws CIFSException This specialized method returns a Map of users and local groups for the target server where keys are SIDs representing an account and each value is an ArrayList of SIDs represents the local groups that the account is a member of. This method is designed to assist with computing access control for a given user when the target object's ACL has local groups. Local groups are not listed in a user's group membership (e.g. as represented by the tokenGroups constructed attribute retrieved via LDAP). Domain groups nested inside a local group are currently not expanded. In this case the key (SID) type will be SID_TYPE_DOM_GRP rather than SID_TYPE_USER.- Specified by:
getLocalGroupsMapin interfaceSidResolver- Parameters:
tc- The context to useauthorityServerName- The server from which the local groups will be queried.flags- Flags that control the behavior of the operation. When all name associated with SIDs will be required, the SID_FLAG_RESOLVE_SIDS flag should be used which causes all group member SIDs to be resolved together in a single more efficient operation.- Returns:
- a map of group SID to member SIDs
- Throws:
CIFSException- if there is an error retrieving local groups- See Also:
-