https://bugs.openldap.org/show_bug.cgi?id=10297
Issue ID: 10297
Summary: LDAP initialization does unnecessary resolution of
hostname
Product: OpenLDAP
Version: 2.6.8
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: needs_review
Severity: normal
Priority: ---
Component: libraries
Assignee: bugs(a)openldap.org
Reporter: simon.pichugin(a)gmail.com
Target Milestone: ---
curl --version does try to resolve local hostname, which is usually stored in
$HOSTNAME variable. It seems it does that for no good reason. It does not
matter whether machine hostname is already FQDN or not, it always try it
unconditionally by calling getaddrinfo(3).
Every usage of dnf tries to resolve hostname. That is then supressed by
myhostname on Fedora, which returns non-helping response. Possibly, the
hostname should be fetched from actual network responses.
Seen with:
openldap-2.6.8-5.fc41.x86_64
Reproducible: Always
Steps to Reproduce:
1. dnf install gdb curl
2. gdb --args curl --version
3. (gdb) break getaddrinfo
4. (gdb) run
Actual Results:
getaddrinfo is called with current hostname, stored into ldap_int_hostname
variable. That is used only when ldap client has not configured target server.
But this hostname seems fetched always.
Expected Results:
No network activity happens, unless something is actually requested. This is
not the case.
Suggestion is to make it lazy initialized. It should be tried only when
necessary. This seems to be useful when tlso_session_chkhost in
libraries/libldap/tls_o.c is used. It should initialize hostname only once
conditions to use it happens. There is a fallback anyway. It should query FQDN
only when name_in contains unusable response.
Related: https://github.com/systemd/systemd/issues/34897
--
You are receiving this mail because:
You are on the CC list for the issue.
https://bugs.openldap.org/show_bug.cgi?id=10361
Issue ID: 10361
Summary: lapo-auditlog: Add olcAuditLogNonBlocking to avoid
blocking when logging to named pipes
Product: OpenLDAP
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: needs_review
Severity: normal
Priority: ---
Component: overlays
Assignee: bugs(a)openldap.org
Reporter: a.cudbardb(a)freeradius.org
Target Milestone: ---
Created attachment 1081
--> https://bugs.openldap.org/attachment.cgi?id=1081&action=edit
Patch adding olcAuditlogNonBlocking and a tests for slapo-auditlog
The default behaviour of fopen() when called on a named pipe which does not
have any reader, is to block, until a reader opens the pipe. This in turn
blocks slapo-auditlog when it attempts to write output, and prevents slapd
processing requests. Depending on how critical the audit log is, it may be
preferable to discard audit log output and continue processing requests if
there's no reader available which olcAuditLogNonBlocking: TRUE allows.
For clarity the call to fopen() is removed and replaced with open()/fdopen(),
allowing us to specify O_* flags as opposed to using fopen() OR open()/fdopen()
depending on whether we should block. 0666 are the base permissions used by
fopen() when files are created.
There were no tests for slapo-auditlog, so a small test suite that tests both
the basic behaviour, and blocking/non-blocking writes.
--
You are receiving this mail because:
You are on the CC list for the issue.
https://bugs.openldap.org/show_bug.cgi?id=10360
Issue ID: 10360
Summary: delta-sync can apply old mods
Product: OpenLDAP
Version: 2.6.9
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: needs_review
Severity: normal
Priority: ---
Component: slapd
Assignee: bugs(a)openldap.org
Reporter: hyc(a)openldap.org
Target Milestone: ---
This might be related to #10358, but not sure.
In delta MPR, if an older mod is received on an entry after a newer mod has
already been applied by a local user, the older mod is applied and the newer
mod is lost.
The incoming replication ops are checked for freshness by check_csn_age() but
that only checks the incoming cookieCSN against contextCSNs of the same SID.
I.e., that check only prevents duplicate mods being replicated multiple times
from the same remote provider. If check_csn_age() passes, then
syncrepl_message_to_op() is invoked which just applies the mod. It doesn't
check the mod or cookieCSN against the entry's current entryCSN.
The code in syncrepl_op_mod() performs the checks we need. The code just needs
to be pulled into a new function so it can be used in both places.
--
You are receiving this mail because:
You are on the CC list for the issue.
https://bugs.openldap.org/show_bug.cgi?id=10358
Issue ID: 10358
Summary: syncrepl can revert an entry's CSN
Product: OpenLDAP
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: needs_review
Severity: normal
Priority: ---
Component: slapd
Assignee: bugs(a)openldap.org
Reporter: ondra(a)mistotebe.net
Target Milestone: ---
Created attachment 1080
--> https://bugs.openldap.org/attachment.cgi?id=1080&action=edit
Debug log of an instance of this happening
There is a sequence of operations which can force a MPR node to apply changes
out of order (essentially reverting an operation). Currently investigating
which part of the code that should have prevented this has let it slip.
A sample log showing how this happened is attached.
--
You are receiving this mail because:
You are on the CC list for the issue.
https://bugs.openldap.org/show_bug.cgi?id=10359
Issue ID: 10359
Summary: delta-MPR uses logbase for more than it documents
Product: OpenLDAP
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: needs_review
Severity: normal
Priority: ---
Component: slapd
Assignee: bugs(a)openldap.org
Reporter: ondra(a)mistotebe.net
Target Milestone: ---
syncrepl logbase=<dn> is used not just for a syncrepl session (documented) but
also for internal searches when it comes to delta-MPR conflict resolution. This
is not documented so an admin doesn't know that the local accesslog DB needs to
exist and have the same suffix.
Either the documentation needs updating or a new configuration item needs to be
added to allow an accesslog DB with a different suffix locally.
--
You are receiving this mail because:
You are on the CC list for the issue.
https://bugs.openldap.org/show_bug.cgi?id=10357
Issue ID: 10357
Summary: Potential buffer underflow in function
config_find_base
Product: OpenLDAP
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: needs_review
Severity: normal
Priority: ---
Component: slapd
Assignee: bugs(a)openldap.org
Reporter: alexguo1023(a)gmail.com
Target Milestone: ---
In function `config_find_base`, we have the code:
```c
char *c = dn->bv_val+dn->bv_len;
for (;*c != ',';c--);
```
In the loop, if the string doesn't contain any commas, `c` will decrement below
`dn->bv_val`, causing buffer underflow when `*c` is accessed.
--
You are receiving this mail because:
You are on the CC list for the issue.
https://bugs.openldap.org/show_bug.cgi?id=10347
Issue ID: 10347
Summary: Fix a memory leak in function comp_convert_asn_to_ldap
Product: OpenLDAP
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: needs_review
Severity: normal
Priority: ---
Component: contrib
Assignee: bugs(a)openldap.org
Reporter: alexguo1023(a)gmail.com
Target Milestone: ---
Created attachment 1076
--> https://bugs.openldap.org/attachment.cgi?id=1076&action=edit
Patch: Fix a memory leak in function comp_convert_asn_to_ldap
In function comp_convert_asn_to_ldap, the bv->bv_val is allocated in 3 places:
case BASICTYPE_BOOLEAN: bv->bv_val = (char*)malloc( 5 );
case BASICTYPE_INTEGER: bv->bv_val = (char*)malloc( INITIAL_ATTR_SIZE );
case BASICTYPE_ENUMERATED: bv->bv_val = (char*)malloc( INITIAL_ATTR_SIZE );
When csi->csi_syntax != NULL and csi->csi_syntax->ssyn_pretty != NULL,
bv->bv_val is overwriten with bv->bv_val = prettied.bv_val;, causing porential
memory leak.
--
You are receiving this mail because:
You are on the CC list for the issue.
https://bugs.openldap.org/show_bug.cgi?id=10343
Issue ID: 10343
Summary: Potential Memory Leak in function
slap_uuidstr_from_normalized
Product: OpenLDAP
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: needs_review
Severity: normal
Priority: ---
Component: slapd
Assignee: bugs(a)openldap.org
Reporter: alexguo1023(a)gmail.com
Target Milestone: ---
Created attachment 1070
--> https://bugs.openldap.org/attachment.cgi?id=1070&action=edit
Patch: Change 1 to -1.
In function slap_uuidstr_from_normalized, the code allocates a new `struct
berval` with
```c
new = (struct berval *)slap_sl_malloc(sizeof(struct berval), ctx);
```
and then attempt to allocate `new->bv_val`. If that second allocation fails, it
sets `rc = 1` and jumps to the `done` cleanup label. However, the cleanup code
only runs when `rc == -1`, so the memory pointed by `new` is never freed,
causing a memory leak.
--
You are receiving this mail because:
You are on the CC list for the issue.
https://bugs.openldap.org/show_bug.cgi?id=10344
Issue ID: 10344
Summary: Potential memory leak in function
firstComponentNormalize and objectClassPretty.
Product: OpenLDAP
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: needs_review
Severity: normal
Priority: ---
Component: slapd
Assignee: bugs(a)openldap.org
Reporter: alexguo1023(a)gmail.com
Target Milestone: ---
Created attachment 1071
--> https://bugs.openldap.org/attachment.cgi?id=1071&action=edit
Patch: Ensure the first argument passed to `ber_dupbv_x` is not `NULL`.
In `firstComponentNormalize`, the code calls `ber_dupbv_x` but ignores its
return value.
```c
ber_dupbv_x(normalized, val, ctx);
```
When `normalized` is `NULL`, `ber_dupbv_x` allocates a new `struct berval` and
returns it; failing to capture that pointer means we lose ownership and leak
the allocation. The same issue arises in `objectClassPretty`. We should follow
the pattern in function `hexNormalize`, which asserts that its `normalized`
argument is non-NULL before use:
```c
assert(normalized != NULL);
```
--
You are receiving this mail because:
You are on the CC list for the issue.
https://bugs.openldap.org/show_bug.cgi?id=10348
Issue ID: 10348
Summary: Free ch_malloc-allocated memory in error paths
Product: OpenLDAP
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: needs_review
Severity: normal
Priority: ---
Component: slapd
Assignee: bugs(a)openldap.org
Reporter: alexguo1023(a)gmail.com
Target Milestone: ---
Created attachment 1077
--> https://bugs.openldap.org/attachment.cgi?id=1077&action=edit
Patch: Relase memory allocated from ch_malloc in 2 error handling branches.
In ldap_back_monitor_ops_init and syncrepl_dirsync_message, memory allocated
with ch_malloc was not freed when errors occurred. This adds two ch_free calls
to ensure proper cleanup in those branches.
--
You are receiving this mail because:
You are on the CC list for the issue.