History log of /freebsd-current/usr.sbin/ypldap/ldapclient.c
Revision Date Author Comments
# 2a63c3be 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c comment pattern

Remove /^/[*/]\s*\$FreeBSD\$.*\n/


# 8457b7f4 20-Jun-2023 John Baldwin <jhb@FreeBSD.org>

ypldap: Remove set but unused variables.

Some of these were reported by GCC, others reported by clang.


# bbdfc8f1 01-Dec-2016 Marcelo Araujo <araujo@FreeBSD.org>

Use memset(3) instead of bzero(3).

Obtained from: OpenBSD (r1.12, r1.20, r1.18 and r1.37)


# 9d80a8b0 24-May-2016 Don Lewis <truckman@FreeBSD.org>

Fix Coverity CIDs 1340544 Resource leak and 1340543 Use after free

At line 479 of ldapclient.c in client_build_req(), the error return
leaks ldap_attrs (CID 1340544). It looks like this can happen if
the first utoa() call in aldap_get_stringset() fails. It looks
like other leaks can happen if other utoa() calls fail since scanning
this array when it is freed stops when the first NULL is encountered.
Fix these problems by not storing NULL in the array when utoa()
fails, and by freeing ret and returning NULL if nothing is stored
in the array. That way the caller will never see the
ldap_attrs[0] == NULL case, so delete that check.

The ber_printf_element() calls ber_free_elements() on its ber
argument and returns NULL on failure. When each of its callers
detects failure, they do a goto fail, which then calls ber_free_elements()
with the same pointer (CID 1340543). Fix is to delete the
ber_free_elements() from ber_printf_element()

Reported by: Coverity
CID: 1340543, 1340544
Reviewed by: araujo
Differential Revision: https://reviews.freebsd.org/D6550


# eaf209de 12-Apr-2016 Marcelo Araujo <araujo@FreeBSD.org>

Convert ypldap_addr list to a tailq(queue(3)).

Obtained from: OpenBSD r1.11, r1.17 and r1.36


# 6d652b13 15-Dec-2015 Marcelo Araujo <araujo@FreeBSD.org>

Remove a garbage printf used for debug.

Approved by: bapt (mentor implicit)


# 7433efff 15-Dec-2015 Marcelo Araujo <araujo@FreeBSD.org>

EAGAIN handling for imsg_read.

Approved by: bapt (mentor)
Obtained from: OpenBSD
Differential Revision: https://reviews.freebsd.org/D4547


# 3634bb8e 16-Nov-2015 Craig Rodrigues <rodrigc@FreeBSD.org>

Add include of signal.h for signal() prototype.


# 4fa5f535 16-Nov-2015 Craig Rodrigues <rodrigc@FreeBSD.org>

Do not use SA_LEN() to dereference sa_len.

FreeBSD lacks the SA_LEN() macro.


# 9e7c127f 16-Nov-2015 Craig Rodrigues <rodrigc@FreeBSD.org>

Import ypldap from OpenBSD.

ypldap -- Intended to be a drop-in replacement for ypserv, gluing in a
LDAP directory and thus providing support for users and groups stored in
LDAP for the get{pw,gr}ent family of functions.