rc = ber_scanf( ber, "{a{V}}", &mod->ml_type, &mod->ml_bvalues );
if ( rc == LBER_ERROR ) {
+ Debug( LDAP_DEBUG_ANY, "do_add: decoding error\n", 0, 0, 0 );
send_ldap_disconnect( conn, op,
LDAP_PROTOCOL_ERROR, "decoding error" );
rc = -1;
#endif
}
} else {
- Debug( LDAP_DEBUG_ARGS, " do_add: HHH\n", 0, 0, 0 );
+ Debug( LDAP_DEBUG_ARGS, " do_add: no backend support\n", 0, 0, 0 );
send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
NULL, "operation not supported within namingContext", NULL, NULL );
}
attr = attr_find( (*e)->e_attrs, mods->sml_desc );
if( attr != NULL ) {
- *text = "Attribute provided more than once";
+ *text = "attribute provided more than once";
return LDAP_OPERATIONS_ERROR;
}
/* return error on any attempts by the user to add these attrs */
for ( a = e->e_attrs; a != NULL; a = a->a_next ) {
-#ifdef SLAPD_SCHEMA_NOT_COMPAT
- if ( is_at_no_user_mod( a->a_desc.ad_type ))
-#else
- if ( oc_check_op_no_usermod_attr( a->a_type ) )
-#endif
- {
+ if ( oc_check_op_no_usermod_attr( a->a_type ) ) {
return LDAP_CONSTRAINT_VIOLATION;
}
}
if ( op->o_dn == NULL || op->o_dn[0] == '\0' ) {
- bv.bv_val = "<anonymous>";
- bv.bv_len = sizeof("<anonymous>")-1;
+ bv.bv_val = SLAPD_ANONYMOUS;
+ bv.bv_len = sizeof(SLAPD_ANONYMOUS)-1;
;
} else {
bv.bv_val = op->o_dn;
#define DN_ONE_PREFIX '@'
#define DN_SUBTREE_PREFIX '?'
-#define SLAPD_FILTER_DN_ONE ((ber_tag_t) -2)
-#define SLAPD_FILTER_DN_SUBTREE ((ber_tag_t) -3)
-
-
#define BDB2_SUFFIX ".bdb2"
#define DN_ONE_PREFIX '@'
#define DN_SUBTREE_PREFIX '?'
-#define SLAPD_FILTER_DN_ONE ((ber_tag_t) -2)
-#define SLAPD_FILTER_DN_SUBTREE ((ber_tag_t) -3)
-
/*
* there is a single index for each attribute. these prefixes ensure
* that there is no collision among keys.
timestamp.bv_len = strlen(timebuf);
if( op->o_dn == NULL || op->o_dn[0] == '\0' ) {
- name.bv_val = "<anonymous>";
- name.bv_len = sizeof("<anonymous>")-1;
+ name.bv_val = SLAPD_ANONYMOUS;
+ name.bv_len = sizeof(SLAPD_ANONYMOUS)-1;
} else {
name.bv_val = op->o_dn;
name.bv_len = strlen( op->o_dn );
}
if ( op->o_dn == NULL || op->o_dn[0] == '\0' ) {
- bv.bv_val = "<anonymous>";
- bv.bv_len = sizeof("<anonymous>")-1;
+ bv.bv_val = SLAPD_ANONYMOUS;
+ bv.bv_len = sizeof(SLAPD_ANONYMOUS)-1;
} else {
bv.bv_val = op->o_dn;
bv.bv_len = strlen( bv.bv_val );
connection_state2str( c->c_conn_state ),
c->c_sasl_bind_in_progress ? "S" : "",
- c->c_cdn ? c->c_cdn : "<anonymous>",
+ c->c_cdn ? c->c_cdn : SLAPD_ANONYMOUS,
c->c_listener_url,
c->c_peer_domain,
return 1;
}
+static int
+integerValidate(
+ Syntax *syntax,
+ struct berval *val )
+{
+ ber_len_t i;
+
+ for(i=0; i < val->bv_len; i++) {
+ if( !isdigit(val->bv_val[i]) ) return -1;
+ }
+
+ return 0;
+}
+
+static int
+printableStringValidate(
+ Syntax *syntax,
+ struct berval *val )
+{
+ ber_len_t i;
+
+ for(i=0; i < val->bv_len; i++) {
+ if( !isprint(val->bv_val[i]) ) return -1;
+ }
+
+ return 0;
+}
+
static int
IA5StringValidate(
Syntax *syntax,
{"( 1.3.6.1.4.1.1466.115.121.1.26 DESC 'IA5 String' )",
0, IA5StringValidate, NULL, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.27 DESC 'Integer' )",
- 0, NULL, NULL, NULL},
+ 0, integerValidate, NULL, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.28 DESC 'JPEG' " X_NOT_H_R ")",
SLAP_SYNTAX_BLOB, NULL, NULL, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.29 DESC 'Master And Shadow Access Points' )",
{"( 1.3.6.1.4.1.1466.115.121.1.43 DESC 'Presentation Address' )",
0, NULL, NULL, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.44 DESC 'Printable String' )",
- 0, NULL, NULL, NULL},
+ 0, printableStringValidate, NULL, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.49 DESC 'Supported Algorithm' "
X_BINARY X_NOT_H_R ")",
SLAP_SYNTAX_BINARY|SLAP_SYNTAX_BER, berValidate, NULL, NULL},
offsetof(struct slap_internal_schema, si_ad_supportedExtension) },
{ "supportedLDAPVersion",
offsetof(struct slap_internal_schema, si_ad_supportedLDAPVersion) },
+#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
+ { "supportedACIMechanisms",
+ offsetof(struct slap_internal_schema, si_ad_supportedACIMechanisms) },
+
+#endif
{ "supportedSASLMechanisms",
offsetof(struct slap_internal_schema, si_ad_supportedSASLMechanisms) },
LDAP_BEGIN_DECL
+#define SERVICE_NAME OPENLDAP_PACKAGE "-slapd"
+#define SLAPD_ANONYMOUS "<anonymous>"
+
#ifdef f_next
#undef f_next /* name conflict between sys/file.h on SCO and struct filter */
#endif
-#define SERVICE_NAME OPENLDAP_PACKAGE "-slapd"
-
/* LDAPMod.mod_op value ===> Must be kept in sync with ldap.h!
*
* This is a value used internally by the backends. It is needed to allow
#define MAXREMATCHES 10
-/* psuedo error code indicating disconnect */
-#define SLAPD_DISCONNECT -1
/* psuedo error code indicating abandoned operation */
-#define SLAPD_ABANDON -2
+#define SLAPD_ABANDON (-1)
+
+/* psuedo error code indicating disconnect */
+#define SLAPD_DISCONNECT (-2)
/* We assume "C" locale, that is US-ASCII */
AttributeDescription *si_ad_supportedControl;
AttributeDescription *si_ad_supportedExtension;
AttributeDescription *si_ad_supportedLDAPVersion;
+#ifdef SLAPD_ACI_ENABLED
+ AttributeDescription *si_ad_supportedACIMechanisms;
+#endif
AttributeDescription *si_ad_supportedSASLMechanisms;
/* subschema subentry attributes */
typedef struct slap_filter {
ber_tag_t f_choice; /* values taken from ldap.h, plus: */
-#define SLAPD_FILTER_COMPUTED ((ber_tag_t) 0x01U)
+#define SLAPD_FILTER_COMPUTED ((ber_tag_t) -1)
+#define SLAPD_FILTER_DN_ONE ((ber_tag_t) -2)
+#define SLAPD_FILTER_DN_SUBTREE ((ber_tag_t) -3)
+
union f_un_u {
/* precomputed result */