[Fedora-directory-commits] ldapserver/ldap/servers/slapd slapi_counter.c, 1.6, 1.7
by Nathan Kinder
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28719/ldap/servers/slapd
Modified Files:
slapi_counter.c
Log Message:
Resolves: 207457
Summary: Changed the way we specify the memory offset in the slapi_counter_set_value() assembly code to make it work properly with gcc3.
Index: slapi_counter.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/slapi_counter.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- slapi_counter.c 12 Nov 2008 16:58:06 -0000 1.6
+++ slapi_counter.c 21 Nov 2008 17:06:05 -0000 1.7
@@ -306,7 +306,7 @@
" movl 4%0, %%edx;"
/* Put newval in ECX:EBX */
" movl %1, %%ebx;"
- " movl 4%1, %%ecx;"
+ " movl 4+%1, %%ecx;"
/* If EDX:EAX and counter-> are the same,
* replace *ptr with ECX:EBX */
" lock; cmpxchg8b %0;"
15 years, 5 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm import-threads.c, 1.19, 1.20
by Nathan Kinder
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv19980/ldap/servers/slapd/back-ldbm
Modified Files:
import-threads.c
Log Message:
Resolves: 454348
Summary: Index nscpEntryDN attribute when importing tombstones.
Index: import-threads.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/import-threads.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- import-threads.c 4 Nov 2008 23:12:39 -0000 1.19
+++ import-threads.c 21 Nov 2008 16:38:34 -0000 1.20
@@ -1233,6 +1233,7 @@
FifoItem *fi = NULL;
int is_objectclass_attribute;
int is_nsuniqueid_attribute;
+ int is_nscpentrydn_attribute;
void *attrlist_cursor;
PR_ASSERT(NULL != info);
@@ -1250,14 +1251,16 @@
}
/*
- * If the entry is a Tombstone, then we only add it to the nsuniqeid index
- * and the idlist for (objectclass=tombstone). These two flags are just
- * handy for working out what to do in this case.
+ * If the entry is a Tombstone, then we only add it to the nsuniqeid index,
+ * the nscpEntryDN index, and the idlist for (objectclass=tombstone). These
+ * flags are just handy for working out what to do in this case.
*/
is_objectclass_attribute =
(strcasecmp(info->index_info->name, "objectclass") == 0);
is_nsuniqueid_attribute =
(strcasecmp(info->index_info->name, SLAPI_ATTR_UNIQUEID) == 0);
+ is_nscpentrydn_attribute =
+ (strcasecmp(info->index_info->name, SLAPI_ATTR_NSCP_ENTRYDN) == 0);
if (1 != idl_get_idl_new()) {
/* Is there substring indexing going on here ? */
@@ -1364,8 +1367,8 @@
}
}
} else {
- /* This is a Tombstone entry... we only add it to the nsuniqeid
- * index and the idlist for (objectclass=nstombstone).
+ /* This is a Tombstone entry... we only add it to the nsuniqueid
+ * index, the nscpEntryDN index, and the idlist for (objectclass=nstombstone).
*/
if (job->flags & FLAG_ABORT) {
goto error;
@@ -1387,6 +1390,29 @@
goto error;
}
}
+ if (is_nscpentrydn_attribute) {
+ attrlist_cursor = NULL;
+ while ((attr = attrlist_find_ex(ep->ep_entry->e_attrs,
+ SLAPI_ATTR_NSCP_ENTRYDN,
+ NULL,
+ NULL,
+ &attrlist_cursor)) != NULL) {
+
+ if (job->flags & FLAG_ABORT) {
+ goto error;
+ }
+ if(valueset_isempty(&(attr->a_present_values))) continue;
+ svals = attr_get_present_values(attr);
+ ret = index_addordel_values_ext_sv(be, info->index_info->name,
+ svals, NULL, ep->ep_id, BE_INDEX_ADD | (job->encrypt ? 0 : BE_INDEX_DONT_ENCRYPT), NULL, &idl_disposition,
+ substring_key_buffer);
+
+ if (0 != ret) {
+ /* Something went wrong, eg disk filled up */
+ goto error;
+ }
+ }
+ }
}
import_decref_entry(ep);
info->last_ID_processed = id;
15 years, 5 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm dblayer.c, 1.33, 1.34
by Noriko Hosoi
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26996
Modified Files:
dblayer.c
Log Message:
Resolves: #470084
Summary: Problems migrating from libdb-4.4 to libdb-4.7
Description: Removed the code to remove transaction logs for the db version
upgrade.
Index: dblayer.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/dblayer.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- dblayer.c 19 Nov 2008 02:52:42 -0000 1.33
+++ dblayer.c 20 Nov 2008 17:30:58 -0000 1.34
@@ -1620,15 +1620,6 @@
dblayer_strerror(return_value), 0);
return return_value;
}
- /* remove transaction logs */
- return_value = dblayer_delete_transaction_logs(log_dir);
- if (return_value)
- {
- LDAPDebug(LDAP_DEBUG_ANY,
- "dblayer_start: failed to remove old transaction logs (%d)\n",
- return_value, 0, 0);
- return return_value;
- }
dbmode = DBLAYER_NORMAL_MODE;
if ((return_value = dblayer_make_env(&pEnv, li)) != 0)
15 years, 5 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm proto-back-ldbm.h, 1.16, 1.17 dblayer.c, 1.32, 1.33 dbverify.c, 1.3, 1.4
by Noriko Hosoi
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10528
Modified Files:
proto-back-ldbm.h dblayer.c dbverify.c
Log Message:
Resolves: #471998
Summary: dbverify: support integer type index
Description:
1) changed dblayer_bt_compare to public (proto-back-ldbm.h, dblayer.c)
2) set dblayer_bt_compare by dbp->set_bt_compare if the attribute has a
comparison function set in ai->ai_key_cmp_fn (dbverify.c)
3) cleaned up the function dbverify_ext; set the right page size based upon the
idl type (new idl or old idl), also set dup compare function only when the idl
type is new. (dbverify.c)
Index: proto-back-ldbm.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/proto-back-ldbm.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- proto-back-ldbm.h 24 Oct 2008 23:28:22 -0000 1.16
+++ proto-back-ldbm.h 19 Nov 2008 02:52:41 -0000 1.17
@@ -170,6 +170,8 @@
int dblayer_db_uses_transactions(DB_ENV *db_env);
int dblayer_db_uses_mpool(DB_ENV *db_env);
int dblayer_db_uses_logging(DB_ENV *db_env);
+int dblayer_bt_compare(DB *db, const DBT *dbt1, const DBT *dbt2);
+
/*
* dn2entry.c
Index: dblayer.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/dblayer.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- dblayer.c 17 Oct 2008 17:13:55 -0000 1.32
+++ dblayer.c 19 Nov 2008 02:52:42 -0000 1.33
@@ -243,7 +243,7 @@
see also DBTcmp
*/
-static int
+int
dblayer_bt_compare(DB *db, const DBT *dbt1, const DBT *dbt2)
{
struct berval bv1, bv2;
Index: dbverify.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/dbverify.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- dbverify.c 8 Oct 2008 17:29:03 -0000 1.3
+++ dbverify.c 19 Nov 2008 02:52:42 -0000 1.4
@@ -111,25 +111,67 @@
"Unable to create id2entry db file %d\n", rval);
return rval;
}
+
#define VLVPREFIX "vlv#"
- if ((0 != strncmp(direntry->name, ID2ENTRY, strlen(ID2ENTRY))) &&
- (0 != strncmp(direntry->name, VLVPREFIX, strlen(VLVPREFIX))))
+ if (0 != strncmp(direntry->name, ID2ENTRY, strlen(ID2ENTRY)))
{
- rval = dbp->set_flags(dbp, DB_DUP | DB_DUPSORT);
- if (0 != rval)
+ struct attrinfo *ai = NULL;
+ char *p = NULL;
+ p = strstr(filep, LDBM_FILENAME_SUFFIX); /* since already checked,
+ it must have it */
+ *p = '\0';
+ ainfo_get( inst->inst_be, filep+1, &ai );
+ *p = '.';
+ if (ai->ai_key_cmp_fn) {
+ dbp->app_private = (void *)ai->ai_key_cmp_fn;
+ dbp->set_bt_compare(dbp, dblayer_bt_compare);
+ }
+ if (idl_get_idl_new())
+ {
+ rval = dbp->set_pagesize(dbp,
+ (priv->dblayer_index_page_size == 0) ?
+ DBLAYER_INDEX_PAGESIZE : priv->dblayer_index_page_size);
+ }
+ else
{
- slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
- "Unable to set DUP flags to db %d\n", rval);
- return rval;
+ rval = dbp->set_pagesize(dbp,
+ (priv->dblayer_page_size == 0) ?
+ DBLAYER_PAGESIZE : priv->dblayer_page_size);
}
-
- rval = dbp->set_dup_compare(dbp, idl_new_compare_dups);
if (0 != rval)
{
slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
- "Unable to set dup_compare to db %d\n", rval);
+ "Unable to set pagesize flags to db (%d)\n", rval);
return rval;
}
+ if (0 == strncmp(direntry->name, VLVPREFIX, strlen(VLVPREFIX)))
+ {
+ rval = dbp->set_flags(dbp, DB_RECNUM);
+ if (0 != rval)
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
+ "Unable to set RECNUM flag to vlv index (%d)\n", rval);
+ return rval;
+ }
+ }
+ else if (idl_get_idl_new())
+ {
+ rval = dbp->set_flags(dbp, DB_DUP | DB_DUPSORT);
+ if (0 != rval)
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
+ "Unable to set DUP flags to db (%d)\n", rval);
+ return rval;
+ }
+
+ rval = dbp->set_dup_compare(dbp, idl_new_compare_dups);
+ if (0 != rval)
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
+ "Unable to set dup_compare to db (%d)\n", rval);
+ return rval;
+ }
+ }
}
#undef VLVPREFIX
rval = dbp->verify(dbp, dbdir, NULL, NULL, 0);
15 years, 5 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/tools/ldclt ldapfct.c, 1.8, 1.9 ldclt.c, 1.6, 1.7 ldclt.h, 1.5, 1.6 ldcltU.c, 1.4, 1.5 threadMain.c, 1.3, 1.4
by Noriko Hosoi
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23022
Modified Files:
ldapfct.c ldclt.c ldclt.h ldcltU.c threadMain.c
Log Message:
Resolves: #471138
Summary: LDCLT: add abandon to ldclt
Index: ldapfct.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/ldapfct.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ldapfct.c 8 Oct 2008 17:29:04 -0000 1.8
+++ ldapfct.c 17 Nov 2008 23:11:57 -0000 1.9
@@ -1650,7 +1650,7 @@
attribute.mod_type = "cn";
attribute.mod_values = strList1 ("toto cn");
if (addAttrib (attrs, nbAttribs++, &attribute) < 0)
- return (-1);
+ return (-1);
}
if (strcmp (tttctx->buf2, "sn"))
{
@@ -1658,7 +1658,7 @@
attribute.mod_type = "sn";
attribute.mod_values = strList1 ("toto sn");
if (addAttrib (attrs, nbAttribs++, &attribute) < 0)
- return (-1);
+ return (-1);
}
}
@@ -3554,5 +3554,174 @@
return (0);
}
+/* ****************************************************************************
+ FUNCTION : doAbandon
+ PURPOSE : Perform one abandon operation against an async search.
+ INPUT : tttctx = thread context
+ OUTPUT : None.
+ RETURN : -1 if error, 0 else.
+ DESCRIPTION :
+ *****************************************************************************/
+int
+doAbandon (thread_context *tttctx)
+{
+ int ret; /* Return value */
+ LDAPMessage *res; /* LDAP results */
+ char **attrlist; /* Attribs list */
+ struct timeval mytimeout;
+ int msgid;
+
+ /*
+ * Connection to the server
+ * The function connectToServer() will take care of the various connection/
+ * disconnection, bind/unbind/close etc... requested by the user.
+ * The cost is one more function call in this application, but the
+ * resulting source code will be much more easiest to maintain.
+ */
+ if (connectToServer (tttctx) < 0)
+ return (-1);
+ if (!(tttctx->binded))
+ return (0);
+
+ /*
+ * Build the filter
+ */
+ if (buildRandomRdnOrFilter (tttctx) < 0)
+ return (-1);
+
+ attrlist = NULL;
+
+ /*
+ * We use asynchronous search to abandon...
+ *
+ * set (1, 2) to (acyncMin, acyncMax), which combination does not stop write.
+ */
+ mctx.asyncMin = 1;
+ mctx.asyncMax = 2;
+ if (tttctx->pendingNb >= mctx.asyncMin)
+ {
+ mytimeout.tv_sec = 1;
+ mytimeout.tv_usec = 0;
+ ret = ldap_result (tttctx->ldapCtx,
+ LDAP_RES_ANY, LDAP_MSG_ONE, &mytimeout, &res);
+ if (ret < 0)
+ {
+ if (!((mctx.mode & QUIET) && ignoreError (ret)))
+ (void) printErrorFromLdap (tttctx, res, ret, "Cannot ldap_result()");
+ if (addErrorStat (ret) < 0)
+ return (-1);
+ }
+ else
+ {
+ /* ret == 0 --> timeout; op abandoned and no result is returned */
+ tttctx->pendingNb--;
+
+ /*
+ * Don't forget to free the returned message !
+ */
+ if ((ret = ldap_msgfree (res)) < 0)
+ {
+ if (!((mctx.mode & QUIET) && ignoreError (ret)))
+ {
+ printf ("ldclt[%d]: T%03d: Cannot ldap_msgfree(), error=%d (%s)\n",
+ mctx.pid, tttctx->thrdNum, ret, my_ldap_err2string (ret));
+ fflush (stdout);
+ }
+ if (addErrorStat (ret) < 0)
+ return (-1);
+ }
+ }
+ }
+
+ /*
+ * Maybe we may send another request ?
+ * Well... there is no proper way to retrieve the error number for
+ * this, so I guess I may use direct access to the ldap context
+ * to read the field ld_errno.
+ */
+ if (tttctx->pendingNb > mctx.asyncMax)
+ {
+ if ((mctx.mode & VERBOSE) &&
+ (tttctx->asyncHit == 1) &&
+ (!(mctx.mode & SUPER_QUIET)))
+ {
+ tttctx->asyncHit = 1;
+ printf ("ldclt[%d]: T%03d: Max pending request hit.\n",
+ mctx.pid, tttctx->thrdNum);
+ fflush (stdout);
+ }
+ }
+ else
+ {
+ if ((mctx.mode & VERBOSE) &&
+ (tttctx->asyncHit == 1) &&
+ (!(mctx.mode & SUPER_QUIET)))
+ {
+ tttctx->asyncHit = 0;
+ printf ("ldclt[%d]: T%03d: Restart sending.\n",
+ mctx.pid, tttctx->thrdNum);
+ fflush (stdout);
+ }
+
+ msgid = -1;
+ /* for some reasons, it is an error to pass in a zero'd timeval */
+ mytimeout.tv_sec = mytimeout.tv_usec = -1;
+ ret = ldap_search_ext (tttctx->ldapCtx, tttctx->bufBaseDN, mctx.scope,
+ tttctx->bufFilter, attrlist, mctx.attrsonly,
+ NULL, NULL, &mytimeout, -1, &msgid);
+ if (mctx.mode & VERY_VERBOSE)
+ printf ("ldclt[%d]: T%03d: ldap_search(%s)=>%d\n",
+ mctx.pid, tttctx->thrdNum, tttctx->bufFilter, ret);
+
+ if (ret != 0)
+ {
+ if (ldap_get_option (tttctx->ldapCtx, LDAP_OPT_ERROR_NUMBER, &ret) < 0)
+ {
+ printf ("ldclt[%d]: T%03d: Cannot ldap_get_option(LDAP_OPT_ERROR_NUMBER)\n",
+ mctx.pid, tttctx->thrdNum);
+ fflush (stdout);
+ return (-1);
+ }
+ else
+ {
+ if (!((mctx.mode & QUIET) && ignoreError (ret)))
+ {
+ printf ("ldclt[%d]: T%03d: Cannot ldap_search(), error=%d (%s)\n",
+ mctx.pid, tttctx->thrdNum, ret, my_ldap_err2string (ret));
+ fflush (stdout);
+ }
+ if (addErrorStat (ret) < 0)
+ return (-1);
+ }
+ }
+ else
+ {
+ if (msgid >= 0)
+ {
+ /* ABANDON the search request immediately */
+ (void) ldap_abandon(tttctx->ldapCtx, msgid);
+ }
+
+ /*
+ * Memorize the operation
+ */
+ if (incrementNbOpers (tttctx) < 0)
+ return (-1);
+ tttctx->pendingNb++;
+ if (mctx.mode & VERY_VERBOSE)
+ printf ("ldclt[%d]: T%03d: ldap_abandon(%d)\n",
+ mctx.pid, tttctx->thrdNum, msgid);
+ }
+ }
+
+ if (mctx.mode & VERY_VERBOSE)
+ printf ("ldclt[%d]: T%03d: pendingNb=%d\n",
+ mctx.pid, tttctx->thrdNum, tttctx->pendingNb);
+
+ /*
+ * End of asynchronous operation... and also end of function.
+ */
+ return (0);
+}
/* End of file */
Index: ldclt.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/ldclt.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ldclt.c 19 Sep 2007 18:08:12 -0000 1.6
+++ ldclt.c 17 Nov 2008 23:11:57 -0000 1.7
@@ -2115,6 +2115,8 @@
"randomauthidhigh",
#define EP_RANDOMSASLAUTHIDLOW 48
"randomauthidlow",
+#define EP_ABANDON 49
+ "abandon",
NULL
};
@@ -2397,6 +2399,9 @@
case EP_WITH_NEWPARENT: /*JLS 15-12-00*/
mctx.mode |= WITH_NEWPARENT; /*JLS 15-12-00*/
break; /*JLS 15-12-00*/
+ case EP_ABANDON:
+ mctx.mod2 |= M2_ABANDON;
+ break;
default:
fprintf (stderr, "Error: illegal option -e %s\n", subvalue);
return (-1);
@@ -2750,7 +2755,8 @@
fprintf (stderr, "Error: use -f or -e rdn=value for this purpose.\n");
ldcltExit (EXIT_PARAMS); /*JLS 13-11-00*/
}
- if ((!((mctx.mode & NEED_FILTER) || (mctx.mod2 & M2_GENLDIF)))/*JLS 04-05-01*/
+ if ((!((mctx.mode & NEED_FILTER) || (mctx.mod2 & M2_GENLDIF) ||
+ (mctx.mod2 & M2_NEED_FILTER)))/*JLS 04-05-01*/
&& (mctx.filter != NULL)) /*JLS 04-05-01*/
{ /*JLS 04-05-01*/
fprintf (stderr, "Error: do not need filter -f\n"); /*JLS 04-05-01*/
Index: ldclt.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/ldclt.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ldclt.h 19 Sep 2007 18:08:12 -0000 1.5
+++ ldclt.h 17 Nov 2008 23:11:57 -0000 1.6
@@ -277,6 +277,7 @@
#define M2_BINDONLY 0x00000020 /* -e bindonly */ /*JLS 04-05-01*/
#define M2_SASLAUTH 0x00000040 /* -o : SASL authentication */
#define M2_RANDOM_SASLAUTHID 0x00000080 /* -e randomauthid */
+#define M2_ABANDON 0x00000100 /* -e abandon */
/*
* Combinatory defines
@@ -286,10 +287,11 @@
* - VALID_OPERS : valid operations
*/
#define NEED_FILTER (ADD_ENTRIES|DELETE_ENTRIES|EXACT_SEARCH|RENAME_ENTRIES|ATTR_REPLACE|SCALAB01)
+#define M2_NEED_FILTER (M2_ABANDON)
#define NEED_RANGE (INCREMENTAL|RANDOM)
#define NEED_RND_INCR (ADD_ENTRIES|DELETE_ENTRIES|RENAME_ENTRIES)
#define VALID_OPERS (ADD_ENTRIES|DELETE_ENTRIES|EXACT_SEARCH|RENAME_ENTRIES|ATTR_REPLACE|SCALAB01)
-#define M2_VALID_OPERS (M2_GENLDIF|M2_BINDONLY)
+#define M2_VALID_OPERS (M2_GENLDIF|M2_BINDONLY|M2_ABANDON)
#define NEED_CLASSES (ADD_ENTRIES)
#define THE_CLASSES (OC_PERSON|OC_EMAILPERSON|OC_INETORGPRSON)
@@ -700,6 +702,7 @@
extern int doBindOnly (thread_context *tttctx); /*JLS 04-05-01*/
extern int doDeleteEntry (thread_context *tttctx);
extern int doExactSearch (thread_context *tttctx);
+extern int doAbandon (thread_context *tttctx);
extern int doGenldif (thread_context *tttctx); /*JLS 19-03-01*/
extern int doRename (thread_context *tttctx);
extern int freeAttrib (LDAPMod **attrs);
Index: ldcltU.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/ldcltU.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ldcltU.c 5 Jul 2007 23:53:41 -0000 1.4
+++ ldcltU.c 17 Nov 2008 23:11:57 -0000 1.5
@@ -65,6 +65,7 @@
* -D Bind DN. See -w
* -E Max errors allowed. Default 1000.
* -e Execution parameters:
+ * abandon : abandon asyncronous search requests.
* add : ldap_add() entries.
* append : append entries to the genldif file.
* ascii : ascii 7-bits strings.
@@ -156,35 +157,36 @@
(void) printf (" -D Bind DN. See -w\n");
(void) printf (" -E Max errors allowed. Default 1000.\n");
(void) printf (" -e Execution parameters:\n");
- (void) printf (" add : ldap_add() entries.\n");
- (void) printf (" append : append entries to the genldif file.\n");
- (void) printf (" ascii : ascii 7-bits strings.\n");
+ (void) printf (" abandon : abandon async search requests.\n");
+ (void) printf (" add : ldap_add() entries.\n");
+ (void) printf (" append : append entries to the genldif file.\n");
+ (void) printf (" ascii : ascii 7-bits strings.\n");
(void) printf (" attreplace=name:mask : replace attribute of existing entry.\n");
(void) printf (" attrlist=name:name:name : specify list of attribs to retrieve\n");
- (void) printf (" attrsonly=0|1 : ldap_search() parameter. Set 0 to read values.\n");
- (void) printf (" bindeach : ldap_bind() for each operation.\n");
- (void) printf (" bindonly : only bind/unbind, no other operation is performed.\n");
- (void) printf (" close : will close() the fd, rather than ldap_unbind().\n");
- (void) printf (" cltcertname=name : name of the SSL client certificate\n");
- (void) printf (" commoncounter : all threads share the same counter.\n");
- (void) printf (" counteach : count each operation not only successful ones.\n");
- (void) printf (" delete : ldap_delete() entries.\n");
+ (void) printf (" attrsonly=0|1 : ldap_search() parameter. Set 0 to read values.\n");
+ (void) printf (" bindeach : ldap_bind() for each operation.\n");
+ (void) printf (" bindonly : only bind/unbind, no other operation is performed.\n");
+ (void) printf (" close : will close() the fd, rather than ldap_unbind().\n");
+ (void) printf (" cltcertname=name : name of the SSL client certificate\n");
+ (void) printf (" commoncounter : all threads share the same counter.\n");
+ (void) printf (" counteach : count each operation not only successful ones.\n");
+ (void) printf (" delete : ldap_delete() entries.\n");
(void) printf (" dontsleeponserverdown : will loop very fast if server down.\n");
- (void) printf (" emailPerson : objectclass=emailPerson (-e add only).\n");
- (void) printf (" esearch : exact search.\n");
- (void) printf (" genldif=filename : generates a ldif file\n");
- (void) printf (" imagesdir=path : specify where are the images.\n");
- (void) printf (" incr : incremental values.\n");
- (void) printf (" inetOrgPerson : objectclass=inetOrgPerson (-e add only).\n");
- (void) printf (" keydbfile=file : filename of the key database\n");
- (void) printf (" keydbpin=password : password for accessing the key database\n");
- (void) printf (" noglobalstats : don't print periodical global statistics\n");
- (void) printf (" noloop : does not loop the incremental numbers.\n");
- (void) printf (" object=filename : build object from input file\n");
- (void) printf (" person : objectclass=person (-e add only).\n");
- (void) printf (" random : random filters, etc...\n");
+ (void) printf (" emailPerson : objectclass=emailPerson (-e add only).\n");
+ (void) printf (" esearch : exact search.\n");
+ (void) printf (" genldif=filename : generates a ldif file\n");
+ (void) printf (" imagesdir=path : specify where are the images.\n");
+ (void) printf (" incr : incremental values.\n");
+ (void) printf (" inetOrgPerson : objectclass=inetOrgPerson (-e add only).\n");
+ (void) printf (" keydbfile=file : filename of the key database\n");
+ (void) printf (" keydbpin=password : password for accessing the key database\n");
+ (void) printf (" noglobalstats : don't print periodical global statistics\n");
+ (void) printf (" noloop : does not loop the incremental numbers.\n");
+ (void) printf (" object=filename : build object from input file\n");
+ (void) printf (" person : objectclass=person (-e add only).\n");
+ (void) printf (" random : random filters, etc...\n");
(void) printf (" randomattrlist=name:name:name : random select attrib in the list\n");
- (void) printf (" randombase : random base DN.\n");
+ (void) printf (" randombase : random base DN.\n");
(void) printf (" randombaselow=value : low value for random generator.\n");
(void) printf (" randombasehigh=value : high value for random generator.\n");
(void) printf (" randombinddn : random bind DN.\n");
@@ -198,8 +200,8 @@
(void) printf (" scalab01_maxcnxnb : modem pool size.\n");
(void) printf (" scalab01_wait : sleep() between 2 attempts to connect.\n");
(void) printf (" smoothshutdown : main thread waits till the worker threads exit.\n");
- (void) printf (" string : create random strings rather than random numbers.\n");
- (void) printf (" v2 : ldap v2.\n");
+ (void) printf (" string : create random strings rather than random numbers.\n");
+ (void) printf (" v2 : ldap v2.\n");
(void) printf (" withnewparent : rename with newparent specified as argument.\n");
(void) printf (" randomauthid : random SASL Authid.\n");
(void) printf (" randomauthidlow=value : low value for random SASL Authid.\n");
Index: threadMain.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/threadMain.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- threadMain.c 5 Jul 2007 23:53:41 -0000 1.3
+++ threadMain.c 17 Nov 2008 23:11:57 -0000 1.4
@@ -954,7 +954,7 @@
* Don't forget the buffers !!
* This should save time while redoing random values
*/
- if ((mctx.mode & NEED_FILTER) || (mctx.mod2 & M2_GENLDIF)) /*JLS 19-03-01*/
+ if ((mctx.mode & NEED_FILTER) || (mctx.mod2 & (M2_GENLDIF|M2_NEED_FILTER))) /*JLS 19-03-01*/
{
if (mctx.mod2 & M2_RDN_VALUE) /*JLS 23-03-01*/
tttctx->bufFilter = (char *) malloc (MAX_FILTER); /*JLS 23-03-01*/
@@ -1200,6 +1200,15 @@
continue; /*JLS 19-03-01*/
} /*JLS 19-03-01*/
+ if (mctx.mod2 & M2_ABANDON)
+ {
+ if (doAbandon (tttctx) < 0)
+ {
+ go = 0;
+ continue;
+ }
+ }
+
/*
* Check the thread's status
*/
15 years, 5 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/replication cl5_api.c, 1.23, 1.24
by Nathan Kinder
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25071/ldap/servers/plugins/replication
Modified Files:
cl5_api.c
Log Message:
Resolves: 450046
Summary: Clean-up leftover changelog semaphore at startup.
Index: cl5_api.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_api.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- cl5_api.c 15 Oct 2008 06:29:58 -0000 1.23
+++ cl5_api.c 14 Nov 2008 02:06:34 -0000 1.24
@@ -6415,17 +6415,35 @@
(*dbFile)->semaName = slapi_ch_smprintf("%s/%s.sema", semadir, replName);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
"_cl5NewDBFile: semaphore %s\n", (*dbFile)->semaName);
- (*dbFile)->sema = PR_OpenSemaphore((*dbFile)->semaName, PR_SEM_CREATE, 0666, s_cl5Desc.dbConfig.maxConcurrentWrites );
+ (*dbFile)->sema = PR_OpenSemaphore((*dbFile)->semaName,
+ PR_SEM_CREATE | PR_SEM_EXCL, 0666,
+ s_cl5Desc.dbConfig.maxConcurrentWrites );
slapi_log_error (SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5NewDBFile: maxConcurrentWrites=%d\n", s_cl5Desc.dbConfig.maxConcurrentWrites );
}
if ((*dbFile)->sema == NULL )
{
- slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
- "_cl5NewDBFile: failed to create semaphore %s; NSPR error - %d\n",
- (*dbFile)->semaName ? (*dbFile)->semaName : "(nil)", PR_GetError ());
- rc = CL5_SYSTEM_ERROR;
- goto done;
+ /* If the semaphore was left around due
+ * to an unclean exit last time, remove
+ * and re-create it.
+ */
+ if (PR_GetError() == PR_FILE_EXISTS_ERROR) {
+ PR_DeleteSemaphore((*dbFile)->semaName);
+ (*dbFile)->sema = PR_OpenSemaphore((*dbFile)->semaName,
+ PR_SEM_CREATE | PR_SEM_EXCL, 0666,
+ s_cl5Desc.dbConfig.maxConcurrentWrites );
+ }
+
+ /* If we still failed to create the semaphore,
+ * we should just error out. */
+ if ((*dbFile)->sema == NULL )
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
+ "_cl5NewDBFile: failed to create semaphore %s; NSPR error - %d\n",
+ (*dbFile)->semaName ? (*dbFile)->semaName : "(nil)", PR_GetError());
+ rc = CL5_SYSTEM_ERROR;
+ goto done;
+ }
}
/* compute number of entries in the file */
15 years, 5 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm ldbm_attrcrypt_config.c, 1.6, 1.7 ldbm_config.c, 1.16, 1.17 ldbm_index_config.c, 1.8, 1.9 ldbm_modrdn.c, 1.9, 1.10
by Nathan Kinder
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9536/ldap/servers/slapd/back-ldbm
Modified Files:
ldbm_attrcrypt_config.c ldbm_config.c ldbm_index_config.c
ldbm_modrdn.c
Log Message:
Resolves: 470918
Summary: Made replica_set_updatedn detect value add modify operations properly.
Index: ldbm_attrcrypt_config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ldbm_attrcrypt_config.c 10 Nov 2006 23:45:39 -0000 1.6
+++ ldbm_attrcrypt_config.c 13 Nov 2008 23:08:18 -0000 1.7
@@ -304,7 +304,7 @@
if (strcasecmp(config_attr, "nsEncryptionAlgorithm") == 0) {
- if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) {
+ if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
for (j = 0; mods[i]->mod_bvalues[j] != NULL; j++) {
int cipher = ldbm_attrcrypt_parse_cipher(mods[i]->mod_bvalues[j]->bv_val);
@@ -315,7 +315,7 @@
}
continue;
}
- if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) {
+ if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) {
if ((mods[i]->mod_bvalues == NULL) ||
(mods[i]->mod_bvalues[0] == NULL)) {
/* Not legal */
Index: ldbm_config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_config.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ldbm_config.c 17 Oct 2008 16:54:47 -0000 1.16
+++ ldbm_config.c 13 Nov 2008 23:08:18 -0000 1.17
@@ -1727,8 +1727,8 @@
continue;
}
- if ((mods[i]->mod_op & LDAP_MOD_DELETE) ||
- ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD)) {
+ if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op) ||
+ SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
rc= LDAP_UNWILLING_TO_PERFORM;
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "%s attributes is not allowed",
(mods[i]->mod_op & LDAP_MOD_DELETE) ? "Deleting" : "Adding");
Index: ldbm_index_config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_index_config.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ldbm_index_config.c 15 Jul 2008 16:49:43 -0000 1.8
+++ ldbm_index_config.c 13 Nov 2008 23:08:19 -0000 1.9
@@ -392,14 +392,14 @@
config_attr = (char *)mods[i]->mod_type;
if (strcasecmp(config_attr, "nsIndexType") == 0) {
- if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) {
+ if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
for (j = 0; mods[i]->mod_bvalues[j] != NULL; j++) {
charray_add(&addIndexTypesArray,
slapi_ch_strdup(mods[i]->mod_bvalues[j]->bv_val));
}
continue;
}
- if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) {
+ if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) {
if ((mods[i]->mod_bvalues == NULL) ||
(mods[i]->mod_bvalues[0] == NULL)) {
if (deleteIndexTypesArray) {
@@ -416,14 +416,14 @@
}
}
if (strcasecmp(config_attr, "nsMatchingRule") == 0) {
- if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) {
+ if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
for (j = 0; mods[i]->mod_bvalues[j] != NULL; j++) {
charray_add(&addMatchingRulesArray,
slapi_ch_strdup(mods[i]->mod_bvalues[j]->bv_val));
}
continue;
}
- if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) {
+ if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) {
if ((mods[i]->mod_bvalues == NULL) ||
(mods[i]->mod_bvalues[0] == NULL)) {
if (deleteMatchingRulesArray) {
Index: ldbm_modrdn.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ldbm_modrdn.c 17 Oct 2008 22:12:48 -0000 1.9
+++ ldbm_modrdn.c 13 Nov 2008 23:08:19 -0000 1.10
@@ -977,7 +977,7 @@
for (mod = slapi_mods_get_first_mod(smods_wsi);
mod != NULL;
mod = slapi_mods_get_next_mod(smods_wsi)) {
- if (((mod->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) &&
+ if (SLAPI_IS_MOD_DELETE(mod->mod_op) &&
(strcasecmp(mod->mod_type, type) == 0) &&
(mod->mod_bvalues != NULL) &&
(slapi_attr_value_cmp(attr, *mod->mod_bvalues, bvp) == 0)) {
15 years, 5 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/chainingdb cb_config.c, 1.7, 1.8 cb_instance.c, 1.11, 1.12
by Nathan Kinder
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/chainingdb
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9536/ldap/servers/plugins/chainingdb
Modified Files:
cb_config.c cb_instance.c
Log Message:
Resolves: 470918
Summary: Made replica_set_updatedn detect value add modify operations properly.
Index: cb_config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/chainingdb/cb_config.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- cb_config.c 27 Jun 2008 19:28:22 -0000 1.7
+++ cb_config.c 13 Nov 2008 23:08:17 -0000 1.8
@@ -429,17 +429,17 @@
return SLAPI_DSE_CALLBACK_ERROR;
}
- if ( mods[i]->mod_op & LDAP_MOD_REPLACE) {
+ if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)) {
if (!done) {
cb_unregister_all_supported_control(cb);
done=1;
}
cb_register_supported_control(cb,config_attr_value,0);
} else
- if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) {
+ if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
cb_register_supported_control(cb,config_attr_value,0);
} else
- if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) {
+ if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) {
cb_unregister_supported_control(cb,config_attr_value,0);
}
}
@@ -450,7 +450,7 @@
/* assume single-valued */
if (mods[i]->mod_op & LDAP_MOD_DELETE)
cb_set_debug(0);
- else if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD)
+ else if (SLAPI_IS_MOD_ADD(mods[i]->mod_op))
cb_set_debug(1);
} else
if ( !strcasecmp ( attr_name, CB_CONFIG_GLOBAL_CHAINING_COMPONENTS )) {
@@ -461,7 +461,7 @@
for (j = 0; mods[i]->mod_bvalues && mods[i]->mod_bvalues[j]; j++) {
config_attr_value = (char *) mods[i]->mod_bvalues[j]->bv_val;
- if ( mods[i]->mod_op & LDAP_MOD_REPLACE) {
+ if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)) {
if (!done) {
charray_free(cb->config.chaining_components);
cb->config.chaining_components=NULL;
@@ -471,11 +471,11 @@
charray_add(&cb->config.chaining_components,
slapi_dn_normalize(slapi_ch_strdup(config_attr_value)));
} else
- if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) {
+ if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
charray_add(&cb->config.chaining_components,
slapi_dn_normalize(slapi_ch_strdup(config_attr_value)));
} else
- if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) {
+ if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) {
charray_remove(cb->config.chaining_components,
slapi_dn_normalize(slapi_ch_strdup(config_attr_value)),
0 /* freeit */);
@@ -496,7 +496,7 @@
for (j = 0; mods[i]->mod_bvalues && mods[i]->mod_bvalues[j]; j++) {
config_attr_value = (char *) mods[i]->mod_bvalues[j]->bv_val;
- if ( mods[i]->mod_op & LDAP_MOD_REPLACE) {
+ if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)) {
if (!done) {
charray_free(cb->config.chainable_components);
cb->config.chainable_components=NULL;
@@ -506,12 +506,12 @@
slapi_dn_normalize(slapi_ch_strdup(config_attr_value)
));
} else
- if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) {
+ if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
charray_add(&cb->config.chainable_components,
slapi_dn_normalize(slapi_ch_strdup(config_attr_value)
));
} else
- if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) {
+ if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) {
charray_remove(cb->config.chainable_components,
slapi_dn_normalize(slapi_ch_strdup(config_attr_value)
),
Index: cb_instance.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/chainingdb/cb_instance.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- cb_instance.c 5 Nov 2008 18:21:05 -0000 1.11
+++ cb_instance.c 13 Nov 2008 23:08:17 -0000 1.12
@@ -323,8 +323,8 @@
if ( !strcasecmp ( attr_name, CB_CONFIG_BINDUSER )) {
/* Make sure value is not forbidden */
- if ((mods[i]->mod_op & LDAP_MOD_REPLACE) ||
- ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD)) {
+ if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op) ||
+ SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
rc = cb_instance_config_set((void *) inst, attr_name,
cb_the_instance_config, mods[i]->mod_bvalues[0], returntext,
@@ -333,8 +333,8 @@
}
}
- if ((mods[i]->mod_op & LDAP_MOD_DELETE) ||
- ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD)) {
+ if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op) ||
+ SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
rc= LDAP_UNWILLING_TO_PERFORM;
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "%s attributes is not allowed",
(mods[i]->mod_op & LDAP_MOD_DELETE) ? "Deleting" : "Adding");
@@ -383,7 +383,7 @@
PR_RWLock_Wlock(inst->rwl_config_lock);
for (j = 0; mods[i]->mod_bvalues && mods[i]->mod_bvalues[j]; j++) {
config_attr_value = (char *) mods[i]->mod_bvalues[j]->bv_val;
- if ( mods[i]->mod_op & LDAP_MOD_REPLACE) {
+ if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)) {
if (!done) {
charray_free(inst->illegal_attributes);
inst->illegal_attributes=NULL;
@@ -392,11 +392,11 @@
charray_add(&inst->illegal_attributes,
slapi_ch_strdup(config_attr_value));
} else
- if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) {
+ if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
charray_add(&inst->illegal_attributes,
slapi_ch_strdup(config_attr_value));
} else
- if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) {
+ if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) {
charray_remove(inst->illegal_attributes,
slapi_ch_strdup(config_attr_value),
0 /* freeit */);
@@ -417,7 +417,7 @@
PR_RWLock_Wlock(inst->rwl_config_lock);
for (j = 0; mods[i]->mod_bvalues && mods[i]->mod_bvalues[j]; j++) {
config_attr_value = (char *) mods[i]->mod_bvalues[j]->bv_val;
- if ( mods[i]->mod_op & LDAP_MOD_REPLACE) {
+ if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)) {
if (!done) {
charray_free(inst->chaining_components);
inst->chaining_components=NULL;
@@ -427,11 +427,11 @@
charray_add(&inst->chaining_components,
slapi_dn_normalize(slapi_ch_strdup(config_attr_value)));
} else
- if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) {
+ if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
charray_add(&inst->chaining_components,
slapi_dn_normalize(slapi_ch_strdup(config_attr_value)));
} else
- if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) {
+ if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) {
charray_remove(inst->chaining_components,
slapi_dn_normalize(slapi_ch_strdup(config_attr_value)),
0 /* freeit */);
@@ -447,8 +447,8 @@
- if ((mods[i]->mod_op & LDAP_MOD_DELETE) ||
- ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD)) {
+ if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op) ||
+ SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
/* Special processing for binddn & password */
/* because they are optional */
15 years, 5 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd mapping_tree.c, 1.15, 1.16 modify.c, 1.18, 1.19 schema.c, 1.16, 1.17 slapi-plugin.h, 1.34, 1.35
by Nathan Kinder
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9536/ldap/servers/slapd
Modified Files:
mapping_tree.c modify.c schema.c slapi-plugin.h
Log Message:
Resolves: 470918
Summary: Made replica_set_updatedn detect value add modify operations properly.
Index: mapping_tree.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/mapping_tree.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- mapping_tree.c 8 Oct 2008 17:29:03 -0000 1.15
+++ mapping_tree.c 13 Nov 2008 23:08:18 -0000 1.16
@@ -1063,7 +1063,7 @@
/* if we are deleting this attribute the new parent
* node will be mapping_tree_root
*/
- if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE)
+ if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op))
{
parent_node = mapping_tree_root;
}
@@ -1153,7 +1153,7 @@
/* state change
* for now only allow replace
*/
- if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) != LDAP_MOD_REPLACE)
+ if (!SLAPI_IS_MOD_REPLACE(mods[i]->mod_op))
{
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "must use replace operation to change state\n");
*returncode = LDAP_UNWILLING_TO_PERFORM;
@@ -1206,8 +1206,8 @@
mtn_wlock();
- if (((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_REPLACE)
- || ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD))
+ if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)
+ || SLAPI_IS_MOD_ADD(mods[i]->mod_op))
{
/* delete old referrals, set new ones */
mtn_free_referral_in_node(node);
@@ -1215,7 +1215,7 @@
node->mtn_referral = referral;
node->mtn_referral_entry =
referral2entry(referral, slapi_sdn_get_dn(subtree));
- } else if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE)
+ } else if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op))
{
/* it is not OK to delete the referrals if they are still
* used
@@ -1249,8 +1249,8 @@
else if (strcasecmp(mods[i]->mod_type,
"nsslapd-distribution-funct" ) == 0)
{
- if (((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_REPLACE)
- || ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD))
+ if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)
+ || SLAPI_IS_MOD_ADD(mods[i]->mod_op))
{
slapi_entry_attr_find(entryAfter,
"nsslapd-distribution-funct", &attr);
@@ -1264,7 +1264,7 @@
}
plugin_fct = slapi_ch_strdup(slapi_value_get_string(val));
}
- else if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE)
+ else if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op))
{
plugin_fct = NULL;
}
@@ -1273,8 +1273,8 @@
else if (strcasecmp(mods[i]->mod_type,
"nsslapd-distribution-plugin" ) == 0)
{
- if (((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_REPLACE)
- || ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD))
+ if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)
+ || SLAPI_IS_MOD_ADD(mods[i]->mod_op))
{
slapi_entry_attr_find(entryAfter,
"nsslapd-distribution-plugin", &attr);
@@ -1288,7 +1288,7 @@
}
plugin_lib = slapi_ch_strdup(slapi_value_get_string(val));
}
- else if ((mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE)
+ else if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op))
{
plugin_lib = NULL;
}
Index: modify.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/modify.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- modify.c 24 Oct 2008 22:36:58 -0000 1.18
+++ modify.c 13 Nov 2008 23:08:18 -0000 1.19
@@ -637,7 +637,7 @@
while ( tmpmods && *tmpmods )
{
if ((*tmpmods)->mod_bvalues != NULL &&
- (((*tmpmods)->mod_op & ~LDAP_MOD_BVALUES) != LDAP_MOD_DELETE))
+ !SLAPI_IS_MOD_DELETE((*tmpmods)->mod_op))
{
for (i=0; i < numattr; i++)
{
Index: schema.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/schema.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- schema.c 15 Jul 2008 16:49:42 -0000 1.16
+++ schema.c 13 Nov 2008 23:08:18 -0000 1.17
@@ -1681,7 +1681,7 @@
/*
* Delete an objectclass or attribute
*/
- if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE) {
+ if (SLAPI_IS_MOD_DELETE(mods[i]->mod_op)) {
if (strcasecmp (mods[i]->mod_type, "objectclasses") == 0) {
*returncode = schema_delete_objectclasses (entryBefore, mods[i],
returntext, SLAPI_DSE_RETURNTEXT_SIZE, schema_ds4x_compat );
@@ -1707,7 +1707,7 @@
/*
* Replace an objectclass,attribute, or schema CSN
*/
- else if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_REPLACE) {
+ else if (SLAPI_IS_MOD_REPLACE(mods[i]->mod_op)) {
int replace_allowed = 0;
slapdFrontendConfig_t *slapdFrontendConfig;
@@ -1777,7 +1777,7 @@
/*
* Add an objectclass or attribute
*/
- else if ( (mods[i]->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) {
+ else if (SLAPI_IS_MOD_ADD(mods[i]->mod_op)) {
if (strcasecmp (mods[i]->mod_type, "attributetypes") == 0) {
/*
* Add a new attribute
Index: slapi-plugin.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/slapi-plugin.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- slapi-plugin.h 5 Nov 2008 18:21:06 -0000 1.34
+++ slapi-plugin.h 13 Nov 2008 23:08:18 -0000 1.35
@@ -1897,6 +1897,10 @@
/* Size of the database, in kilobytes */
#define SLAPI_DBSIZE 199
+/* convenience macros for checking modify operation types */
+#define SLAPI_IS_MOD_ADD(x) (((x) & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD)
+#define SLAPI_IS_MOD_DELETE(x) (((x) & ~LDAP_MOD_BVALUES) == LDAP_MOD_DELETE)
+#define SLAPI_IS_MOD_REPLACE(x) (((x) & ~LDAP_MOD_BVALUES) == LDAP_MOD_REPLACE)
#ifdef __cplusplus
}
15 years, 5 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/uiduniq 7bit.c, 1.7, 1.8 uid.c, 1.8, 1.9
by Nathan Kinder
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/uiduniq
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9536/ldap/servers/plugins/uiduniq
Modified Files:
7bit.c uid.c
Log Message:
Resolves: 470918
Summary: Made replica_set_updatedn detect value add modify operations properly.
Index: 7bit.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/uiduniq/7bit.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- 7bit.c 10 Nov 2006 23:45:31 -0000 1.7
+++ 7bit.c 13 Nov 2008 23:08:18 -0000 1.8
@@ -458,8 +458,8 @@
if ((slapi_attr_type_cmp(mod->mod_type, attr_name, 1) == 0) && /* mod contains target attr */
(mod->mod_op & LDAP_MOD_BVALUES) && /* mod is bval encoded (not string val) */
(mod->mod_bvalues && mod->mod_bvalues[0]) && /* mod actually contains some values */
- (((mod->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) || /* mod is add */
- (mod->mod_op & LDAP_MOD_REPLACE))) /* mod is replace */
+ (SLAPI_IS_MOD_ADD(mod->mod_op) || /* mod is add */
+ SLAPI_IS_MOD_REPLACE(mod->mod_op))) /* mod is replace */
{
addMod(&checkmods, &checkmodsCapacity, &modcount, mod);
}
Index: uid.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/uiduniq/uid.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- uid.c 10 Nov 2006 23:45:31 -0000 1.8
+++ uid.c 13 Nov 2008 23:08:18 -0000 1.9
@@ -727,8 +727,8 @@
if ((slapi_attr_type_cmp(mod->mod_type, attrName, 1) == 0) && /* mod contains target attr */
(mod->mod_op & LDAP_MOD_BVALUES) && /* mod is bval encoded (not string val) */
(mod->mod_bvalues && mod->mod_bvalues[0]) && /* mod actually contains some values */
- (((mod->mod_op & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD) || /* mod is add */
- (mod->mod_op & LDAP_MOD_REPLACE))) /* mod is replace */
+ (SLAPI_IS_MOD_ADD(mod->mod_op) || /* mod is add */
+ SLAPI_IS_MOD_REPLACE(mod->mod_op))) /* mod is replace */
{
addMod(&checkmods, &checkmodsCapacity, &modcount, mod);
}
15 years, 5 months