OpenLDAP에서 운영 속성 검색

OpenLDAP에서 운영 속성 검색

OpenLDAP에서 작업 속성을 검색하는 방법에 대한 좋은 문서를 찾는 데 어려움을 겪고 있습니다.

LDAP 검색을 수행하여 LDAP 서버의 기본 고유 이름을 검색하고 싶습니다.

namingContexts 속성을 명시적으로 요청하면 검색이 작동하지 않는 이유는 무엇입니까? 속성 목록에 더하기('+') 기호를 추가해야 한다는 말을 들었습니다.

이 경우 "namingContexts" 속성을 제거해야 합니까, 아니면 둘 다 가져야 합니까?

ldapsearch -H ldap://ldap.mydomain.com -x -s base -b "" +
# note the + returns operational attributes

편집하다:요청된 속성이 비어 있는 것처럼 보입니다. 더하기 기호가 속성 목록에 있으면 안 되나요?http://www.zytrax.com/books/ldap/ch3/#운영

참조:OpenLDAP의 더하기 기호 연산자

답변1

namingContexts 속성을 명시적으로 요청하면 검색이 작동하지 않는 이유는 무엇입니까?

작동하지 않는 것은 무엇입니까? 오류가 발생했나요?

더하기 기호가 있으면 namingContexts가 추가되었는지 여부에 관계없이 모든 속성을 반환합니다.

사용:

ldapsearch -x -H ldap://ldap.example.com -s base -b "" namingContexts

보고:

# extended LDIF
#
# LDAPv3
# base <> with scope baseObject
# filter: (objectclass=*)
# requesting: namingContexts 
#

#
dn:
namingContexts: o=example.com

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

또한 다음을 사용하여 나열됩니다.

ldapsearch -x -H ldap://ldap.example.com -s base -b "" +

귀국:

# extended LDIF
#
# LDAPv3
# base <> with scope baseObject
# filter: (objectclass=*)
# requesting: + 
#

#
dn:
structuralObjectClass: OpenLDAProotDSE
namingContexts: o=example.com
supportedControl: 2.16.840.1.113730.3.4.18
supportedControl: 2.16.840.1.113730.3.4.2
supportedControl: 1.3.6.1.4.1.4203.1.10.1
supportedControl: 1.2.840.113556.1.4.1413
supportedControl: 1.2.840.113556.1.4.1339
supportedControl: 1.2.840.113556.1.4.319
supportedControl: 1.2.826.0.1.334810.2.3
supportedExtension: 1.3.6.1.4.1.1466.20037
supportedExtension: 1.3.6.1.4.1.4203.1.11.1
supportedExtension: 1.3.6.1.4.1.4203.1.11.3
supportedFeatures: 1.3.6.1.4.1.4203.1.5.1
supportedFeatures: 1.3.6.1.4.1.4203.1.5.2
supportedFeatures: 1.3.6.1.4.1.4203.1.5.3
supportedFeatures: 1.3.6.1.4.1.4203.1.5.4
supportedFeatures: 1.3.6.1.4.1.4203.1.5.5
supportedLDAPVersion: 2
supportedLDAPVersion: 3
supportedSASLMechanisms: DIGEST-MD5
supportedSASLMechanisms: CRAM-MD5
subschemaSubentry: cn=Subschema

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

답변2

내 slapd.conf의 첫 번째 액세스 규칙은 이것이 허용되는지 명시적으로 확인하는 것입니다. 비슷한 것이 있는지 확인하십시오.

# Let all clients figure out what auth mechanisms are available, determine
# that TLS is okay, etc
access to dn.base=""
        by *            read

관련 정보