]> git.sur5r.net Git - openldap/commitdiff
More LDAP_DEVEL cleanup
authorKurt Zeilenga <kurt@openldap.org>
Tue, 22 Aug 2006 00:45:16 +0000 (00:45 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 22 Aug 2006 00:45:16 +0000 (00:45 +0000)
Rename ManageDIT to Relax

clients/tools/common.c
include/ldap.h
servers/slapd/config.c
servers/slapd/controls.c
servers/slapd/result.c
servers/slapd/slap.h
tests/scripts/test022-ppolicy
tests/scripts/test037-manage

index 271a1338693b6b45f55619290bdfbcd1c273734f..c6fc018af3ccd401576446b6be89d2706dddf8c9 100644 (file)
@@ -200,17 +200,17 @@ N_("             [!]chaining[=<resolveBehavior>[/<continuationBehavior>]]\n")
 N_("                     one of \"chainingPreferred\", \"chainingRequired\",\n")
 N_("                     \"referralsPreferred\", \"referralsRequired\"\n")
 #endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
-#ifdef LDAP_DEVEL
-N_("             [!]manageDIT\n")
-#endif
 N_("             [!]manageDSAit\n")
 N_("             [!]noop\n")
 #ifdef LDAP_CONTROL_PASSWORDPOLICYREQUEST
 N_("             ppolicy\n")
 #endif
 N_("             [!]postread[=<attrs>]  (a comma-separated attribute list)\n")
-N_("             [!]preread[=<attrs>]   (a comma-separated attribute list)\n"),
-N_("             abandon, cancel (SIGINT sends abandon/cancel; not really controls)\n")
+N_("             [!]preread[=<attrs>]   (a comma-separated attribute list)\n")
+#ifdef LDAP_DEVEL
+N_("             [!]relax\n")
+#endif
+N_("             abandon, cancel (SIGINT sends abandon/cancel; not really controls)\n"),
 N_("  -f file    read operations from `file'\n"),
 N_("  -h host    LDAP server\n"),
 N_("  -H URI     LDAP Uniform Resource Indentifier(s)\n"),
@@ -383,15 +383,17 @@ tool_args( int argc, char **argv )
                                proxydn = cvalue;
 #endif /* LDAP_CONTROL_OBSOLETE_PROXY_AUTHZ */
 
-                       } else if ( strcasecmp( control, "manageDIT" ) == 0 ) {
+                       } else if ( ( strcasecmp( control, "relax" ) == 0 ) ||
+                               ( strcasecmp( control, "manageDIT" ) == 0 ) )
+                       {
                                if( manageDIT ) {
                                        fprintf( stderr,
-                                               "manageDIT control previously specified\n");
+                                               "relax control previously specified\n");
                                        exit( EXIT_FAILURE );
                                }
                                if( cvalue != NULL ) {
                                        fprintf( stderr,
-                                               "manageDIT: no control value expected\n" );
+                                               "relax: no control value expected\n" );
                                        usage();
                                }
 
index 38f48556ad031cb4e498443fa5ae80fc599bc95b..9562b8c37f644a8cfe3cb8a813f31cdaa5d5aac2 100644 (file)
@@ -262,7 +262,8 @@ typedef struct ldapcontrol {
 /* various works in progress */
 #define LDAP_CONTROL_NOOP                              "1.3.6.1.4.1.4203.666.5.2"
 #define LDAP_CONTROL_NO_SUBORDINATES   "1.3.6.1.4.1.4203.666.5.11"
-#define LDAP_CONTROL_MANAGEDIT                 "1.3.6.1.4.1.4203.666.5.12"
+#define LDAP_CONTROL_RELAX                             "1.3.6.1.4.1.4203.666.5.12"
+#define LDAP_CONTROL_MANAGEDIT                 LDAP_CONTROL_RELAX
 #define LDAP_CONTROL_SLURP                             "1.3.6.1.4.1.4203.666.5.13"
 #define LDAP_CONTROL_VALSORT                   "1.3.6.1.4.1.4203.666.5.14"
 #define LDAP_CONTROL_DONTUSECOPY               "1.3.6.1.4.1.4203.666.5.15"
index cbf71e3bde8016ef8833f0057ee1e1f46e0caab3..5ff1c3776b1f37974b0644b7f31338f619c30860 100644 (file)
@@ -150,14 +150,10 @@ int config_check_vals(ConfigTable *Conf, ConfigArgs *c, int check_only ) {
                snprintf( c->msg, sizeof( c->msg ), "<%s> extra cruft after <%s>",
                        c->argv[0], Conf->what );
 
-#ifdef LDAP_DEVEL
                ignored = "";
-#endif /* LDAP_DEVEL */
                Debug(LDAP_DEBUG_CONFIG, "%s: %s%s.\n",
                                c->log, c->msg, ignored );
-#ifdef LDAP_DEVEL
                return(ARG_BAD_CONF);
-#endif /* LDAP_DEVEL */
        }
        if((arg_syn & ARG_DB) && !c->be) {
                snprintf( c->msg, sizeof( c->msg ), "<%s> only allowed within database declaration",
index 6c610008843c31b338fc641248afa79b879c20a7..431d97a36facee06dff651e581b6fd616dad495c 100644 (file)
@@ -28,14 +28,16 @@ static SLAP_CTRL_PARSE_FN parseAssert;
 static SLAP_CTRL_PARSE_FN parsePreRead;
 static SLAP_CTRL_PARSE_FN parsePostRead;
 static SLAP_CTRL_PARSE_FN parseProxyAuthz;
-#ifdef LDAP_DEVEL
+#ifdef SLAP_DONTUSECOPY
 static SLAP_CTRL_PARSE_FN parseDontUseCopy;
+#endif
+#ifdef SLAP_RELAX
 static SLAP_CTRL_PARSE_FN parseManageDIT;
 #endif
 static SLAP_CTRL_PARSE_FN parseManageDSAit;
 static SLAP_CTRL_PARSE_FN parseNoOp;
 static SLAP_CTRL_PARSE_FN parsePagedResults;
-#ifdef LDAP_DEVEL
+#ifdef SLAP_SORTEDRESULTS
 static SLAP_CTRL_PARSE_FN parseSortedResults;
 #endif
 static SLAP_CTRL_PARSE_FN parseValuesReturnFilter;
@@ -133,7 +135,7 @@ static struct slap_control control_defs[] = {
                SLAP_CTRL_SEARCH,
                NULL, NULL,
                parsePagedResults, LDAP_SLIST_ENTRY_INITIALIZER(next) },
-#ifdef LDAP_DEVEL
+#ifdef SLAP_SORTEDRESULTS
        { LDAP_CONTROL_SORTREQUEST,
                (int)offsetof(struct slap_control_ids, sc_sortedResults),
                SLAP_CTRL_GLOBAL|SLAP_CTRL_SEARCH|SLAP_CTRL_HIDE,
@@ -172,13 +174,15 @@ static struct slap_control control_defs[] = {
                SLAP_CTRL_ACCESS|SLAP_CTRL_HIDE,
                NULL, NULL,
                parseNoOp, LDAP_SLIST_ENTRY_INITIALIZER(next) },
-#ifdef LDAP_DEVEL
+#ifdef SLAP_DONTUSECOPY
        { LDAP_CONTROL_DONTUSECOPY,
                (int)offsetof(struct slap_control_ids, sc_dontUseCopy),
                SLAP_CTRL_INTROGATE|SLAP_CTRL_HIDE,
                NULL, NULL,
                parseDontUseCopy, LDAP_SLIST_ENTRY_INITIALIZER(next) },
-       { LDAP_CONTROL_MANAGEDIT,
+#endif
+#ifdef SLAP_RELAX
+       { LDAP_CONTROL_RELAX,
                (int)offsetof(struct slap_control_ids, sc_manageDIT),
                SLAP_CTRL_GLOBAL|SLAP_CTRL_UPDATE|SLAP_CTRL_HIDE,
                NULL, NULL,
@@ -844,7 +848,7 @@ slap_remove_control(
        return rs->sr_err;
 }
 
-#ifdef LDAP_DEVEL
+#ifdef SLAP_DONTUSECOPY
 static int parseDontUseCopy (
        Operation *op,
        SlapReply *rs,
@@ -868,19 +872,21 @@ static int parseDontUseCopy (
        op->o_dontUseCopy = SLAP_CONTROL_CRITICAL;
        return LDAP_SUCCESS;
 }
+#endif
 
+#ifdef SLAP_RELAX
 static int parseManageDIT (
        Operation *op,
        SlapReply *rs,
        LDAPControl *ctrl )
 {
        if ( op->o_managedit != SLAP_CONTROL_NONE ) {
-               rs->sr_text = "manageDIT control specified multiple times";
+               rs->sr_text = "relax control specified multiple times";
                return LDAP_PROTOCOL_ERROR;
        }
 
        if ( ctrl->ldctl_value.bv_len ) {
-               rs->sr_text = "manageDIT control value not empty";
+               rs->sr_text = "relax control value not empty";
                return LDAP_PROTOCOL_ERROR;
        }
 
@@ -1107,7 +1113,7 @@ done:;
        return rc;
 }
 
-#ifdef LDAP_DEVEL
+#ifdef SLAP_SORTEDRESULTS
 static int parseSortedResults (
        Operation *op,
        SlapReply *rs,
index bb27c760f3638cbc3cd7872e5db45e9fea6d416d..c6ec83615941993bf1cfbc168d37c9b6d677bdc5 100644 (file)
@@ -247,7 +247,7 @@ send_ldap_controls( Operation *o, BerElement *ber, LDAPControl **c )
                if( rc == -1 ) return rc;
        }
 
-#ifdef LDAP_DEVEL
+#ifdef SLAP_SORTED_RESULTS
        /* this is a hack to avoid having to modify op->s_ctrls */
        if( o->o_sortedresults ) {
                BerElementBuffer berbuf;
@@ -306,7 +306,6 @@ slap_response_play(
 {
        int rc;
 
-#ifdef LDAP_DEVEL
        slap_callback   *sc = op->o_callback, **scp;
 
        rc = SLAP_CB_CONTINUE;
@@ -334,27 +333,6 @@ slap_response_play(
        }
 
        op->o_callback = sc;
-#else /* ! LDAP_DEVEL */
-       slap_callback   *sc = op->o_callback, **sc_prev = &sc, *sc_next;
-
-       rc = SLAP_CB_CONTINUE;
-       for ( sc_next = op->o_callback; sc_next; op->o_callback = sc_next) {
-               sc_next = op->o_callback->sc_next;
-               if ( op->o_callback->sc_response ) {
-                       slap_callback *sc2 = op->o_callback;
-                       rc = op->o_callback->sc_response( op, rs );
-                       if ( op->o_callback != sc2 ) {
-                               *sc_prev = op->o_callback;
-                       }
-                       if ( rc != SLAP_CB_CONTINUE || !op->o_callback ) break;
-                       if ( op->o_callback != sc2 ) continue;
-               }
-               sc_prev = &op->o_callback->sc_next;
-       }
-
-       op->o_callback = sc;
-#endif /* ! LDAP_DEVEL */
-
        return rc;
 }
 
@@ -363,7 +341,6 @@ slap_cleanup_play(
        Operation *op,
        SlapReply *rs )
 {
-#ifdef LDAP_DEVEL
        slap_callback   *sc = op->o_callback, **scp;
 
        for ( scp = &sc; *scp; ) {
@@ -392,26 +369,6 @@ slap_cleanup_play(
        }
 
        op->o_callback = sc;
-#else /* ! LDAP_DEVEL */
-       slap_callback   *sc = op->o_callback, **sc_prev = &sc, *sc_next;
-
-       for ( sc_next = op->o_callback; sc_next; op->o_callback = sc_next) {
-               sc_next = op->o_callback->sc_next;
-               if ( op->o_callback->sc_cleanup ) {
-                       slap_callback *sc2 = op->o_callback;
-                       (void)op->o_callback->sc_cleanup( op, rs );
-                       if ( op->o_callback != sc2 ) {
-                               *sc_prev = op->o_callback;
-                       }
-                       if ( !op->o_callback ) break;
-                       if ( op->o_callback != sc2 ) continue;
-               }
-               sc_prev = &op->o_callback->sc_next;
-       }
-
-       op->o_callback = sc;
-#endif /* ! LDAP_DEVEL */
-
        return LDAP_SUCCESS;
 }
 
index 9177407c7679c109df5c936adf4c9ede90884a5f..5ed8fedd5812be499e333cf7890ac49e9d46a795 100644 (file)
@@ -67,8 +67,12 @@ LDAP_BEGIN_DECL
 #define LDAP_COLLECTIVE_ATTRIBUTES
 #define LDAP_COMP_MATCH
 #define LDAP_SYNC_TIMESTAMP
+
+#define SLAP_DONTUSECOPY
+#define SLAP_SORTEDRESULTS
 #endif
 
+#define SLAP_RELAX
 #define LDAP_DYNAMIC_OBJECTS
 #define SLAP_CONTROL_X_TREE_DELETE LDAP_CONTROL_X_TREE_DELETE
 #define SLAP_DISTPROC
@@ -2303,7 +2307,7 @@ struct slap_control_ids {
        int sc_preRead;
        int sc_proxyAuthz;
        int sc_searchOptions;
-#ifdef LDAP_DEVEL
+#ifdef SLAP_SORTEDRESULTS
        int sc_sortedResults;
 #endif
        int sc_subentries;
@@ -2507,7 +2511,7 @@ typedef struct slap_op {
 #define o_pagedresults_state   o_controls[slap_cids.sc_pagedResults]
 #define get_pagedresults(op)                   ((int)(op)->o_pagedresults)
 
-#ifdef LDAP_DEVEL
+#ifdef SLAP_SORTEDRESULTS
 #define o_sortedresults                o_ctrlflag[slap_cids.sc_sortedResults]
 #endif
 
index 7f55cd09bcb285563b4d4e8a48ef45340f3ac9a6..de6b9fb8c84c633ce4cc189ed8288f47fd0942af 100755 (executable)
@@ -56,7 +56,7 @@ if test $RC != 0 ; then
 fi
 
 echo "Using ldapadd to populate the database..."
-# may need -e manageDIT for draft 09, but not yet.
+# may need "-e relax" for draft 09, but not yet.
 $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
        $LDIFPPOLICY > $TESTOUT 2>&1
 RC=$?
index f37cb39249b6112db44537115cef8a83221992b9..b50c7777dae166358a714ac6f9074a91ee16808c 100755 (executable)
@@ -56,23 +56,9 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-# ITS#3898: #ifndef LDAP_DEVEL, the control is not available
-MANAGEDITOID="1.3.6.1.4.1.4203.666.5.12"
-case `$LDAPSEARCH -s base -b "" -h $LOCALHOST -p $PORT1 \
-       '(supportedControl:objectIdentifierMatch:='${MANAGEDITOID}')' \
-       supportedControl | grep "supportedControl: ${MANAGEDITOID}"` in
-"supportedControl: ${MANAGEDITOID}")
-       ;;
-*)
-       echo "The \"manageDIT\" control appears to be unsupported; test disabled"
-       test $KILLSERVERS != no && kill -HUP $KILLPIDS
-       exit 0
-       ;;
-esac
-
 echo "Testing modify, add, and delete..."
 $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD \
-       -e \!manageDIT > \
+       -e \!relax > \
        $TESTOUT 2>&1 << EOMODS
 version: 1
 #
@@ -150,7 +136,7 @@ fi
 
 echo "Testing modify, add, and delete..."
 $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD \
-       -e \!manageDIT > \
+       -e \!relax > \
        $TESTOUT 2>&1 << EOMODS
 version: 1
 #