console/src/com/netscape/management/client/security PromptForTrustDialog.java, 1.1.1.1, 1.2
by Nathan Kinder
Author: nkinder
Update of /cvs/dirsec/console/src/com/netscape/management/client/security
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv18942/src/com/netscape/management/client/security
Modified Files:
PromptForTrustDialog.java
Log Message:
Bug 654990 - Certificate prompt window does not autosize
The JTextArea that we use in the dialog that prompts for certificate trust is
unable to determine it's proper preferred size since it is created with no rows
and no columns. This requires us to call pack() twice before it can get it's
proper preferred size. This is detailed in
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4446522.
Index: PromptForTrustDialog.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/security/PromptForTrustDialog.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- PromptForTrustDialog.java 18 Jul 2005 00:34:17 -0000 1.1.1.1
+++ PromptForTrustDialog.java 21 Feb 2011 20:58:01 -0000 1.2
@@ -87,6 +87,10 @@
if (parent == null) {
ModalDialogUtil.setCenteredDialog(this);
}
+ // We need to call pack() twice to get the JTextArea we use to display at
+ // the right size. See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4446522
+ // for more details.
+ pack();
pack();
}
13 years, 1 month
console/src/com/netscape/management/client/ace ACIEditor.java, 1.2, 1.3
by Nathan Kinder
Author: nkinder
Update of /cvs/dirsec/console/src/com/netscape/management/client/ace
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv14411/src/com/netscape/management/client/ace
Modified Files:
ACIEditor.java
Log Message:
Bug: 594939 - ACI editing dialog initial size is not big enough to display
The problem had to do with the preferred size of the JTextArea that holds the
ACI name having an unusually large height. The JTextArea had line wrapping
enabled, yet it's default size was not set. This was resulting in it thinking
that it needed a huge height due to a lot of text wrapping.
The fix is to set the initial rows and columns of the text area when we call
it's constructor and to contain the text area in a scrollable pane. This
results in a sane preferred size and allows a long ACI name to line wrap
properly.
Index: ACIEditor.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/ace/ACIEditor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ACIEditor.java 26 Oct 2005 23:16:20 -0000 1.2
+++ ACIEditor.java 21 Feb 2011 17:49:39 -0000 1.3
@@ -79,7 +79,7 @@
private Vector tabVector = new Vector(); // elements instanceof IACITabs
private JTabbedPane tabbedPane = null;
private JFrame parentFrame = null;
- private JTextArea aciNameField = new JTextArea();
+ private JTextArea aciNameField = new JTextArea(2,30);
private LDAPConnection aciLdc;
private LDAPConnection ugLdc;
private String aciDN = null;
@@ -561,14 +561,14 @@
gbc.gridwidth = 1; gbc.gridheight = 1;
gbc.weightx = 0.0; gbc.weighty = 0.0;
gbc.anchor = GridBagConstraints.EAST;
- gbc.fill = GridBagConstraints.HORIZONTAL;
+ gbc.fill = GridBagConstraints.BOTH;
gbc.insets = new Insets(0, 0, 0, 0);
aciNameField.setFont(FontFactory.getFont(FontFactory.FONT_MONOSPACED));
aciNameField.setLineWrap(true);
aciNameField.setWrapStyleWord(true);
aciNameField.setBorder(UIManager.getBorder("TextField.border"));
- p.add(aciNameField, gbc);
+ p.add(new JScrollPane(aciNameField), gbc);
gbc.gridx = 0; gbc.gridy = 1;
gbc.gridwidth = 2; gbc.gridheight = 1;
13 years, 1 month
Branch '389-ds-base-1.2.8' - 3 commits - ldap/servers
by Noriko Hosoi
ldap/servers/slapd/back-ldbm/cache.c | 43 ++++++++++++-
ldap/servers/slapd/back-ldbm/id2entry.c | 3
ldap/servers/slapd/back-ldbm/ldbm_search.c | 95 ++++++++++++++++++++++-------
ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 10 ---
ldap/servers/slapd/back-ldbm/sort.c | 1
ldap/servers/slapd/back-ldbm/vlv.c | 10 +--
ldap/servers/slapd/dse.c | 14 +---
7 files changed, 133 insertions(+), 43 deletions(-)
New commits:
commit 7205ca0f5374e11bc7d9aa156a1fdf0bfa6cd497
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Wed Feb 16 17:30:51 2011 -0800
Bug 676053 - export task followed by import task causes cache assertion
https://bugzilla.redhat.com/show_bug.cgi?id=676053
Description: There were 3 places where an entry was not released
by CACHE_RETURN (== not decrementing refcnt). If an entry has
positive refcnt in the entry cache, it won't be freed even if
the entry never be accessed again.
1. When a search request with VLV and/or SORT control failed.
2. When comparing entries in compare_entries_sv (sort.c), and the
second entry was not found, the first entry was not released.
3. vlv_trim_candidates_byvalue (vlv.c) retrieves entries for
performing binary search over the candidate list and put them
into the cache. They were not released.
This patch adds CACHE_RETURN call for the above cases.
diff --git a/ldap/servers/slapd/back-ldbm/cache.c b/ldap/servers/slapd/back-ldbm/cache.c
index 8e39c51..f21cd87 100644
--- a/ldap/servers/slapd/back-ldbm/cache.c
+++ b/ldap/servers/slapd/back-ldbm/cache.c
@@ -286,7 +286,6 @@ dump_hash(Hashtable *ht)
char *p;
int ids_size = 80;
- LDAPDebug0Args(LDAP_DEBUG_ANY, "entry cache:\n");
p = ep_ids;
for (i = 0; i < ht->size; i++) {
int len;
@@ -301,8 +300,8 @@ dump_hash(Hashtable *ht)
LDAPDebug1Arg(LDAP_DEBUG_ANY, "%s\n", ep_ids);
p = ep_ids; ids_size = 80;
}
- PR_snprintf(p, ids_size, "%s", ep_id);
- p += len; ids_size -= len + 1;
+ PR_snprintf(p, ids_size, "%s:", ep_id);
+ p += len + 1; ids_size -= len + 1;
} while (e = HASH_NEXT(ht, e));
}
if (p != ep_ids) {
@@ -614,6 +613,7 @@ static void entrycache_clear_int(struct cache *cache)
"entrycache_clear_int: there are still %ld entries "
"in the entry cache.\n", cache->c_curentries);
#ifdef LDAP_CACHE_DEBUG
+ LDAPDebug0Args(LDAP_DEBUG_ANY, "ID(s) in entry cache:\n");
dump_hash(cache->c_idtable);
#endif
}
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c b/ldap/servers/slapd/back-ldbm/ldbm_search.c
index 5565578..88af80f 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_search.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c
@@ -106,9 +106,24 @@ berval_done(struct berval *val)
/*
* We call this function as we exit ldbm_back_search
*/
-int ldbm_back_search_cleanup(Slapi_PBlock *pb, struct ldbminfo *li, sort_spec_thing *sort_control, int ldap_result, char* ldap_result_description, int function_result, Slapi_DN *sdn, struct vlv_request *vlv_request_control)
+static int
+ldbm_back_search_cleanup(Slapi_PBlock *pb,
+ struct ldbminfo *li,
+ sort_spec_thing *sort_control,
+ int ldap_result,
+ char* ldap_result_description,
+ int function_result,
+ Slapi_DN *sdn,
+ struct vlv_request *vlv_request_control,
+ struct backentry *e)
{
int estimate = 0; /* estimated search result count */
+ backend *be;
+ ldbm_instance *inst;
+
+ slapi_pblock_get( pb, SLAPI_BACKEND, &be );
+ inst = (ldbm_instance *) be->be_instance_info;
+ CACHE_RETURN(&inst->inst_cache, &e); /* NULL e is handled correctly */
if(sort_control!=NULL)
{
@@ -220,7 +235,10 @@ ldbm_back_search( Slapi_PBlock *pb )
if(r!=0)
{
/* Badly formed SORT control */
- return ldbm_back_search_cleanup(pb, li, sort_control, LDAP_PROTOCOL_ERROR, "Sort Control", SLAPI_FAIL_GENERAL, &basesdn, NULL);
+ return ldbm_back_search_cleanup(pb, li, sort_control,
+ LDAP_PROTOCOL_ERROR, "Sort Control",
+ SLAPI_FAIL_GENERAL, &basesdn,
+ NULL, NULL);
}
/* set this operation includes the server side sorting */
operation->o_flags |= OP_FLAG_SERVER_SIDE_SORTING;
@@ -236,7 +254,10 @@ ldbm_back_search( Slapi_PBlock *pb )
if(r!=LDAP_SUCCESS)
{
/* Badly formed VLV control */
- return ldbm_back_search_cleanup(pb, li, sort_control, r, "VLV Control", SLAPI_FAIL_GENERAL, &basesdn, &vlv_request_control);
+ return ldbm_back_search_cleanup(pb, li, sort_control,
+ r, "VLV Control",
+ SLAPI_FAIL_GENERAL, &basesdn,
+ &vlv_request_control, NULL);
}
{
/* Access Control Check to see if the client is allowed to use the VLV Control. */
@@ -255,7 +276,10 @@ ldbm_back_search( Slapi_PBlock *pb )
if(r!=LDAP_SUCCESS)
{
/* Client isn't allowed to do this. */
- return ldbm_back_search_cleanup(pb, li, sort_control, r, "VLV Control", SLAPI_FAIL_GENERAL, &basesdn, &vlv_request_control);
+ return ldbm_back_search_cleanup(pb, li, sort_control,
+ r, "VLV Control",
+ SLAPI_FAIL_GENERAL, &basesdn,
+ &vlv_request_control, NULL);
}
}
/*
@@ -267,7 +291,10 @@ ldbm_back_search( Slapi_PBlock *pb )
else
{
/* Can't have a VLV control without a SORT control */
- return ldbm_back_search_cleanup(pb, li, sort_control, LDAP_SORT_CONTROL_MISSING, "VLV Control", SLAPI_FAIL_GENERAL, &basesdn, &vlv_request_control);
+ return ldbm_back_search_cleanup(pb, li, sort_control,
+ LDAP_SORT_CONTROL_MISSING, "VLV Control",
+ SLAPI_FAIL_GENERAL, &basesdn,
+ &vlv_request_control, NULL);
}
}
}
@@ -320,13 +347,15 @@ ldbm_back_search( Slapi_PBlock *pb )
{
return ldbm_back_search_cleanup(pb, li, sort_control,
LDAP_UNWILLING_TO_PERFORM, ctrlstr,
- SLAPI_FAIL_GENERAL, &basesdn, &vlv_request_control);
+ SLAPI_FAIL_GENERAL, &basesdn,
+ &vlv_request_control, NULL);
}
else
{
return ldbm_back_search_cleanup(pb, li, sort_control,
LDAP_VIRTUAL_LIST_VIEW_ERROR, ctrlstr,
- SLAPI_FAIL_GENERAL, &basesdn, &vlv_request_control);
+ SLAPI_FAIL_GENERAL, &basesdn,
+ &vlv_request_control, NULL);
}
}
else
@@ -341,7 +370,8 @@ ldbm_back_search( Slapi_PBlock *pb )
sort_make_sort_response_control(pb, LDAP_UNWILLING_TO_PERFORM, NULL);
return ldbm_back_search_cleanup(pb, li, sort_control,
LDAP_UNAVAILABLE_CRITICAL_EXTENSION, ctrlstr,
- SLAPI_FAIL_GENERAL, &basesdn, &vlv_request_control);
+ SLAPI_FAIL_GENERAL, &basesdn,
+ &vlv_request_control, NULL);
}
else /* vlv and sorting are not critical, so ignore the control */
{
@@ -374,7 +404,8 @@ ldbm_back_search( Slapi_PBlock *pb )
if ( ( e = find_entry( pb, be, addr, NULL )) == NULL )
{
/* error or referral sent by find_entry */
- return ldbm_back_search_cleanup(pb, li, sort_control, -1, NULL, 1, &basesdn, &vlv_request_control);
+ return ldbm_back_search_cleanup(pb, li, sort_control,
+ -1, NULL, 1, &basesdn, &vlv_request_control, NULL);
}
}
@@ -407,12 +438,13 @@ ldbm_back_search( Slapi_PBlock *pb )
return ldbm_back_search_cleanup(pb, li, sort_control,
vlv_rc, "VLV Control",
SLAPI_FAIL_GENERAL, &basesdn,
- &vlv_request_control);
+ &vlv_request_control, e);
case VLV_BLD_LIST_FAILED:
return ldbm_back_search_cleanup(pb, li, sort_control,
vlv_response_control.result,
NULL, SLAPI_FAIL_GENERAL,
- &basesdn, &vlv_request_control);
+ &basesdn, &vlv_request_control,
+ e);
case LDAP_SUCCESS:
/* Log to the access log the particulars of this sort request */
@@ -434,7 +466,7 @@ ldbm_back_search( Slapi_PBlock *pb )
"Sort Response Control",
SLAPI_FAIL_GENERAL,
&basesdn,
- &vlv_request_control);
+ &vlv_request_control, e);
}
}
}
@@ -447,7 +479,7 @@ ldbm_back_search( Slapi_PBlock *pb )
/* Error result sent by build_candidate_list */
return ldbm_back_search_cleanup(pb, li, sort_control, -1,
NULL, rc, &basesdn,
- &vlv_request_control);
+ &vlv_request_control, e);
}
/*
* If we're sorting then we must check what administrative
@@ -491,7 +523,7 @@ ldbm_back_search( Slapi_PBlock *pb )
{
return ldbm_back_search_cleanup(pb, li, sort_control,
r, NULL, -1, &basesdn,
- &vlv_request_control);
+ &vlv_request_control, e);
}
}
/*
@@ -509,7 +541,7 @@ ldbm_back_search( Slapi_PBlock *pb )
return ldbm_back_search_cleanup(pb, li, sort_control,
LDAP_PROTOCOL_ERROR,
"Sort Response Control", -1,
- &basesdn, &vlv_request_control);
+ &basesdn, &vlv_request_control, e);
}
}
else
@@ -551,7 +583,7 @@ ldbm_back_search( Slapi_PBlock *pb )
LDAP_PROTOCOL_ERROR,
"Sort Control", -1,
&basesdn,
- &vlv_request_control);
+ &vlv_request_control, e);
case LDAP_UNWILLING_TO_PERFORM: /* Too hard */
case LDAP_OPERATIONS_ERROR: /* Operation error */
case LDAP_TIMELIMIT_EXCEEDED: /* Timeout */
@@ -593,7 +625,7 @@ ldbm_back_search( Slapi_PBlock *pb )
return ldbm_back_search_cleanup(pb, li, sort_control,
(abandoned?-1:LDAP_PROTOCOL_ERROR),
"Sort Response Control", -1,
- &basesdn, &vlv_request_control);
+ &basesdn, &vlv_request_control, e);
}
}
}
@@ -619,7 +651,7 @@ ldbm_back_search( Slapi_PBlock *pb )
return ldbm_back_search_cleanup(pb, li, sort_control,
vlv_response_control.result,
NULL, -1, &basesdn,
- &vlv_request_control);
+ &vlv_request_control, e);
}
}
else
@@ -638,7 +670,7 @@ ldbm_back_search( Slapi_PBlock *pb )
return ldbm_back_search_cleanup(pb, li, sort_control,
(abandoned?-1:LDAP_PROTOCOL_ERROR),
"VLV Response Control", -1,
- &basesdn, &vlv_request_control);
+ &basesdn, &vlv_request_control, e);
}
/* Log the VLV operation */
vlv_print_access_log(pb,&vlv_request_control,&vlv_response_control);
@@ -702,7 +734,7 @@ ldbm_back_search( Slapi_PBlock *pb )
/* tmp_err == -1: no error */
return ldbm_back_search_cleanup(pb, li, sort_control, tmp_err, tmp_desc,
(tmp_err == -1 ? 0 : -1), &basesdn,
- &vlv_request_control);
+ &vlv_request_control, NULL);
/* end Fix for bugid #394184 */
}
diff --git a/ldap/servers/slapd/back-ldbm/sort.c b/ldap/servers/slapd/back-ldbm/sort.c
index 7a2a9c9..2c9595d 100644
--- a/ldap/servers/slapd/back-ldbm/sort.c
+++ b/ldap/servers/slapd/back-ldbm/sort.c
@@ -632,6 +632,7 @@ static int compare_entries_sv(ID *id_a, ID *id_b, sort_spec *s,baggage_carrier *
if (0 != err ) {
LDAPDebug(LDAP_DEBUG_TRACE,"compare_entries db err %d\n",err,0,0);
}
+ CACHE_RETURN(&inst->inst_cache,&a);
return 0;
}
/* OK, now we have the entries, so we work our way down the attribute list comparing as we go */
diff --git a/ldap/servers/slapd/back-ldbm/vlv.c b/ldap/servers/slapd/back-ldbm/vlv.c
index c68ce64..ea08fd6 100644
--- a/ldap/servers/slapd/back-ldbm/vlv.c
+++ b/ldap/servers/slapd/back-ldbm/vlv.c
@@ -1634,10 +1634,10 @@ retry:
{
match= sort_attr_compare((struct berval**)typedown_value, entry_value, compare_fn);
}
- if (needFree) {
- ber_bvecfree((struct berval**)entry_value);
- entry_value = NULL;
- }
+ if (needFree) {
+ ber_bvecfree((struct berval**)entry_value);
+ entry_value = NULL;
+ }
}
else
{
@@ -1690,6 +1690,8 @@ retry:
LDAPDebug( LDAP_DEBUG_TRACE, "<= vlv_trim_candidates_byvalue: Found. Index %lu\n",si, 0, 0 );
}
}
+ CACHE_RETURN(&(((ldbm_instance *)be->be_instance_info)->inst_cache),
+ &e);
}
} while (!found);
ber_bvecfree((struct berval**)typedown_value);
commit 22b30dda3e7477014a5a91b6376bed5fae4766bb
Author: Noriko Hosoi <nhosoi(a)jiji.usersys.redhat.com>
Date: Mon Feb 14 15:06:57 2011 -0800
Bug 676053 - export task followed by import task causes cache assertion
https://bugzilla.redhat.com/show_bug.cgi?id=676053
Description: When Simple Paged Results is requested and a page is
returned, one entry is read ahead to check whether more entries
exist or not. The read-ahead retrieves an entry (if any) and adds
it into the entry cache. Simple Paged Results code puts the read-
ahead entry back, but there was missing to call cache_return for
the entry (that decrementing refcnt). If ldif2db.pl is called with
the cache state, it finds out the entry which is still referred.
This patch calls cache_return when the Simple Paged Results puts
the read-ahead entry back. Plus, adding a debug function dump_hash.
diff --git a/ldap/servers/slapd/back-ldbm/cache.c b/ldap/servers/slapd/back-ldbm/cache.c
index 721a838..8e39c51 100644
--- a/ldap/servers/slapd/back-ldbm/cache.c
+++ b/ldap/servers/slapd/back-ldbm/cache.c
@@ -275,6 +275,42 @@ int remove_hash(Hashtable *ht, const void *key, size_t keylen)
return 0;
}
+#ifdef LDAP_CACHE_DEBUG
+void
+dump_hash(Hashtable *ht)
+{
+ u_long i;
+ void *e;
+ char ep_id[16];
+ char ep_ids[80];
+ char *p;
+ int ids_size = 80;
+
+ LDAPDebug0Args(LDAP_DEBUG_ANY, "entry cache:\n");
+ p = ep_ids;
+ for (i = 0; i < ht->size; i++) {
+ int len;
+ e = ht->slot[i];
+ if (NULL == e) {
+ continue;
+ }
+ do {
+ PR_snprintf(ep_id, 16, "%u", ((struct backcommon *)e)->ep_id);
+ len = strlen(ep_id);
+ if (ids_size < len + 1) {
+ LDAPDebug1Arg(LDAP_DEBUG_ANY, "%s\n", ep_ids);
+ p = ep_ids; ids_size = 80;
+ }
+ PR_snprintf(p, ids_size, "%s", ep_id);
+ p += len; ids_size -= len + 1;
+ } while (e = HASH_NEXT(ht, e));
+ }
+ if (p != ep_ids) {
+ LDAPDebug1Arg(LDAP_DEBUG_ANY, "%s\n", ep_ids);
+ }
+}
+#endif
+
/* hashtable distribution stats --
* slots: # of slots in the hashtable
* total_entries: # of entries in the hashtable
@@ -574,9 +610,12 @@ static void entrycache_clear_int(struct cache *cache)
}
cache->c_maxsize = size;
if (cache->c_curentries > 0) {
- LDAPDebug1Arg(LDAP_DEBUG_ANY,
+ LDAPDebug1Arg(LDAP_DEBUG_ANY,
"entrycache_clear_int: there are still %ld entries "
- "in the entry cache. :/\n", cache->c_curentries);
+ "in the entry cache.\n", cache->c_curentries);
+#ifdef LDAP_CACHE_DEBUG
+ dump_hash(cache->c_idtable);
+#endif
}
}
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c b/ldap/servers/slapd/back-ldbm/ldbm_search.c
index 568d32c..5565578 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_search.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c
@@ -1458,9 +1458,32 @@ bail:
void
ldbm_back_prev_search_results( Slapi_PBlock *pb )
{
+ backend *be;
+ ldbm_instance *inst;
back_search_result_set *sr;
+
+ slapi_pblock_get( pb, SLAPI_BACKEND, &be );
+ if (!be) {
+ LDAPDebug0Args(LDAP_DEBUG_ANY,
+ "ldbm_back_prev_search_results: no backend\n");
+ return;
+ }
+ inst = (ldbm_instance *) be->be_instance_info;
+ if (!inst) {
+ LDAPDebug0Args(LDAP_DEBUG_ANY,
+ "ldbm_back_prev_search_results: no backend instance\n");
+ return;
+ }
slapi_pblock_get( pb, SLAPI_SEARCH_RESULT_SET, &sr );
if (sr) {
+ if (sr->sr_entry) {
+ /* The last entry should be returned to cache */
+ LDAPDebug1Arg(LDAP_DEBUG_BACKLDBM,
+ "ldbm_back_prev_search_results: returning: %s\n",
+ slapi_entry_get_dn_const(sr->sr_entry->ep_entry));
+ CACHE_RETURN (&inst->inst_cache, &(sr->sr_entry));
+ sr->sr_entry = NULL;
+ }
idl_iterator_decrement(&(sr->sr_current));
}
return;
commit 1ac3eaedebb3821b74b0f5a50820cced8c8a8738
Author: Noriko Hosoi <nhosoi(a)jiji.usersys.redhat.com>
Date: Thu Feb 10 16:29:23 2011 -0800
Bug 676053 - export task followed by import task causes cache assertion
https://bugzilla.redhat.com/show_bug.cgi?id=676053
Description: Task version of export had a bug in handling the busy
instance error case. When returning due to the busy error, the
function ldbm_back_ldbm2ldif reset the busy bit set by other threads.
This patch checks the special return value set in the busy error
case and resets the busy bit only when it is set by the function.
Also, this patch fixes a bug in dse_add which replaces an adding
entry with its copy in pblock and the original entry is consumed.
But the caller frees the original entry. Applying this patch,
instead of consuming the original entry, its copy is consumed and
the original adding entry stays in the pblock.
diff --git a/ldap/servers/slapd/back-ldbm/id2entry.c b/ldap/servers/slapd/back-ldbm/id2entry.c
index c509d3a..432f80a 100644
--- a/ldap/servers/slapd/back-ldbm/id2entry.c
+++ b/ldap/servers/slapd/back-ldbm/id2entry.c
@@ -305,7 +305,8 @@ id2entry( backend *be, ID id, back_txn *txn, int *err )
goto bail;
}
- if ( (*err = dblayer_get_id2entry( be, &db )) != 0 ) {
+ *err = dblayer_get_id2entry( be, &db );
+ if ( (*err != 0) || (NULL == db) ) {
slapi_log_error(SLAPI_LOG_FATAL, ID2ENTRY,
"Could not open id2entry err %d\n", *err);
return( NULL );
diff --git a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
index a89f5e9..ccad8e6 100644
--- a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
+++ b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
@@ -1024,6 +1024,7 @@ bail:
* ldif file.
* (reunified at last)
*/
+#define LDBM2LDIF_BUSY (-2)
int
ldbm_back_ldbm2ldif( Slapi_PBlock *pb )
{
@@ -1147,7 +1148,7 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb )
LDAPDebug(LDAP_DEBUG_ANY, "ldbm: '%s' is already in the middle"
" of another task and cannot be disturbed.\n",
inst->inst_name, 0, 0);
- return_value = -1;
+ return_value = LDBM2LDIF_BUSY;
goto bye;
}
}
@@ -1585,17 +1586,12 @@ bye:
}
}
- if (!run_from_cmdline && NULL != inst) {
+ if (!run_from_cmdline && inst && (LDBM2LDIF_BUSY != return_value)) {
instance_set_not_busy(inst);
}
ldbm_back_free_incl_excl(include_suffix, exclude_suffix);
idl_free(eargs.pre_exported_idl);
- if (inst != NULL) {
- PR_Lock(inst->inst_config_mutex);
- inst->inst_flags &= ~INST_FLAG_BUSY;
- PR_Unlock(inst->inst_config_mutex);
- }
return( return_value );
}
diff --git a/ldap/servers/slapd/dse.c b/ldap/servers/slapd/dse.c
index c270892..d5d3e23 100644
--- a/ldap/servers/slapd/dse.c
+++ b/ldap/servers/slapd/dse.c
@@ -2066,25 +2066,21 @@ dse_add(Slapi_PBlock *pb) /* JCM There should only be one exit point from this f
return dse_add_return(error, NULL);
}
- /* make copy for postop fns because add_entry_pb consumes e */
+ /* make copy for postop fns because add_entry_pb consumes the given entry */
e_copy = slapi_entry_dup(e);
- if ( dse_add_entry_pb(pdse, e, pb) != 0)
+ if ( dse_add_entry_pb(pdse, e_copy, pb) != 0)
{
slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL );
slapi_sdn_done(&sdn);
return dse_add_return(error, e_copy);
}
-
- /* e has been consumed, so use the copy for the post ops */
- slapi_pblock_set(pb, SLAPI_ADD_ENTRY, e_copy);
-
/* The postop must be called after the write lock is released. */
- dse_call_callback(pdse, pb, SLAPI_OPERATION_ADD, DSE_FLAG_POSTOP, e_copy, NULL, &returncode, returntext);
+ dse_call_callback(pdse, pb, SLAPI_OPERATION_ADD, DSE_FLAG_POSTOP, e, NULL, &returncode, returntext);
/* We have been successful. Tell the user */
slapi_send_ldap_result( pb, returncode, NULL, NULL, 0, NULL );
- slapi_pblock_set( pb, SLAPI_ENTRY_POST_OP, slapi_entry_dup( e_copy ));
+ slapi_pblock_set( pb, SLAPI_ENTRY_POST_OP, slapi_entry_dup( e ));
/* entry has been freed, so make sure no one tries to use it later */
slapi_pblock_set(pb, SLAPI_ADD_ENTRY, NULL);
@@ -2092,7 +2088,7 @@ dse_add(Slapi_PBlock *pb) /* JCM There should only be one exit point from this f
/* Free the dn, and return */
slapi_sdn_done(&sdn);
- return dse_add_return(rc, e_copy);
+ return dse_add_return(rc, e);
}
/*
13 years, 1 month
3 commits - ldap/servers
by Noriko Hosoi
ldap/servers/slapd/back-ldbm/cache.c | 43 ++++++++++++-
ldap/servers/slapd/back-ldbm/id2entry.c | 3
ldap/servers/slapd/back-ldbm/ldbm_search.c | 95 ++++++++++++++++++++++-------
ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 10 ---
ldap/servers/slapd/back-ldbm/sort.c | 1
ldap/servers/slapd/back-ldbm/vlv.c | 10 +--
ldap/servers/slapd/dse.c | 14 +---
7 files changed, 133 insertions(+), 43 deletions(-)
New commits:
commit da14d3c8a14b015d17f8b8bbcb16f9aa7d6ccd86
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Wed Feb 16 17:30:51 2011 -0800
Bug 676053 - export task followed by import task causes cache assertion
https://bugzilla.redhat.com/show_bug.cgi?id=676053
Description: There were 3 places where an entry was not released
by CACHE_RETURN (== not decrementing refcnt). If an entry has
positive refcnt in the entry cache, it won't be freed even if
the entry never be accessed again.
1. When a search request with VLV and/or SORT control failed.
2. When comparing entries in compare_entries_sv (sort.c), and the
second entry was not found, the first entry was not released.
3. vlv_trim_candidates_byvalue (vlv.c) retrieves entries for
performing binary search over the candidate list and put them
into the cache. They were not released.
This patch adds CACHE_RETURN call for the above cases.
diff --git a/ldap/servers/slapd/back-ldbm/cache.c b/ldap/servers/slapd/back-ldbm/cache.c
index 8e39c51..f21cd87 100644
--- a/ldap/servers/slapd/back-ldbm/cache.c
+++ b/ldap/servers/slapd/back-ldbm/cache.c
@@ -286,7 +286,6 @@ dump_hash(Hashtable *ht)
char *p;
int ids_size = 80;
- LDAPDebug0Args(LDAP_DEBUG_ANY, "entry cache:\n");
p = ep_ids;
for (i = 0; i < ht->size; i++) {
int len;
@@ -301,8 +300,8 @@ dump_hash(Hashtable *ht)
LDAPDebug1Arg(LDAP_DEBUG_ANY, "%s\n", ep_ids);
p = ep_ids; ids_size = 80;
}
- PR_snprintf(p, ids_size, "%s", ep_id);
- p += len; ids_size -= len + 1;
+ PR_snprintf(p, ids_size, "%s:", ep_id);
+ p += len + 1; ids_size -= len + 1;
} while (e = HASH_NEXT(ht, e));
}
if (p != ep_ids) {
@@ -614,6 +613,7 @@ static void entrycache_clear_int(struct cache *cache)
"entrycache_clear_int: there are still %ld entries "
"in the entry cache.\n", cache->c_curentries);
#ifdef LDAP_CACHE_DEBUG
+ LDAPDebug0Args(LDAP_DEBUG_ANY, "ID(s) in entry cache:\n");
dump_hash(cache->c_idtable);
#endif
}
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c b/ldap/servers/slapd/back-ldbm/ldbm_search.c
index 5565578..88af80f 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_search.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c
@@ -106,9 +106,24 @@ berval_done(struct berval *val)
/*
* We call this function as we exit ldbm_back_search
*/
-int ldbm_back_search_cleanup(Slapi_PBlock *pb, struct ldbminfo *li, sort_spec_thing *sort_control, int ldap_result, char* ldap_result_description, int function_result, Slapi_DN *sdn, struct vlv_request *vlv_request_control)
+static int
+ldbm_back_search_cleanup(Slapi_PBlock *pb,
+ struct ldbminfo *li,
+ sort_spec_thing *sort_control,
+ int ldap_result,
+ char* ldap_result_description,
+ int function_result,
+ Slapi_DN *sdn,
+ struct vlv_request *vlv_request_control,
+ struct backentry *e)
{
int estimate = 0; /* estimated search result count */
+ backend *be;
+ ldbm_instance *inst;
+
+ slapi_pblock_get( pb, SLAPI_BACKEND, &be );
+ inst = (ldbm_instance *) be->be_instance_info;
+ CACHE_RETURN(&inst->inst_cache, &e); /* NULL e is handled correctly */
if(sort_control!=NULL)
{
@@ -220,7 +235,10 @@ ldbm_back_search( Slapi_PBlock *pb )
if(r!=0)
{
/* Badly formed SORT control */
- return ldbm_back_search_cleanup(pb, li, sort_control, LDAP_PROTOCOL_ERROR, "Sort Control", SLAPI_FAIL_GENERAL, &basesdn, NULL);
+ return ldbm_back_search_cleanup(pb, li, sort_control,
+ LDAP_PROTOCOL_ERROR, "Sort Control",
+ SLAPI_FAIL_GENERAL, &basesdn,
+ NULL, NULL);
}
/* set this operation includes the server side sorting */
operation->o_flags |= OP_FLAG_SERVER_SIDE_SORTING;
@@ -236,7 +254,10 @@ ldbm_back_search( Slapi_PBlock *pb )
if(r!=LDAP_SUCCESS)
{
/* Badly formed VLV control */
- return ldbm_back_search_cleanup(pb, li, sort_control, r, "VLV Control", SLAPI_FAIL_GENERAL, &basesdn, &vlv_request_control);
+ return ldbm_back_search_cleanup(pb, li, sort_control,
+ r, "VLV Control",
+ SLAPI_FAIL_GENERAL, &basesdn,
+ &vlv_request_control, NULL);
}
{
/* Access Control Check to see if the client is allowed to use the VLV Control. */
@@ -255,7 +276,10 @@ ldbm_back_search( Slapi_PBlock *pb )
if(r!=LDAP_SUCCESS)
{
/* Client isn't allowed to do this. */
- return ldbm_back_search_cleanup(pb, li, sort_control, r, "VLV Control", SLAPI_FAIL_GENERAL, &basesdn, &vlv_request_control);
+ return ldbm_back_search_cleanup(pb, li, sort_control,
+ r, "VLV Control",
+ SLAPI_FAIL_GENERAL, &basesdn,
+ &vlv_request_control, NULL);
}
}
/*
@@ -267,7 +291,10 @@ ldbm_back_search( Slapi_PBlock *pb )
else
{
/* Can't have a VLV control without a SORT control */
- return ldbm_back_search_cleanup(pb, li, sort_control, LDAP_SORT_CONTROL_MISSING, "VLV Control", SLAPI_FAIL_GENERAL, &basesdn, &vlv_request_control);
+ return ldbm_back_search_cleanup(pb, li, sort_control,
+ LDAP_SORT_CONTROL_MISSING, "VLV Control",
+ SLAPI_FAIL_GENERAL, &basesdn,
+ &vlv_request_control, NULL);
}
}
}
@@ -320,13 +347,15 @@ ldbm_back_search( Slapi_PBlock *pb )
{
return ldbm_back_search_cleanup(pb, li, sort_control,
LDAP_UNWILLING_TO_PERFORM, ctrlstr,
- SLAPI_FAIL_GENERAL, &basesdn, &vlv_request_control);
+ SLAPI_FAIL_GENERAL, &basesdn,
+ &vlv_request_control, NULL);
}
else
{
return ldbm_back_search_cleanup(pb, li, sort_control,
LDAP_VIRTUAL_LIST_VIEW_ERROR, ctrlstr,
- SLAPI_FAIL_GENERAL, &basesdn, &vlv_request_control);
+ SLAPI_FAIL_GENERAL, &basesdn,
+ &vlv_request_control, NULL);
}
}
else
@@ -341,7 +370,8 @@ ldbm_back_search( Slapi_PBlock *pb )
sort_make_sort_response_control(pb, LDAP_UNWILLING_TO_PERFORM, NULL);
return ldbm_back_search_cleanup(pb, li, sort_control,
LDAP_UNAVAILABLE_CRITICAL_EXTENSION, ctrlstr,
- SLAPI_FAIL_GENERAL, &basesdn, &vlv_request_control);
+ SLAPI_FAIL_GENERAL, &basesdn,
+ &vlv_request_control, NULL);
}
else /* vlv and sorting are not critical, so ignore the control */
{
@@ -374,7 +404,8 @@ ldbm_back_search( Slapi_PBlock *pb )
if ( ( e = find_entry( pb, be, addr, NULL )) == NULL )
{
/* error or referral sent by find_entry */
- return ldbm_back_search_cleanup(pb, li, sort_control, -1, NULL, 1, &basesdn, &vlv_request_control);
+ return ldbm_back_search_cleanup(pb, li, sort_control,
+ -1, NULL, 1, &basesdn, &vlv_request_control, NULL);
}
}
@@ -407,12 +438,13 @@ ldbm_back_search( Slapi_PBlock *pb )
return ldbm_back_search_cleanup(pb, li, sort_control,
vlv_rc, "VLV Control",
SLAPI_FAIL_GENERAL, &basesdn,
- &vlv_request_control);
+ &vlv_request_control, e);
case VLV_BLD_LIST_FAILED:
return ldbm_back_search_cleanup(pb, li, sort_control,
vlv_response_control.result,
NULL, SLAPI_FAIL_GENERAL,
- &basesdn, &vlv_request_control);
+ &basesdn, &vlv_request_control,
+ e);
case LDAP_SUCCESS:
/* Log to the access log the particulars of this sort request */
@@ -434,7 +466,7 @@ ldbm_back_search( Slapi_PBlock *pb )
"Sort Response Control",
SLAPI_FAIL_GENERAL,
&basesdn,
- &vlv_request_control);
+ &vlv_request_control, e);
}
}
}
@@ -447,7 +479,7 @@ ldbm_back_search( Slapi_PBlock *pb )
/* Error result sent by build_candidate_list */
return ldbm_back_search_cleanup(pb, li, sort_control, -1,
NULL, rc, &basesdn,
- &vlv_request_control);
+ &vlv_request_control, e);
}
/*
* If we're sorting then we must check what administrative
@@ -491,7 +523,7 @@ ldbm_back_search( Slapi_PBlock *pb )
{
return ldbm_back_search_cleanup(pb, li, sort_control,
r, NULL, -1, &basesdn,
- &vlv_request_control);
+ &vlv_request_control, e);
}
}
/*
@@ -509,7 +541,7 @@ ldbm_back_search( Slapi_PBlock *pb )
return ldbm_back_search_cleanup(pb, li, sort_control,
LDAP_PROTOCOL_ERROR,
"Sort Response Control", -1,
- &basesdn, &vlv_request_control);
+ &basesdn, &vlv_request_control, e);
}
}
else
@@ -551,7 +583,7 @@ ldbm_back_search( Slapi_PBlock *pb )
LDAP_PROTOCOL_ERROR,
"Sort Control", -1,
&basesdn,
- &vlv_request_control);
+ &vlv_request_control, e);
case LDAP_UNWILLING_TO_PERFORM: /* Too hard */
case LDAP_OPERATIONS_ERROR: /* Operation error */
case LDAP_TIMELIMIT_EXCEEDED: /* Timeout */
@@ -593,7 +625,7 @@ ldbm_back_search( Slapi_PBlock *pb )
return ldbm_back_search_cleanup(pb, li, sort_control,
(abandoned?-1:LDAP_PROTOCOL_ERROR),
"Sort Response Control", -1,
- &basesdn, &vlv_request_control);
+ &basesdn, &vlv_request_control, e);
}
}
}
@@ -619,7 +651,7 @@ ldbm_back_search( Slapi_PBlock *pb )
return ldbm_back_search_cleanup(pb, li, sort_control,
vlv_response_control.result,
NULL, -1, &basesdn,
- &vlv_request_control);
+ &vlv_request_control, e);
}
}
else
@@ -638,7 +670,7 @@ ldbm_back_search( Slapi_PBlock *pb )
return ldbm_back_search_cleanup(pb, li, sort_control,
(abandoned?-1:LDAP_PROTOCOL_ERROR),
"VLV Response Control", -1,
- &basesdn, &vlv_request_control);
+ &basesdn, &vlv_request_control, e);
}
/* Log the VLV operation */
vlv_print_access_log(pb,&vlv_request_control,&vlv_response_control);
@@ -702,7 +734,7 @@ ldbm_back_search( Slapi_PBlock *pb )
/* tmp_err == -1: no error */
return ldbm_back_search_cleanup(pb, li, sort_control, tmp_err, tmp_desc,
(tmp_err == -1 ? 0 : -1), &basesdn,
- &vlv_request_control);
+ &vlv_request_control, NULL);
/* end Fix for bugid #394184 */
}
diff --git a/ldap/servers/slapd/back-ldbm/sort.c b/ldap/servers/slapd/back-ldbm/sort.c
index 7a2a9c9..2c9595d 100644
--- a/ldap/servers/slapd/back-ldbm/sort.c
+++ b/ldap/servers/slapd/back-ldbm/sort.c
@@ -632,6 +632,7 @@ static int compare_entries_sv(ID *id_a, ID *id_b, sort_spec *s,baggage_carrier *
if (0 != err ) {
LDAPDebug(LDAP_DEBUG_TRACE,"compare_entries db err %d\n",err,0,0);
}
+ CACHE_RETURN(&inst->inst_cache,&a);
return 0;
}
/* OK, now we have the entries, so we work our way down the attribute list comparing as we go */
diff --git a/ldap/servers/slapd/back-ldbm/vlv.c b/ldap/servers/slapd/back-ldbm/vlv.c
index c68ce64..ea08fd6 100644
--- a/ldap/servers/slapd/back-ldbm/vlv.c
+++ b/ldap/servers/slapd/back-ldbm/vlv.c
@@ -1634,10 +1634,10 @@ retry:
{
match= sort_attr_compare((struct berval**)typedown_value, entry_value, compare_fn);
}
- if (needFree) {
- ber_bvecfree((struct berval**)entry_value);
- entry_value = NULL;
- }
+ if (needFree) {
+ ber_bvecfree((struct berval**)entry_value);
+ entry_value = NULL;
+ }
}
else
{
@@ -1690,6 +1690,8 @@ retry:
LDAPDebug( LDAP_DEBUG_TRACE, "<= vlv_trim_candidates_byvalue: Found. Index %lu\n",si, 0, 0 );
}
}
+ CACHE_RETURN(&(((ldbm_instance *)be->be_instance_info)->inst_cache),
+ &e);
}
} while (!found);
ber_bvecfree((struct berval**)typedown_value);
commit 00a13794271527c7c474cd4d61f8ace5e7e7da32
Author: Noriko Hosoi <nhosoi(a)jiji.usersys.redhat.com>
Date: Mon Feb 14 15:06:57 2011 -0800
Bug 676053 - export task followed by import task causes cache assertion
https://bugzilla.redhat.com/show_bug.cgi?id=676053
Description: When Simple Paged Results is requested and a page is
returned, one entry is read ahead to check whether more entries
exist or not. The read-ahead retrieves an entry (if any) and adds
it into the entry cache. Simple Paged Results code puts the read-
ahead entry back, but there was missing to call cache_return for
the entry (that decrementing refcnt). If ldif2db.pl is called with
the cache state, it finds out the entry which is still referred.
This patch calls cache_return when the Simple Paged Results puts
the read-ahead entry back. Plus, adding a debug function dump_hash.
diff --git a/ldap/servers/slapd/back-ldbm/cache.c b/ldap/servers/slapd/back-ldbm/cache.c
index 721a838..8e39c51 100644
--- a/ldap/servers/slapd/back-ldbm/cache.c
+++ b/ldap/servers/slapd/back-ldbm/cache.c
@@ -275,6 +275,42 @@ int remove_hash(Hashtable *ht, const void *key, size_t keylen)
return 0;
}
+#ifdef LDAP_CACHE_DEBUG
+void
+dump_hash(Hashtable *ht)
+{
+ u_long i;
+ void *e;
+ char ep_id[16];
+ char ep_ids[80];
+ char *p;
+ int ids_size = 80;
+
+ LDAPDebug0Args(LDAP_DEBUG_ANY, "entry cache:\n");
+ p = ep_ids;
+ for (i = 0; i < ht->size; i++) {
+ int len;
+ e = ht->slot[i];
+ if (NULL == e) {
+ continue;
+ }
+ do {
+ PR_snprintf(ep_id, 16, "%u", ((struct backcommon *)e)->ep_id);
+ len = strlen(ep_id);
+ if (ids_size < len + 1) {
+ LDAPDebug1Arg(LDAP_DEBUG_ANY, "%s\n", ep_ids);
+ p = ep_ids; ids_size = 80;
+ }
+ PR_snprintf(p, ids_size, "%s", ep_id);
+ p += len; ids_size -= len + 1;
+ } while (e = HASH_NEXT(ht, e));
+ }
+ if (p != ep_ids) {
+ LDAPDebug1Arg(LDAP_DEBUG_ANY, "%s\n", ep_ids);
+ }
+}
+#endif
+
/* hashtable distribution stats --
* slots: # of slots in the hashtable
* total_entries: # of entries in the hashtable
@@ -574,9 +610,12 @@ static void entrycache_clear_int(struct cache *cache)
}
cache->c_maxsize = size;
if (cache->c_curentries > 0) {
- LDAPDebug1Arg(LDAP_DEBUG_ANY,
+ LDAPDebug1Arg(LDAP_DEBUG_ANY,
"entrycache_clear_int: there are still %ld entries "
- "in the entry cache. :/\n", cache->c_curentries);
+ "in the entry cache.\n", cache->c_curentries);
+#ifdef LDAP_CACHE_DEBUG
+ dump_hash(cache->c_idtable);
+#endif
}
}
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c b/ldap/servers/slapd/back-ldbm/ldbm_search.c
index 568d32c..5565578 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_search.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c
@@ -1458,9 +1458,32 @@ bail:
void
ldbm_back_prev_search_results( Slapi_PBlock *pb )
{
+ backend *be;
+ ldbm_instance *inst;
back_search_result_set *sr;
+
+ slapi_pblock_get( pb, SLAPI_BACKEND, &be );
+ if (!be) {
+ LDAPDebug0Args(LDAP_DEBUG_ANY,
+ "ldbm_back_prev_search_results: no backend\n");
+ return;
+ }
+ inst = (ldbm_instance *) be->be_instance_info;
+ if (!inst) {
+ LDAPDebug0Args(LDAP_DEBUG_ANY,
+ "ldbm_back_prev_search_results: no backend instance\n");
+ return;
+ }
slapi_pblock_get( pb, SLAPI_SEARCH_RESULT_SET, &sr );
if (sr) {
+ if (sr->sr_entry) {
+ /* The last entry should be returned to cache */
+ LDAPDebug1Arg(LDAP_DEBUG_BACKLDBM,
+ "ldbm_back_prev_search_results: returning: %s\n",
+ slapi_entry_get_dn_const(sr->sr_entry->ep_entry));
+ CACHE_RETURN (&inst->inst_cache, &(sr->sr_entry));
+ sr->sr_entry = NULL;
+ }
idl_iterator_decrement(&(sr->sr_current));
}
return;
commit f68c9e5ad8f8bff536a30e4fcdf089fd9d3c412e
Author: Noriko Hosoi <nhosoi(a)jiji.usersys.redhat.com>
Date: Thu Feb 10 16:29:23 2011 -0800
Bug 676053 - export task followed by import task causes cache assertion
https://bugzilla.redhat.com/show_bug.cgi?id=676053
Description: Task version of export had a bug in handling the busy
instance error case. When returning due to the busy error, the
function ldbm_back_ldbm2ldif reset the busy bit set by other threads.
This patch checks the special return value set in the busy error
case and resets the busy bit only when it is set by the function.
Also, this patch fixes a bug in dse_add which replaces an adding
entry with its copy in pblock and the original entry is consumed.
But the caller frees the original entry. Applying this patch,
instead of consuming the original entry, its copy is consumed and
the original adding entry stays in the pblock.
diff --git a/ldap/servers/slapd/back-ldbm/id2entry.c b/ldap/servers/slapd/back-ldbm/id2entry.c
index c509d3a..432f80a 100644
--- a/ldap/servers/slapd/back-ldbm/id2entry.c
+++ b/ldap/servers/slapd/back-ldbm/id2entry.c
@@ -305,7 +305,8 @@ id2entry( backend *be, ID id, back_txn *txn, int *err )
goto bail;
}
- if ( (*err = dblayer_get_id2entry( be, &db )) != 0 ) {
+ *err = dblayer_get_id2entry( be, &db );
+ if ( (*err != 0) || (NULL == db) ) {
slapi_log_error(SLAPI_LOG_FATAL, ID2ENTRY,
"Could not open id2entry err %d\n", *err);
return( NULL );
diff --git a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
index a89f5e9..ccad8e6 100644
--- a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
+++ b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
@@ -1024,6 +1024,7 @@ bail:
* ldif file.
* (reunified at last)
*/
+#define LDBM2LDIF_BUSY (-2)
int
ldbm_back_ldbm2ldif( Slapi_PBlock *pb )
{
@@ -1147,7 +1148,7 @@ ldbm_back_ldbm2ldif( Slapi_PBlock *pb )
LDAPDebug(LDAP_DEBUG_ANY, "ldbm: '%s' is already in the middle"
" of another task and cannot be disturbed.\n",
inst->inst_name, 0, 0);
- return_value = -1;
+ return_value = LDBM2LDIF_BUSY;
goto bye;
}
}
@@ -1585,17 +1586,12 @@ bye:
}
}
- if (!run_from_cmdline && NULL != inst) {
+ if (!run_from_cmdline && inst && (LDBM2LDIF_BUSY != return_value)) {
instance_set_not_busy(inst);
}
ldbm_back_free_incl_excl(include_suffix, exclude_suffix);
idl_free(eargs.pre_exported_idl);
- if (inst != NULL) {
- PR_Lock(inst->inst_config_mutex);
- inst->inst_flags &= ~INST_FLAG_BUSY;
- PR_Unlock(inst->inst_config_mutex);
- }
return( return_value );
}
diff --git a/ldap/servers/slapd/dse.c b/ldap/servers/slapd/dse.c
index c270892..d5d3e23 100644
--- a/ldap/servers/slapd/dse.c
+++ b/ldap/servers/slapd/dse.c
@@ -2066,25 +2066,21 @@ dse_add(Slapi_PBlock *pb) /* JCM There should only be one exit point from this f
return dse_add_return(error, NULL);
}
- /* make copy for postop fns because add_entry_pb consumes e */
+ /* make copy for postop fns because add_entry_pb consumes the given entry */
e_copy = slapi_entry_dup(e);
- if ( dse_add_entry_pb(pdse, e, pb) != 0)
+ if ( dse_add_entry_pb(pdse, e_copy, pb) != 0)
{
slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL );
slapi_sdn_done(&sdn);
return dse_add_return(error, e_copy);
}
-
- /* e has been consumed, so use the copy for the post ops */
- slapi_pblock_set(pb, SLAPI_ADD_ENTRY, e_copy);
-
/* The postop must be called after the write lock is released. */
- dse_call_callback(pdse, pb, SLAPI_OPERATION_ADD, DSE_FLAG_POSTOP, e_copy, NULL, &returncode, returntext);
+ dse_call_callback(pdse, pb, SLAPI_OPERATION_ADD, DSE_FLAG_POSTOP, e, NULL, &returncode, returntext);
/* We have been successful. Tell the user */
slapi_send_ldap_result( pb, returncode, NULL, NULL, 0, NULL );
- slapi_pblock_set( pb, SLAPI_ENTRY_POST_OP, slapi_entry_dup( e_copy ));
+ slapi_pblock_set( pb, SLAPI_ENTRY_POST_OP, slapi_entry_dup( e ));
/* entry has been freed, so make sure no one tries to use it later */
slapi_pblock_set(pb, SLAPI_ADD_ENTRY, NULL);
@@ -2092,7 +2088,7 @@ dse_add(Slapi_PBlock *pb) /* JCM There should only be one exit point from this f
/* Free the dn, and return */
slapi_sdn_done(&sdn);
- return dse_add_return(rc, e_copy);
+ return dse_add_return(rc, e);
}
/*
13 years, 1 month
Branch '389-ds-base-1.2.8' - ldap/servers
by Richard Allen Megginson
ldap/servers/plugins/acl/aclparse.c | 2 +-
ldap/servers/plugins/chainingdb/cb_bind.c | 5 +++--
ldap/servers/plugins/chainingdb/cb_conn_stateless.c | 1 -
ldap/servers/plugins/mep/mep.c | 1 -
ldap/servers/plugins/replication/cl5_api.c | 2 +-
ldap/servers/plugins/replication/repl5_replica.c | 1 -
ldap/servers/slapd/attrsyntax.c | 2 +-
ldap/servers/slapd/back-ldbm/dblayer.c | 4 ++--
ldap/servers/slapd/back-ldbm/import-threads.c | 16 ++++++++--------
ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c | 4 ++--
ldap/servers/slapd/connection.c | 6 +++---
ldap/servers/slapd/libglobs.c | 2 +-
ldap/servers/slapd/result.c | 12 ++++++------
ldap/servers/slapd/slapi-plugin.h | 10 ++++++++++
ldap/servers/slapd/slapi-private.h | 7 +++++++
15 files changed, 45 insertions(+), 30 deletions(-)
New commits:
commit b339ee0e211b31abe038bb25e8abbf2314161f0f
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Feb 8 11:28:31 2011 -0700
Bug 677440 - clean up compiler warnings in 389-ds-base 1.2.8
https://bugzilla.redhat.com/show_bug.cgi?id=677440
Resolves: bug 677440
Description: clean up compiler warnings in 389-ds-base 1.2.8
* added is_slapd_running to shared header file
* added parentheses around assignment used as truth value
* added printf format string for ber_tag_t and ber_len_t
* fixed type usage in config_get_anon_access_switch
* fixed variable declaration in acl_check_for_target_macro
* use %lu for size_t in scanf and printf
* fixed usage of matcheddnp in cb_sasl_bind_once_s
Branch: 389-ds-base-1.2.8
Reviewed by: nkinder (Thanks!)
(cherry picked from commit 79a3fae13fd3ae772b2a37343ef78a1d1e0cb24d)
diff --git a/ldap/servers/plugins/acl/aclparse.c b/ldap/servers/plugins/acl/aclparse.c
index 04a1df6..014df1b 100644
--- a/ldap/servers/plugins/acl/aclparse.c
+++ b/ldap/servers/plugins/acl/aclparse.c
@@ -1641,7 +1641,7 @@ acl_check_for_target_macro( aci_t *aci_item, char *value)
str = strstr(value, ACL_TARGET_MACRO_DN_KEY /* ($dn) */);
if (str != NULL) {
- char *p0 = NULL, p1 = NULL;
+ char *p0 = NULL, *p1 = NULL;
/* Syntax check:
* error return if ($dn) is in '[' and ']', e.g., "[($dn)]" */
p0 = strchr(value, '[');
diff --git a/ldap/servers/plugins/chainingdb/cb_bind.c b/ldap/servers/plugins/chainingdb/cb_bind.c
index 027791f..a6b92f9 100644
--- a/ldap/servers/plugins/chainingdb/cb_bind.c
+++ b/ldap/servers/plugins/chainingdb/cb_bind.c
@@ -181,10 +181,11 @@ cb_sasl_bind_once_s( cb_conn_pool *pool, char *dn, int method, char * mechanism,
if ( LDAP_SUCCESS != rc ) {
static int warned_bind_once = 0;
if (!warned_bind_once) {
+ int hasmatched = (matcheddnp && *matcheddnp && (**matcheddnp != '\0'));
slapi_log_error(SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM,
"cb_sasl_bind_once_s failed (%s%s%s)\n",
- matcheddnp?matcheddnp:"",
- (matcheddnp&&(*matcheddnp!='\0'))?": ":"",
+ hasmatched ? *matcheddnp : "",
+ hasmatched ? ": " : "",
ldap_err2string(rc));
warned_bind_once = 1;
}
diff --git a/ldap/servers/plugins/chainingdb/cb_conn_stateless.c b/ldap/servers/plugins/chainingdb/cb_conn_stateless.c
index d84d657..02130cb 100644
--- a/ldap/servers/plugins/chainingdb/cb_conn_stateless.c
+++ b/ldap/servers/plugins/chainingdb/cb_conn_stateless.c
@@ -171,7 +171,6 @@ cb_get_connection(cb_conn_pool * pool,
int secure;
char *mech = NULL;;
static char *error1="Can't contact remote server : %s";
- static char *error2="Can't bind to remote server : %s";
int isMultiThread = ENABLE_MULTITHREAD_PER_CONN ; /* by default, we enable multiple operations per connection */
/*
diff --git a/ldap/servers/plugins/mep/mep.c b/ldap/servers/plugins/mep/mep.c
index 211a4cf..5ecc815 100644
--- a/ldap/servers/plugins/mep/mep.c
+++ b/ldap/servers/plugins/mep/mep.c
@@ -2371,7 +2371,6 @@ mep_modrdn_post_op(Slapi_PBlock *pb)
slapi_mods_free(&smods);
}
- bail:
slapi_sdn_free(&managed_sdn);
slapi_entry_free(new_managed_entry);
}
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 8b1599e..b3078b0 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -1970,7 +1970,7 @@ static int _cl5AppInit (PRBool *didRecovery)
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
"_cl5AppInit: failed to fetch backend dbenv (%p) and/or "
- "index page size (%u)\n", dbEnv, pagesize);
+ "index page size (%lu)\n", dbEnv, pagesize);
return CL5_DB_ERROR;
}
}
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
index bd02dfe..71923d7 100644
--- a/ldap/servers/plugins/replication/repl5_replica.c
+++ b/ldap/servers/plugins/replication/repl5_replica.c
@@ -2390,7 +2390,6 @@ replica_write_ruv (Replica *r)
int
replica_ruv_smods_for_op( Slapi_PBlock *pb, char **uniqueid, Slapi_Mods **smods )
{
- int rc = 0;
Object *replica_obj;
Object *ruv_obj;
Replica *replica;
diff --git a/ldap/servers/slapd/attrsyntax.c b/ldap/servers/slapd/attrsyntax.c
index 1c77f4a..6288a6f 100644
--- a/ldap/servers/slapd/attrsyntax.c
+++ b/ldap/servers/slapd/attrsyntax.c
@@ -826,7 +826,7 @@ slapi_attr_is_dn_syntax_attr(Slapi_Attr *attr)
int dn_syntax = 0; /* not DN, by default */
if (attr && attr->a_plugin) { /* If not set, there is no way to get the info */
- if (syntaxoid = attr_get_syntax_oid(attr)) {
+ if ((syntaxoid = attr_get_syntax_oid(attr))) {
dn_syntax = ((0 == strcmp(syntaxoid, NAMEANDOPTIONALUID_SYNTAX_OID))
|| (0 == strcmp(syntaxoid, DN_SYNTAX_OID)));
}
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index 39a214c..534abfe 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -924,7 +924,7 @@ void dblayer_sys_pages(size_t *pagesize, size_t *pages, size_t *procpages, size_
if (feof(f))
break;
if (strncmp(s, "VmSize:", 7) == 0) {
- sscanf(s+7, "%u", procpages);
+ sscanf(s+7, "%lu", procpages);
break;
}
}
@@ -4213,7 +4213,7 @@ static int commit_good_database(dblayer_private *priv)
filename, PR_GetError(), slapd_pr_strerror(PR_GetError()) );
return -1;
}
- PR_snprintf(line,sizeof(line),"cachesize:%u\nncache:%d\nversion:%d\n",
+ PR_snprintf(line,sizeof(line),"cachesize:%lu\nncache:%d\nversion:%d\n",
priv->dblayer_cachesize, priv->dblayer_ncache, DB_VERSION_MAJOR);
num_bytes = strlen(line);
return_value = slapi_write_buffer(prfd, line, num_bytes);
diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c
index 5df4b1e..d743baa 100644
--- a/ldap/servers/slapd/back-ldbm/import-threads.c
+++ b/ldap/servers/slapd/back-ldbm/import-threads.c
@@ -722,8 +722,8 @@ import_producer(void *param)
"ending line %d of file \"%s\"",
escape_string(slapi_entry_get_dn(e), ebuf),
curr_lineno, curr_filename);
- import_log_notice(job, "REASON: entry too large (%u bytes) for "
- "the buffer size (%u bytes)", newesize, job->fifo.bsize);
+ import_log_notice(job, "REASON: entry too large (%lu bytes) for "
+ "the buffer size (%lu bytes)", newesize, job->fifo.bsize);
backentry_free(&ep);
job->skipped++;
continue;
@@ -853,8 +853,8 @@ index_set_entry_to_fifo(ImportWorkerInfo *info, Slapi_Entry *e,
char ebuf[BUFSIZ];
import_log_notice(job, "WARNING: skipping entry \"%s\"",
escape_string(slapi_entry_get_dn(e), ebuf));
- import_log_notice(job, "REASON: entry too large (%u bytes) for "
- "the buffer size (%u bytes)", newesize, job->fifo.bsize);
+ import_log_notice(job, "REASON: entry too large (%lu bytes) for "
+ "the buffer size (%lu bytes)", newesize, job->fifo.bsize);
backentry_free(&ep);
job->skipped++;
rc = 0; /* go to the next loop */
@@ -1728,8 +1728,8 @@ upgradedn_producer(void *param)
char ebuf[BUFSIZ];
import_log_notice(job, "WARNING: skipping entry \"%s\"",
escape_string(slapi_entry_get_dn(e), ebuf));
- import_log_notice(job, "REASON: entry too large (%u bytes) for "
- "the buffer size (%u bytes)", newesize, job->fifo.bsize);
+ import_log_notice(job, "REASON: entry too large (%lu bytes) for "
+ "the buffer size (%lu bytes)", newesize, job->fifo.bsize);
backentry_free(&ep);
job->skipped++;
continue;
@@ -2871,8 +2871,8 @@ static int bulk_import_queue(ImportJob *job, Slapi_Entry *entry)
char ebuf[BUFSIZ];
import_log_notice(job, "WARNING: skipping entry \"%s\"",
escape_string(slapi_entry_get_dn(ep->ep_entry), ebuf));
- import_log_notice(job, "REASON: entry too large (%u bytes) for "
- "the import buffer size (%u bytes). Try increasing nsslapd-cachememsize.", newesize, job->fifo.bsize);
+ import_log_notice(job, "REASON: entry too large (%lu bytes) for "
+ "the import buffer size (%lu bytes). Try increasing nsslapd-cachememsize.", newesize, job->fifo.bsize);
backentry_clear_entry(ep); /* entry is released in the frontend on failure*/
backentry_free( &ep ); /* release the backend wrapper, here */
PR_Unlock(job->wire_lock);
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c
index 2b94107..9f22a58 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c
@@ -1509,11 +1509,11 @@ _back_crypt_crypto_op(attrcrypt_private *priv,
}
if (encrypt) {
slapi_log_error(SLAPI_LOG_BACKLDBM, ATTRCRYPT,
- "_back_crypt_crypto_op encrypt '%s' (%d)\n",
+ "_back_crypt_crypto_op encrypt '%s' (%lu)\n",
in_data, in_size);
} else {
slapi_log_error(SLAPI_LOG_BACKLDBM, ATTRCRYPT,
- "_back_crypt_crypto_op decrypt (%d)\n", in_size);
+ "_back_crypt_crypto_op decrypt (%lu)\n", in_size);
}
/* Allocate the output buffer */
output_buffer_length = in_size + BACK_CRYPT_OUTBUFF_EXTLEN;
diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c
index 7f93a0f..9be1138 100644
--- a/ldap/servers/slapd/connection.c
+++ b/ldap/servers/slapd/connection.c
@@ -2691,13 +2691,13 @@ log_ber_too_big_error(const Connection *conn, ber_len_t ber_len,
if (0 == ber_len) {
slapi_log_error( SLAPI_LOG_FATAL, "connection",
"conn=%" NSPRIu64 " fd=%d Incoming BER Element was too long, max allowable"
- " is %u bytes. Change the nsslapd-maxbersize attribute in"
+ " is %" BERLEN_T " bytes. Change the nsslapd-maxbersize attribute in"
" cn=config to increase.\n",
conn->c_connid, conn->c_sd, maxbersize );
} else {
slapi_log_error( SLAPI_LOG_FATAL, "connection",
- "conn=%" NSPRIu64 " fd=%d Incoming BER Element was %u bytes, max allowable"
- " is %u bytes. Change the nsslapd-maxbersize attribute in"
+ "conn=%" NSPRIu64 " fd=%d Incoming BER Element was %" BERLEN_T " bytes, max allowable"
+ " is %" BERLEN_T " bytes. Change the nsslapd-maxbersize attribute in"
" cn=config to increase.\n",
conn->c_connid, conn->c_sd, ber_len, maxbersize );
}
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index c3047bf..694880e 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -4617,7 +4617,7 @@ config_get_require_secure_binds(void)
int
config_get_anon_access_switch(void)
{
- char *retVal = NULL;
+ int retVal = 0;
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
CFG_LOCK_READ(slapdFrontendConfig);
retVal = slapdFrontendConfig->allow_anon_access;
diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c
index 16d964c..fe150e7 100644
--- a/ldap/servers/slapd/result.c
+++ b/ldap/servers/slapd/result.c
@@ -1690,7 +1690,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag,
{
slapi_log_access( LDAP_DEBUG_STATS,
"conn=%" NSPRIu64 " op=%d RESULT err=%d"
- " tag=%u nentries=%d etime=%s%s%s"
+ " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
", SASL bind in progress\n",
op->o_connid,
op->o_opid,
@@ -1702,7 +1702,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag,
{
slapi_log_access( LDAP_DEBUG_ARGS,
"conn=%s op=%d RESULT err=%d"
- " tag=%u nentries=%d etime=%s%s%s"
+ " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
", SASL bind in progress\n",
LOG_INTERNAL_OP_CON_ID,
LOG_INTERNAL_OP_OP_ID,
@@ -1722,7 +1722,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag,
{
slapi_log_access( LDAP_DEBUG_STATS,
"conn=%" NSPRIu64 " op=%d RESULT err=%d"
- " tag=%u nentries=%d etime=%s%s%s"
+ " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
" dn=\"%s\"\n",
op->o_connid,
op->o_opid,
@@ -1734,7 +1734,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag,
{
slapi_log_access( LDAP_DEBUG_ARGS,
"conn=%s op=%d RESULT err=%d"
- " tag=%u nentries=%d etime=%s%s%s"
+ " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
" dn=\"%s\"\n",
LOG_INTERNAL_OP_CON_ID,
LOG_INTERNAL_OP_OP_ID,
@@ -1748,7 +1748,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag,
{
slapi_log_access( LDAP_DEBUG_STATS,
"conn=%" NSPRIu64 " op=%d RESULT err=%d"
- " tag=%u nentries=%d etime=%s%s%s\n",
+ " tag=%" BERTAG_T " nentries=%d etime=%s%s%s\n",
op->o_connid,
op->o_opid,
err, tag, nentries,
@@ -1759,7 +1759,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag,
{
slapi_log_access( LDAP_DEBUG_ARGS,
"conn=%s op=%d RESULT err=%d"
- " tag=%u nentries=%d etime=%s%s%s\n",
+ " tag=%" BERTAG_T " nentries=%d etime=%s%s%s\n",
LOG_INTERNAL_OP_CON_ID,
LOG_INTERNAL_OP_OP_ID,
err, tag, nentries,
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index dd601ca..4fc25b8 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -96,6 +96,16 @@ NSPR_API(PRUint32) PR_fprintf(struct PRFileDesc* fd, const char *fmt, ...)
#define NSPRIu64 "llu"
#define NSPRI64 "ll"
+/* OpenLDAP uses unsigned long for ber_tag_t and ber_len_t but mozldap uses unsigned int */
+/* use this macro for printf statements for ber_tag_t and ber_len_t */
+#if defined(USE_OPENLDAP)
+#define BERTAG_T "lu"
+#define BERLEN_T "lu"
+#else
+#define BERTAG_T "u"
+#define BERLEN_T "u"
+#endif
+
/*
* The slapi_attr_get_flags() routine returns a bitmap that contains one or
* more of these values.
diff --git a/ldap/servers/slapd/slapi-private.h b/ldap/servers/slapd/slapi-private.h
index 3bc0c74..34183a8 100644
--- a/ldap/servers/slapd/slapi-private.h
+++ b/ldap/servers/slapd/slapi-private.h
@@ -1228,6 +1228,13 @@ void DS_Sleep(PRIntervalTime ticks);
/* plugin.c */
int plugin_enabled(const char *plugin_name, void *identity);
+/* protect_db.c */
+/* is_slapd_running()
+ * returns 1 if slapd is running, 0 if not, -1 on error
+ */
+int is_slapd_running();
+
+
#ifdef __cplusplus
}
#endif
13 years, 1 month
ldap/servers
by Richard Allen Megginson
ldap/servers/plugins/acl/aclparse.c | 2 +-
ldap/servers/plugins/chainingdb/cb_bind.c | 5 +++--
ldap/servers/plugins/chainingdb/cb_conn_stateless.c | 1 -
ldap/servers/plugins/mep/mep.c | 1 -
ldap/servers/plugins/replication/cl5_api.c | 2 +-
ldap/servers/plugins/replication/repl5_replica.c | 1 -
ldap/servers/slapd/attrsyntax.c | 2 +-
ldap/servers/slapd/back-ldbm/dblayer.c | 4 ++--
ldap/servers/slapd/back-ldbm/import-threads.c | 16 ++++++++--------
ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c | 4 ++--
ldap/servers/slapd/connection.c | 6 +++---
ldap/servers/slapd/libglobs.c | 2 +-
ldap/servers/slapd/result.c | 12 ++++++------
ldap/servers/slapd/slapi-plugin.h | 10 ++++++++++
ldap/servers/slapd/slapi-private.h | 7 +++++++
15 files changed, 45 insertions(+), 30 deletions(-)
New commits:
commit 79a3fae13fd3ae772b2a37343ef78a1d1e0cb24d
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Feb 8 11:28:31 2011 -0700
Bug 677440 - clean up compiler warnings in 389-ds-base 1.2.8
https://bugzilla.redhat.com/show_bug.cgi?id=677440
Resolves: bug 677440
Description: clean up compiler warnings in 389-ds-base 1.2.8
* added is_slapd_running to shared header file
* added parentheses around assignment used as truth value
* added printf format string for ber_tag_t and ber_len_t
* fixed type usage in config_get_anon_access_switch
* fixed variable declaration in acl_check_for_target_macro
* use %lu for size_t in scanf and printf
* fixed usage of matcheddnp in cb_sasl_bind_once_s
Reviewed by: nkinder (Thanks!)
diff --git a/ldap/servers/plugins/acl/aclparse.c b/ldap/servers/plugins/acl/aclparse.c
index 04a1df6..014df1b 100644
--- a/ldap/servers/plugins/acl/aclparse.c
+++ b/ldap/servers/plugins/acl/aclparse.c
@@ -1641,7 +1641,7 @@ acl_check_for_target_macro( aci_t *aci_item, char *value)
str = strstr(value, ACL_TARGET_MACRO_DN_KEY /* ($dn) */);
if (str != NULL) {
- char *p0 = NULL, p1 = NULL;
+ char *p0 = NULL, *p1 = NULL;
/* Syntax check:
* error return if ($dn) is in '[' and ']', e.g., "[($dn)]" */
p0 = strchr(value, '[');
diff --git a/ldap/servers/plugins/chainingdb/cb_bind.c b/ldap/servers/plugins/chainingdb/cb_bind.c
index 027791f..a6b92f9 100644
--- a/ldap/servers/plugins/chainingdb/cb_bind.c
+++ b/ldap/servers/plugins/chainingdb/cb_bind.c
@@ -181,10 +181,11 @@ cb_sasl_bind_once_s( cb_conn_pool *pool, char *dn, int method, char * mechanism,
if ( LDAP_SUCCESS != rc ) {
static int warned_bind_once = 0;
if (!warned_bind_once) {
+ int hasmatched = (matcheddnp && *matcheddnp && (**matcheddnp != '\0'));
slapi_log_error(SLAPI_LOG_FATAL, CB_PLUGIN_SUBSYSTEM,
"cb_sasl_bind_once_s failed (%s%s%s)\n",
- matcheddnp?matcheddnp:"",
- (matcheddnp&&(*matcheddnp!='\0'))?": ":"",
+ hasmatched ? *matcheddnp : "",
+ hasmatched ? ": " : "",
ldap_err2string(rc));
warned_bind_once = 1;
}
diff --git a/ldap/servers/plugins/chainingdb/cb_conn_stateless.c b/ldap/servers/plugins/chainingdb/cb_conn_stateless.c
index d84d657..02130cb 100644
--- a/ldap/servers/plugins/chainingdb/cb_conn_stateless.c
+++ b/ldap/servers/plugins/chainingdb/cb_conn_stateless.c
@@ -171,7 +171,6 @@ cb_get_connection(cb_conn_pool * pool,
int secure;
char *mech = NULL;;
static char *error1="Can't contact remote server : %s";
- static char *error2="Can't bind to remote server : %s";
int isMultiThread = ENABLE_MULTITHREAD_PER_CONN ; /* by default, we enable multiple operations per connection */
/*
diff --git a/ldap/servers/plugins/mep/mep.c b/ldap/servers/plugins/mep/mep.c
index 211a4cf..5ecc815 100644
--- a/ldap/servers/plugins/mep/mep.c
+++ b/ldap/servers/plugins/mep/mep.c
@@ -2371,7 +2371,6 @@ mep_modrdn_post_op(Slapi_PBlock *pb)
slapi_mods_free(&smods);
}
- bail:
slapi_sdn_free(&managed_sdn);
slapi_entry_free(new_managed_entry);
}
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 8b1599e..b3078b0 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -1970,7 +1970,7 @@ static int _cl5AppInit (PRBool *didRecovery)
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
"_cl5AppInit: failed to fetch backend dbenv (%p) and/or "
- "index page size (%u)\n", dbEnv, pagesize);
+ "index page size (%lu)\n", dbEnv, pagesize);
return CL5_DB_ERROR;
}
}
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
index bd02dfe..71923d7 100644
--- a/ldap/servers/plugins/replication/repl5_replica.c
+++ b/ldap/servers/plugins/replication/repl5_replica.c
@@ -2390,7 +2390,6 @@ replica_write_ruv (Replica *r)
int
replica_ruv_smods_for_op( Slapi_PBlock *pb, char **uniqueid, Slapi_Mods **smods )
{
- int rc = 0;
Object *replica_obj;
Object *ruv_obj;
Replica *replica;
diff --git a/ldap/servers/slapd/attrsyntax.c b/ldap/servers/slapd/attrsyntax.c
index 1c77f4a..6288a6f 100644
--- a/ldap/servers/slapd/attrsyntax.c
+++ b/ldap/servers/slapd/attrsyntax.c
@@ -826,7 +826,7 @@ slapi_attr_is_dn_syntax_attr(Slapi_Attr *attr)
int dn_syntax = 0; /* not DN, by default */
if (attr && attr->a_plugin) { /* If not set, there is no way to get the info */
- if (syntaxoid = attr_get_syntax_oid(attr)) {
+ if ((syntaxoid = attr_get_syntax_oid(attr))) {
dn_syntax = ((0 == strcmp(syntaxoid, NAMEANDOPTIONALUID_SYNTAX_OID))
|| (0 == strcmp(syntaxoid, DN_SYNTAX_OID)));
}
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index 39a214c..534abfe 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -924,7 +924,7 @@ void dblayer_sys_pages(size_t *pagesize, size_t *pages, size_t *procpages, size_
if (feof(f))
break;
if (strncmp(s, "VmSize:", 7) == 0) {
- sscanf(s+7, "%u", procpages);
+ sscanf(s+7, "%lu", procpages);
break;
}
}
@@ -4213,7 +4213,7 @@ static int commit_good_database(dblayer_private *priv)
filename, PR_GetError(), slapd_pr_strerror(PR_GetError()) );
return -1;
}
- PR_snprintf(line,sizeof(line),"cachesize:%u\nncache:%d\nversion:%d\n",
+ PR_snprintf(line,sizeof(line),"cachesize:%lu\nncache:%d\nversion:%d\n",
priv->dblayer_cachesize, priv->dblayer_ncache, DB_VERSION_MAJOR);
num_bytes = strlen(line);
return_value = slapi_write_buffer(prfd, line, num_bytes);
diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c
index 5df4b1e..d743baa 100644
--- a/ldap/servers/slapd/back-ldbm/import-threads.c
+++ b/ldap/servers/slapd/back-ldbm/import-threads.c
@@ -722,8 +722,8 @@ import_producer(void *param)
"ending line %d of file \"%s\"",
escape_string(slapi_entry_get_dn(e), ebuf),
curr_lineno, curr_filename);
- import_log_notice(job, "REASON: entry too large (%u bytes) for "
- "the buffer size (%u bytes)", newesize, job->fifo.bsize);
+ import_log_notice(job, "REASON: entry too large (%lu bytes) for "
+ "the buffer size (%lu bytes)", newesize, job->fifo.bsize);
backentry_free(&ep);
job->skipped++;
continue;
@@ -853,8 +853,8 @@ index_set_entry_to_fifo(ImportWorkerInfo *info, Slapi_Entry *e,
char ebuf[BUFSIZ];
import_log_notice(job, "WARNING: skipping entry \"%s\"",
escape_string(slapi_entry_get_dn(e), ebuf));
- import_log_notice(job, "REASON: entry too large (%u bytes) for "
- "the buffer size (%u bytes)", newesize, job->fifo.bsize);
+ import_log_notice(job, "REASON: entry too large (%lu bytes) for "
+ "the buffer size (%lu bytes)", newesize, job->fifo.bsize);
backentry_free(&ep);
job->skipped++;
rc = 0; /* go to the next loop */
@@ -1728,8 +1728,8 @@ upgradedn_producer(void *param)
char ebuf[BUFSIZ];
import_log_notice(job, "WARNING: skipping entry \"%s\"",
escape_string(slapi_entry_get_dn(e), ebuf));
- import_log_notice(job, "REASON: entry too large (%u bytes) for "
- "the buffer size (%u bytes)", newesize, job->fifo.bsize);
+ import_log_notice(job, "REASON: entry too large (%lu bytes) for "
+ "the buffer size (%lu bytes)", newesize, job->fifo.bsize);
backentry_free(&ep);
job->skipped++;
continue;
@@ -2871,8 +2871,8 @@ static int bulk_import_queue(ImportJob *job, Slapi_Entry *entry)
char ebuf[BUFSIZ];
import_log_notice(job, "WARNING: skipping entry \"%s\"",
escape_string(slapi_entry_get_dn(ep->ep_entry), ebuf));
- import_log_notice(job, "REASON: entry too large (%u bytes) for "
- "the import buffer size (%u bytes). Try increasing nsslapd-cachememsize.", newesize, job->fifo.bsize);
+ import_log_notice(job, "REASON: entry too large (%lu bytes) for "
+ "the import buffer size (%lu bytes). Try increasing nsslapd-cachememsize.", newesize, job->fifo.bsize);
backentry_clear_entry(ep); /* entry is released in the frontend on failure*/
backentry_free( &ep ); /* release the backend wrapper, here */
PR_Unlock(job->wire_lock);
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c
index 2b94107..9f22a58 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c
@@ -1509,11 +1509,11 @@ _back_crypt_crypto_op(attrcrypt_private *priv,
}
if (encrypt) {
slapi_log_error(SLAPI_LOG_BACKLDBM, ATTRCRYPT,
- "_back_crypt_crypto_op encrypt '%s' (%d)\n",
+ "_back_crypt_crypto_op encrypt '%s' (%lu)\n",
in_data, in_size);
} else {
slapi_log_error(SLAPI_LOG_BACKLDBM, ATTRCRYPT,
- "_back_crypt_crypto_op decrypt (%d)\n", in_size);
+ "_back_crypt_crypto_op decrypt (%lu)\n", in_size);
}
/* Allocate the output buffer */
output_buffer_length = in_size + BACK_CRYPT_OUTBUFF_EXTLEN;
diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c
index 7f93a0f..9be1138 100644
--- a/ldap/servers/slapd/connection.c
+++ b/ldap/servers/slapd/connection.c
@@ -2691,13 +2691,13 @@ log_ber_too_big_error(const Connection *conn, ber_len_t ber_len,
if (0 == ber_len) {
slapi_log_error( SLAPI_LOG_FATAL, "connection",
"conn=%" NSPRIu64 " fd=%d Incoming BER Element was too long, max allowable"
- " is %u bytes. Change the nsslapd-maxbersize attribute in"
+ " is %" BERLEN_T " bytes. Change the nsslapd-maxbersize attribute in"
" cn=config to increase.\n",
conn->c_connid, conn->c_sd, maxbersize );
} else {
slapi_log_error( SLAPI_LOG_FATAL, "connection",
- "conn=%" NSPRIu64 " fd=%d Incoming BER Element was %u bytes, max allowable"
- " is %u bytes. Change the nsslapd-maxbersize attribute in"
+ "conn=%" NSPRIu64 " fd=%d Incoming BER Element was %" BERLEN_T " bytes, max allowable"
+ " is %" BERLEN_T " bytes. Change the nsslapd-maxbersize attribute in"
" cn=config to increase.\n",
conn->c_connid, conn->c_sd, ber_len, maxbersize );
}
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index c3047bf..694880e 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -4617,7 +4617,7 @@ config_get_require_secure_binds(void)
int
config_get_anon_access_switch(void)
{
- char *retVal = NULL;
+ int retVal = 0;
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
CFG_LOCK_READ(slapdFrontendConfig);
retVal = slapdFrontendConfig->allow_anon_access;
diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c
index 16d964c..fe150e7 100644
--- a/ldap/servers/slapd/result.c
+++ b/ldap/servers/slapd/result.c
@@ -1690,7 +1690,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag,
{
slapi_log_access( LDAP_DEBUG_STATS,
"conn=%" NSPRIu64 " op=%d RESULT err=%d"
- " tag=%u nentries=%d etime=%s%s%s"
+ " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
", SASL bind in progress\n",
op->o_connid,
op->o_opid,
@@ -1702,7 +1702,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag,
{
slapi_log_access( LDAP_DEBUG_ARGS,
"conn=%s op=%d RESULT err=%d"
- " tag=%u nentries=%d etime=%s%s%s"
+ " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
", SASL bind in progress\n",
LOG_INTERNAL_OP_CON_ID,
LOG_INTERNAL_OP_OP_ID,
@@ -1722,7 +1722,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag,
{
slapi_log_access( LDAP_DEBUG_STATS,
"conn=%" NSPRIu64 " op=%d RESULT err=%d"
- " tag=%u nentries=%d etime=%s%s%s"
+ " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
" dn=\"%s\"\n",
op->o_connid,
op->o_opid,
@@ -1734,7 +1734,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag,
{
slapi_log_access( LDAP_DEBUG_ARGS,
"conn=%s op=%d RESULT err=%d"
- " tag=%u nentries=%d etime=%s%s%s"
+ " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
" dn=\"%s\"\n",
LOG_INTERNAL_OP_CON_ID,
LOG_INTERNAL_OP_OP_ID,
@@ -1748,7 +1748,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag,
{
slapi_log_access( LDAP_DEBUG_STATS,
"conn=%" NSPRIu64 " op=%d RESULT err=%d"
- " tag=%u nentries=%d etime=%s%s%s\n",
+ " tag=%" BERTAG_T " nentries=%d etime=%s%s%s\n",
op->o_connid,
op->o_opid,
err, tag, nentries,
@@ -1759,7 +1759,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag,
{
slapi_log_access( LDAP_DEBUG_ARGS,
"conn=%s op=%d RESULT err=%d"
- " tag=%u nentries=%d etime=%s%s%s\n",
+ " tag=%" BERTAG_T " nentries=%d etime=%s%s%s\n",
LOG_INTERNAL_OP_CON_ID,
LOG_INTERNAL_OP_OP_ID,
err, tag, nentries,
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index dd601ca..4fc25b8 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -96,6 +96,16 @@ NSPR_API(PRUint32) PR_fprintf(struct PRFileDesc* fd, const char *fmt, ...)
#define NSPRIu64 "llu"
#define NSPRI64 "ll"
+/* OpenLDAP uses unsigned long for ber_tag_t and ber_len_t but mozldap uses unsigned int */
+/* use this macro for printf statements for ber_tag_t and ber_len_t */
+#if defined(USE_OPENLDAP)
+#define BERTAG_T "lu"
+#define BERLEN_T "lu"
+#else
+#define BERTAG_T "u"
+#define BERLEN_T "u"
+#endif
+
/*
* The slapi_attr_get_flags() routine returns a bitmap that contains one or
* more of these values.
diff --git a/ldap/servers/slapd/slapi-private.h b/ldap/servers/slapd/slapi-private.h
index 3bc0c74..34183a8 100644
--- a/ldap/servers/slapd/slapi-private.h
+++ b/ldap/servers/slapd/slapi-private.h
@@ -1228,6 +1228,13 @@ void DS_Sleep(PRIntervalTime ticks);
/* plugin.c */
int plugin_enabled(const char *plugin_name, void *identity);
+/* protect_db.c */
+/* is_slapd_running()
+ * returns 1 if slapd is running, 0 if not, -1 on error
+ */
+int is_slapd_running();
+
+
#ifdef __cplusplus
}
#endif
13 years, 1 month
Branch '389-ds-base-1.2.8' - ldap/servers
by Richard Allen Megginson
ldap/servers/plugins/replication/windows_tot_protocol.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit b6871e9130c6c78d45d21f5019e3afb19fc2ea6f
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Feb 14 12:21:19 2011 -0700
Bug 675113 - ns-slapd core dump in windows_tot_run if oneway sync is used
https://bugzilla.redhat.com/show_bug.cgi?id=675113
Resolves: bug 675113
Bug Description: ns-slapd core dump in windows_tot_run if oneway sync is used
Author: Carsten Grzemba <grzemba(a)contac-dt.de>
Reviewed by: rmeggins
Branch: 389-ds-base-1.2.8
Fix Description: Init pb and dn to NULL to avoid free of uninit memory.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit cee5f058e10b6379d12b643e03eed81ee22a937d)
diff --git a/ldap/servers/plugins/replication/windows_tot_protocol.c b/ldap/servers/plugins/replication/windows_tot_protocol.c
index 482d49d..24d1675 100644
--- a/ldap/servers/plugins/replication/windows_tot_protocol.c
+++ b/ldap/servers/plugins/replication/windows_tot_protocol.c
@@ -98,8 +98,8 @@ windows_tot_run(Private_Repl_Protocol *prp)
{
int rc;
callback_data cb_data;
- Slapi_PBlock *pb;
- char* dn;
+ Slapi_PBlock *pb = NULL;
+ char* dn = NULL;
RUV *ruv = NULL;
RUV *starting_ruv = NULL;
Replica *replica = NULL;
13 years, 1 month
ldap/servers
by Richard Allen Megginson
ldap/servers/plugins/replication/windows_tot_protocol.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit cee5f058e10b6379d12b643e03eed81ee22a937d
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Feb 14 12:21:19 2011 -0700
Bug 675113 - ns-slapd core dump in windows_tot_run if oneway sync is used
https://bugzilla.redhat.com/show_bug.cgi?id=675113
Resolves: bug 675113
Bug Description: ns-slapd core dump in windows_tot_run if oneway sync is used
Author: Carsten Grzemba <grzemba(a)contac-dt.de>
Reviewed by: rmeggins
Branch: master
Fix Description: Init pb and dn to NULL to avoid free of uninit memory.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/replication/windows_tot_protocol.c b/ldap/servers/plugins/replication/windows_tot_protocol.c
index 482d49d..24d1675 100644
--- a/ldap/servers/plugins/replication/windows_tot_protocol.c
+++ b/ldap/servers/plugins/replication/windows_tot_protocol.c
@@ -98,8 +98,8 @@ windows_tot_run(Private_Repl_Protocol *prp)
{
int rc;
callback_data cb_data;
- Slapi_PBlock *pb;
- char* dn;
+ Slapi_PBlock *pb = NULL;
+ char* dn = NULL;
RUV *ruv = NULL;
RUV *starting_ruv = NULL;
Replica *replica = NULL;
13 years, 1 month
mod_admserv/mod_admserv.c
by Noriko Hosoi
mod_admserv/mod_admserv.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
New commits:
commit 0f074403a6a59449bf7271a45840c284bee5a8f1
Author: Noriko Hosoi <nhosoi(a)jiji.usersys.redhat.com>
Date: Sat Feb 12 18:42:33 2011 -0800
Bug 245278 - Changing to a password with a single quote does not work
https://bugzilla.redhat.com/show_bug.cgi?id=245278
Description: When the Admin User password is changed on the Admin
Console, the console escapes the password then sends it to the
Admin Server. This patch adds the apache API ap_unescape_url to
mod_admserv to unescape the password before handling it. Since
ap_unescape_url does the unescape in place, it duplicates the
given password and escapes on the duplicated memory.
diff --git a/mod_admserv/mod_admserv.c b/mod_admserv/mod_admserv.c
index 6f96669..ede5c33 100644
--- a/mod_admserv/mod_admserv.c
+++ b/mod_admserv/mod_admserv.c
@@ -1330,13 +1330,14 @@ bailout:
/*
* Modify SIE password
+ * query points to new password
*/
static int
change_sie_password(const char *name, char *query, void* arg, request_rec *r)
{
FILE *f;
char *uid=NULL , *col=NULL, *origpw_hash=NULL;
- char *newpw=query;
+ char *newpw = NULL;
char filename[BIG_LINE];
char inbuf[BIG_LINE];
char outbuf[64]; /* needs at least 36 bytes */
@@ -1345,7 +1346,7 @@ change_sie_password(const char *name, char *query, void* arg, request_rec *r)
apr_snprintf(filename, sizeof(filename), "%s/admpw", configdir);
- if (newpw==NULL) {
+ if (query==NULL) {
ap_log_rerror(APLOG_MARK, APLOG_CRIT, 0, r,
"Wrong usage, password param missing");
return 0;
@@ -1373,6 +1374,14 @@ change_sie_password(const char *name, char *query, void* arg, request_rec *r)
uid = inbuf; *col=0; origpw_hash=col+1;
+ /* newpw is escaped; it needs to be unescaped. */
+ newpw = strdup(query);
+ if (NULL == newpw) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
+ "failed to allocate memory for password");
+ goto recover;
+ }
+ ap_unescape_url(newpw);
apr_sha1_base64(newpw, strlen(newpw), outbuf);
if (!update_admpwd(configdir, uid, outbuf)) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
@@ -1381,7 +1390,7 @@ change_sie_password(const char *name, char *query, void* arg, request_rec *r)
}
admpwd_done = 1;
- if (!task_update_registry_server_bindpw(uid, strdup(newpw), bindpw, r)) {
+ if (!task_update_registry_server_bindpw(uid, newpw, bindpw, r)) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
"failed to update server bindpw");
goto recover;
@@ -1390,6 +1399,9 @@ change_sie_password(const char *name, char *query, void* arg, request_rec *r)
return 1;
recover:
+ if (newpw) {
+ free(newpw);
+ }
if (admpwd_done) {
update_admpwd(configdir, uid, origpw_hash);
}
13 years, 1 month
lib/libdsa
by Noriko Hosoi
lib/libdsa/dsalib_confs.c | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit 2f738add9cab9497eb409386850608bed2b7a39e
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Feb 11 09:25:34 2011 -0800
Bug 604881 - admin server log files have incorrect permissions/ownerships
https://bugzilla.redhat.com/show_bug.cgi?id=604881
Description: buflen in ds_get_conf_from_file (dsalib_confs.c)
is available only if USE_OPENLDAP is defined. Previous commit
a997fc5610de4acde28043a4711004be57a96c33 introduced it.
diff --git a/lib/libdsa/dsalib_confs.c b/lib/libdsa/dsalib_confs.c
index 3e4380d..0747fe9 100644
--- a/lib/libdsa/dsalib_confs.c
+++ b/lib/libdsa/dsalib_confs.c
@@ -119,7 +119,9 @@ ds_get_conf_from_file(FILE *conf)
}
free(begin);
entry = NULL;
+#if defined(USE_OPENLDAP)
buflen = 0;
+#endif
}
return(conf_list);
13 years, 1 month