]> git.sur5r.net Git - openldap/commitdiff
SLAPD_SCHEMA_NOT_COMPAT: cleanup
authorKurt Zeilenga <kurt@openldap.org>
Tue, 23 May 2000 17:00:46 +0000 (17:00 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 23 May 2000 17:00:46 +0000 (17:00 +0000)
servers/slapd/add.c
servers/slapd/back-bdb2/back-bdb2.h
servers/slapd/back-ldbm/back-ldbm.h
servers/slapd/modify.c
servers/slapd/monitor.c
servers/slapd/schema_init.c
servers/slapd/slap.h

index ad397914d75223d73f057eed2259a5dd8d05f804..97b618ce277082dd73ed0a092ef147ff0227f7e8 100644 (file)
@@ -110,6 +110,7 @@ do_add( Connection *conn, Operation *op )
                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;
@@ -272,7 +273,7 @@ do_add( Connection *conn, Operation *op )
 #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 );
        }
@@ -310,7 +311,7 @@ static int slap_mods2entry(
                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;
                }
 
@@ -345,19 +346,14 @@ add_created_attrs( Operation *op, Entry *e )
 
        /* 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;
index b05e1c2eb4ff11b96f50c034b3e956404a90e9b3..3b31d8d7e34f8fcec7e703b74bdab7948d0896e8 100644 (file)
@@ -25,10 +25,6 @@ LDAP_BEGIN_DECL
 #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"
 
 
index cab5bed2bfc2f864df75b36667dac89897ed7cf6..a84c5201e1f49319fb0dc9efae26f17a24b1087a 100644 (file)
@@ -29,9 +29,6 @@ LDAP_BEGIN_DECL
 #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.
index b00d0843b89770fdec7b2a33cb6133eb4950a129..38f6038300152a51e87bf4d376bc332345204364 100644 (file)
@@ -413,8 +413,8 @@ int slap_mods_opattrs(
        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 );
@@ -484,8 +484,8 @@ add_modified_attrs( Operation *op, Modifications **modlist )
        }
 
        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 );
index a7b042c8c17c5af4b4df5bd3d6df7a48f2041684..dbe8dda1ffa523f8043cb068694a5b89c6899fa3 100644 (file)
@@ -148,7 +148,7 @@ monitor_info(
                        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,
index 0da3b77e000f5ee2ef8ef8b3227016900318d9c2..00a6b5a2890bd48fd909f5e2e4855b994cb76f96 100644 (file)
@@ -167,6 +167,34 @@ oidValidate(
        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,
@@ -367,7 +395,7 @@ struct syntax_defs_rec syntax_defs[] = {
        {"( 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' )",
@@ -401,7 +429,7 @@ struct syntax_defs_rec syntax_defs[] = {
        {"( 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},
@@ -728,6 +756,11 @@ struct slap_schema_ad_map {
                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) },
 
index 9a4587854675e54b9f42155473f91d15db30c74a..b300852ba288962d5132a6b2e7215e6edd365c60 100644 (file)
 
 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
@@ -61,11 +62,12 @@ LDAP_BEGIN_DECL
 
 #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 */
@@ -340,6 +342,9 @@ struct slap_internal_schema {
        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 */
@@ -412,7 +417,10 @@ typedef struct slap_mra {
 
 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 */