* abandon.c
*/
+/*
+ * An abandon request looks like this:
+ * AbandonRequest ::= MessageID
+ */
+
#include "portable.h"
#include <stdio.h>
Sockbuf *sb;
LDAPRequest *lr;
- /*
- * An abandon request looks like this:
- * AbandonRequest ::= MessageID
- */
-
Debug( LDAP_DEBUG_TRACE, "do_abandon origid %d, msgid %d\n",
origid, msgid, 0 );
* add.c
*/
+/*
+ * An add request looks like this:
+ * AddRequest ::= SEQUENCE {
+ * entry DistinguishedName,
+ * attrs SEQUENCE OF SEQUENCE {
+ * type AttributeType,
+ * values SET OF AttributeValue
+ * }
+ * }
+ */
+
#include "portable.h"
#include <stdio.h>
BerElement *ber;
int i, rc;
- /*
- * An add request looks like this:
- * AddRequest ::= SEQUENCE {
- * entry DistinguishedName,
- * attrs SEQUENCE OF SEQUENCE {
- * type AttributeType,
- * values SET OF AttributeValue
- * }
- * }
- */
-
Debug( LDAP_DEBUG_TRACE, "ldap_add\n", 0, 0, 0 );
/* create a message to send */
* bind.c
*/
+/*
+ * BindRequest ::= SEQUENCE {
+ * version INTEGER,
+ * name DistinguishedName, -- who
+ * authentication CHOICE {
+ * simple [0] OCTET STRING -- passwd
+#ifdef HAVE_KERBEROS
+ * krbv42ldap [1] OCTET STRING
+ * krbv42dsa [2] OCTET STRING
+#endif
+ * sasl [3] SaslCredentials -- LDAPv3
+ * }
+ * }
+ *
+ * BindResponse ::= SEQUENCE {
+ * COMPONENTS OF LDAPResult,
+ * serverSaslCreds OCTET STRING OPTIONAL -- LDAPv3
+ * }
+ *
+ */
+
#include "portable.h"
#include <stdio.h>
int
ldap_bind( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *passwd, int authmethod )
{
- /*
- * The bind request looks like this:
- * BindRequest ::= SEQUENCE {
- * version INTEGER,
- * name DistinguishedName, -- who
- * authentication CHOICE {
- * simple [0] OCTET STRING -- passwd
-#ifdef HAVE_KERBEROS
- * krbv42ldap [1] OCTET STRING
- * krbv42dsa [2] OCTET STRING
-#endif
- * }
- * }
- * all wrapped up in an LDAPMessage sequence.
- */
-
Debug( LDAP_DEBUG_TRACE, "ldap_bind\n", 0, 0, 0 );
switch ( authmethod ) {
return( ldap_kerberos_bind2( ld, dn ) );
#endif
+ case LDAP_AUTH_SASL:
+ /* user must use ldap_sasl_bind */
+ /* FALL-THRU */
+
default:
ld->ld_errno = LDAP_AUTH_UNKNOWN;
return( -1 );
return( ldap_kerberos_bind2_s( ld, dn ) );
#endif
+ case LDAP_AUTH_SASL:
+ /* user must use ldap_sasl_bind */
+ /* FALL-THRU */
+
default:
return( ld->ld_errno = LDAP_AUTH_UNKNOWN );
}
* compare.c
*/
+/* The compare request looks like this:
+ * CompareRequest ::= SEQUENCE {
+ * entry DistinguishedName,
+ * ava SEQUENCE {
+ * type AttributeType,
+ * value AttributeValue
+ * }
+ * }
+ */
+
#include "portable.h"
#include <stdio.h>
{
BerElement *ber;
- /* The compare request looks like this:
- * CompareRequest ::= SEQUENCE {
- * entry DistinguishedName,
- * ava SEQUENCE {
- * type AttributeType,
- * value AttributeValue
- * }
- * }
- * and must be wrapped in an LDAPMessage.
- */
-
Debug( LDAP_DEBUG_TRACE, "ldap_compare\n", 0, 0, 0 );
/* create a message to send */
bvalue.bv_len = (value == NULL) ? 0 : strlen( value );
return ldap_compare_ext_s( ld, dn, attr, &bvalue, NULL, NULL );
-}
\ No newline at end of file
+}
* Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
-/*
- * LDAP controls
+
+/* LDAPv3 Controls (RFC2251)
+ *
+ * Controls ::= SEQUENCE OF Control
+ *
+ * Control ::= SEQUENCE {
+ * controlType LDAPOID,
+ * criticality BOOLEAN DEFAULT FALSE,
+ * controlValue OCTET STRING OPTIONAL
+ * }
*/
#include "portable.h"
* delete.c
*/
+/*
+ * A delete request looks like this:
+ * DelRequet ::= DistinguishedName,
+ */
+
#include "portable.h"
#include <stdio.h>
{
BerElement *ber;
- /*
- * A delete request looks like this:
- * DelRequet ::= DistinguishedName,
- */
-
Debug( LDAP_DEBUG_TRACE, "ldap_delete\n", 0, 0, 0 );
/* create a message to send */
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
+/*
+ * LDAPv3 Extended Operation Request
+ * ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
+ * requestName [0] LDAPOID,
+ * requestValue [1] OCTET STRING OPTIONAL
+ * }
+ *
+ * LDAPv3 Extended Operation Response
+ * ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
+ * COMPONENTS OF LDAPResult,
+ * responseName [10] LDAPOID OPTIONAL,
+ * response [11] OCTET STRING OPTIONAL
+ * }
+ *
+ */
+
#include "portable.h"
#include <stdio.h>
* kbind.c
*/
+/*
+ * BindRequest ::= SEQUENCE {
+ * version INTEGER,
+ * name DistinguishedName, -- who
+ * authentication CHOICE {
+ * simple [0] OCTET STRING -- passwd
+#ifdef HAVE_KERBEROS
+ * krbv42ldap [1] OCTET STRING
+ * krbv42dsa [2] OCTET STRING
+#endif
+ * sasl [3] SaslCredentials -- LDAPv3
+ * }
+ * }
+ *
+ * BindResponse ::= SEQUENCE {
+ * COMPONENTS OF LDAPResult,
+ * serverSaslCreds OCTET STRING OPTIONAL -- LDAPv3
+ * }
+ *
+ */
+
#include "portable.h"
#ifdef HAVE_KERBEROS
int str_translation_on;
#endif /* STR_TRANSLATION */
- /*
- * The bind request looks like this:
- * BindRequest ::= SEQUENCE {
- * version INTEGER,
- * name DistinguishedName,
- * authentication CHOICE {
- * krbv42ldap [1] OCTET STRING
- * krbv42dsa [2] OCTET STRING
- * }
- * }
- * all wrapped up in an LDAPMessage sequence.
- */
-
Debug( LDAP_DEBUG_TRACE, "ldap_kerberos_bind1\n", 0, 0, 0 );
if ( dn == NULL )
*
* modrdn.c
*/
-
/*
* Support for MODIFYDN REQUEST V3 (newSuperior) by:
*
* Redistribution and use in source and binary forms are permitted
* without restriction or fee of any kind as long as this notice
* is preserved.
- *
+ */
+
+/*
+ * A modify rdn request looks like this:
+ * ModifyRDNRequest ::= SEQUENCE {
+ * entry DistinguishedName,
+ * newrdn RelativeDistinguishedName,
+ * deleteoldrdn BOOLEAN
+ * newSuperior [0] DistinguishedName [v3 only]
+ * }
*/
#include "portable.h"
LDAPControl **cctrls,
int *msgidp )
{
- /*
- * A modify rdn request looks like this:
- * ModifyRDNRequest ::= SEQUENCE {
- * entry DistinguishedName,
- * newrdn RelativeDistinguishedName,
- * deleteoldrdn BOOLEAN
- * newSuperior [0] DistinguishedName [v3 only]
- * }
- */
-
BerElement *ber;
int rc;
* result.c - wait for an ldap result
*/
+/*
+ * LDAPv3 (RFC2251)
+ * LDAPResult ::= SEQUENCE {
+ * resultCode ENUMERATED { ... },
+ * matchedDN LDAPDN,
+ * errorMessage LDAPString,
+ * referral Referral OPTIONAL
+ * }
+ * Referral ::= SEQUENCE OF LDAPURL (one or more)
+ * LDAPURL ::= LDAPString (limited to URL chars)
+ */
+
#include "portable.h"
#include <stdio.h>
* sbind.c
*/
+/*
+ * BindRequest ::= SEQUENCE {
+ * version INTEGER,
+ * name DistinguishedName, -- who
+ * authentication CHOICE {
+ * simple [0] OCTET STRING -- passwd
+#ifdef HAVE_KERBEROS
+ * krbv42ldap [1] OCTET STRING
+ * krbv42dsa [2] OCTET STRING
+#endif
+ * sasl [3] SaslCredentials -- LDAPv3
+ * }
+ * }
+ *
+ * BindResponse ::= SEQUENCE {
+ * COMPONENTS OF LDAPResult,
+ * serverSaslCreds OCTET STRING OPTIONAL -- LDAPv3
+ * }
+ *
+ */
+
#include "portable.h"
#include <stdio.h>
{
BerElement *ber;
- /*
- * The bind request looks like this:
- * BindRequest ::= SEQUENCE {
- * version INTEGER,
- * name DistinguishedName, -- who
- * authentication CHOICE {
- * simple [0] OCTET STRING -- passwd
- * }
- * }
- * all wrapped up in an LDAPMessage sequence.
- */
-
Debug( LDAP_DEBUG_TRACE, "ldap_simple_bind\n", 0, 0, 0 );
if ( dn == NULL )
* substrings [4] SubstringFilter,
* greaterOrEqual [5] AttributeValueAssertion,
* lessOrEqual [6] AttributeValueAssertion,
- * present [7] AttributeType,,
- * approxMatch [8] AttributeValueAssertion
+ * present [7] AttributeType,
+ * approxMatch [8] AttributeValueAssertion,
+ * extensibleMatch [9] MatchingRuleAssertion -- LDAPv3
* }
*
* SubstringFilter ::= SEQUENCE {
* final [2] IA5String
* }
* }
+ *
+ * MatchingRuleAssertion ::= SEQUENCE { -- LDAPv3
+ * matchingRule [1] MatchingRuleId OPTIONAL,
+ * type [2] AttributeDescription OPTIONAL,
+ * matchValue [3] AssertionValue,
+ * dnAttributes [4] BOOLEAN DEFAULT FALSE }
+ *
* Note: tags in a choice are always explicit
*/
* unbind.c
*/
+/* An Unbind Request looks like this:
+ *
+ * UnbindRequest ::= NULL
+ *
+ * and has no response.
+ */
+
#include "portable.h"
#include <stdio.h>