History log of /freebsd-head/usr.sbin/ypldap/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0445cbd6a8f786da6eceac64ed25a478590aa848 28-May-2020 emaste <emaste@FreeBSD.org> rename in-tree libevent v1 to libevent1

r316063 installed pf's embedded libevent as a private lib, with headers
in /usr/include/private/event. Unfortunately we also have a copy of
libevent v2 included in ntp, which needed to be updated for compatibility
with OpenSSL 1.1.

As unadorned 'libevent' generally refers to libevent v2, be explicit that
this one is libevent v1.

Reviewed by: vangyzen (earlier)
Differential Revision: https://reviews.freebsd.org/D17275
akefile
008e5309703022679ff5a90f0dd43e0b747e5663 06-Apr-2020 kevans <kevans@FreeBSD.org> yp*: fix -fno-common build

This is mostly two problems spread out far and wide:
- ypldap_process should be declared properly
- debug is defined differently in many programs

For the latter, just extern it and define it everywhere that actually needs
it. This mostly works out nicely for ^/libexec/ypxfr, which can remove the
assignment at the beginning of main in favor of defining it properly.

-fno-common will become the default in GCC10/LLVM11.

MFC after: 3 days
pldap.c
pldap.h
1b1a67415d2e2ffcb50f10c87fa5b14adbc0a477 24-Mar-2020 carlavilla <carlavilla@FreeBSD.org> Correct path in EXAMPLES ypldap.conf.5

PR: 244743
Submitted by: alex@i.org.ua
Patch by: alex@i.org.ua
Approved by: bcr@(mentor), 0mp
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D24144
pldap.conf.5
29cd5fdfb7b58f4a5e3e9bc9a7389665ce08602d 29-Jan-2020 cem <cem@FreeBSD.org> ypldap(8): Fix absent va_end() in 'goto fail' path

In this path, we used va_start() without pairing it with va_end(). Add the
va_end(). (va_start() without paired va_end() is undefined behavior per the C
standard.)

"In many implementations, [va_end] is a do-nothing operation; but those
implementations that need it probably need it badly." - Rationale for the ANSI
C Programming Language, ยง 4.8.1.3.

Reported by: Coverity
CID: 1340539
er.c
792fd42d7804a39bbe85e54b87c2c18dc09dffe5 12-Aug-2019 kib <kib@FreeBSD.org> Increase YPMAXRECORD to 16M to be compatible with Linux.

Since YP protocol definition uses the constant to declare
variable-size opaque byte strings, the change should be binary
compatible with existing installations which do not expose keys or
values larger than 1024 bytes.

All uses of local variables with YPMAXRECORD sizes were removed to
avoid insane stack use. On the other hand, variables with static
lifetime should be fine and only result in increased VA use.

Glibc made same change, increasing the allowed length for keys and
values in YP to 16M, in 2013.

Reviewed by: markj
Discussed with: ian
Sponsored by: Mellanox Technologies
MFC after: 3 weeks
Differential revision: https://reviews.freebsd.org/D20900
p.c
a598c4b809a73772d7452991213407cdac302156 31-Oct-2017 bdrewery <bdrewery@FreeBSD.org> DIRDEPS_BUILD: Update dependencies.

Sponsored by: Dell EMC Isilon
akefile.depend
c0de965832d402ac3f76a931784b2ccf637d98a3 01-Aug-2017 araujo <araujo@FreeBSD.org> Log when we have finished pushing users and groups.

Obtained from: OpenBSD (rev 1.4)
MFC after: 3 weeks.
ntries.c
5cd267669ad161ed479bbbe0668791211866233c 26-May-2017 araujo <araujo@FreeBSD.org> Simplify parseval() by allocating a buffer the size of the input string,
which will always be big enough to hold the output string.

Obtained from: OpenBSD (revision 1.36)
ldap.c
a6757a51edd32e24b40b5b073b842a565dc0398a 01-Mar-2017 ngie <ngie@FreeBSD.org> Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This simplifies pathing in make/displayed output.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
akefile
dcae55d955c934874ed2a17a10ed6882893555d5 02-Dec-2016 araujo <araujo@FreeBSD.org> Use memset(3) instead of bzero(3).

Obtained from: OpenBSD (r1.12, r1.20, r1.18 and r1.37)
dapclient.c
p.c
pldap.c
pldap_dns.c
359d465f281b50e446af194b18d90e9680b2c33e 02-Dec-2016 araujo <araujo@FreeBSD.org> String terminators are called NUL, not NULL, also the variable
mentioned in the comment is p and not u.

Obtained from: OpenBSD (r1.34)
ldap.c
1fb7675c9b2d443f576cfbefd560afd96ba116b5 02-Sep-2016 bdrewery <bdrewery@FreeBSD.org> DIRDEPS_BUILD: Update dependencies after a 'make bootstrap-tools'.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
akefile.depend
33f1090a42059c73656b8c96c6f61690c4321268 31-Aug-2016 bdrewery <bdrewery@FreeBSD.org> DIRDEPS_BUILD: Add some missing dirctories to the build.

Sponsored by: EMC / Isilon Storage Division
akefile.depend
152f3ac01ba8cb5b5a8ef0472edbcb6287d8b045 11-Jul-2016 araujo <araujo@FreeBSD.org> Do not allow whitespace in macro names.

Obtained from: OpenBSD (r1.19).
arse.y
67ba759b0999a946f115c0fd5cee343f969a4ab8 07-Jun-2016 araujo <araujo@FreeBSD.org> Bump date in both manpages.

Reported by: rodrigc
pldap.8
93e484e00e1e2dc498a7f4c45c0019e43b8ec5b2 07-Jun-2016 araujo <araujo@FreeBSD.org> Add an entry on rc.conf(5) explaining the new options
nis_ypldap_enable and nis_ypldap_flags.

Also add an entry on ypldap(8) that it is a feature ready and
appears on FreeBSD 11.0.

Requested by: rodrigc
Relnotes: Yes
pldap.8
610c8f37edec3884d4c6ff72b64b78bac7a3166a 25-May-2016 truckman <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
ldap.c
er.c
dapclient.c
597006884d4b7faaac2a44368cc71092b76231fd 16-May-2016 araujo <araujo@FreeBSD.org> Simplify overengineered and buggy code that looked like as if it did
some kind of UTF-8 validation, but actually didn't, but instead, for
malformed UTF-8 input, caused buffer overruns in some cases and caused
skipping of valid ASCII characters in other cases.

Obtained from: OpenBSD (cvs 1.32)
ldap.c
a0609b695300cdec9e5f939feb2672ced5d673cd 16-May-2016 araujo <araujo@FreeBSD.org> When a group contains a non-existent user, make the warning
message more helpful by mentioning the group name.

Obtained from: OpenBSD (cvs 1.19)
pldap.c
6a2044f5e3bb23a51d7df898620d9ff780d68e49 13-May-2016 truckman <truckman@FreeBSD.org> Avoid indexing an array with a negative value.

Reported by: Coverity
CID: 971121
er.c
d2ff81490f54ee7dce8300a6be73933fc2b787d8 18-Apr-2016 araujo <araujo@FreeBSD.org> Use nitems instead of 'sizeof(mapnames) / sizeof(mapnames[0]'.
p.c
7e0cb4103fed91c6df84012e9062074dfe394c45 13-Apr-2016 araujo <araujo@FreeBSD.org> Convert ypldap_addr list to a tailq(queue(3)).

Obtained from: OpenBSD r1.11, r1.17 and r1.36
dapclient.c
pldap.h
pldap_dns.c
0e0d28c3d5f6588be357f5eb4e924fd5be0fd13d 13-Apr-2016 araujo <araujo@FreeBSD.org> Apply revisions 1.4 and 1.5 from ldapd's ber.c to ypldap's copy, so it can
deal with messages that haven't been fully read from the server yet.

Obtained from: OpenBSD r1.11
er.c
5c77da40c3bc5139d0f06ece21c78115a1e5f58b 04-Mar-2016 araujo <araujo@FreeBSD.org> Set argument encode/result decode call backs for 'maplist' and 'all'.

Note: Listing a map is still not fully implemented.

Obtained from: OpenBSD (r1.16, r1.17)
p.c
fa3cdda2542d27ac605b5ebc2de9a56e8274c907 04-Mar-2016 araujo <araujo@FreeBSD.org> Implement the 'master' request.

Obtained from: OpenBSD (r1.15)
p.c
010e5362b87aa3e400c15c0cf58de9e0579d633f 22-Jan-2016 araujo <araujo@FreeBSD.org> Switch from FD_SETSIZE to getdtablesize(2) as it can make the FD to be
tunable. Also it gets more close with the original implementation from
OpenBSD.

Requested by: rodrigc
Approved by: rodrigc (mentor)
Differential Revision: https://reviews.freebsd.org/D4970
p.c
195a2554c476f28c6a09292226cf17726da0590d 13-Jan-2016 araujo <araujo@FreeBSD.org> ypldap(8) is a feature ready to be used to translate nis(8) database to ldap(3).

This commit, fix a core dump on ypldap(8) related with memory allocation.
Also an example of how to set the ypldap.conf(5) properly is added to
examples files.

A new user _ypldap is required to be able to run ypldap(8) as well as
in a chroot mode.

Reviewed by: rodrigc (mentor), bjk
Approved by: bapt (mentor)
Relnotes: Yes
Sponsored by: gandi.net
Differential Revision: https://reviews.freebsd.org/D4744
p.c
pldap.conf.5
2dd258160a988888832a006ec38aa1384ed5ab95 15-Dec-2015 araujo <araujo@FreeBSD.org> Remove a garbage printf used for debug.

Approved by: bapt (mentor implicit)
dapclient.c
c269bcd7edce9d0a34377dcf4cacf77c276263b7 15-Dec-2015 araujo <araujo@FreeBSD.org> Remove the null checker before free.

Approved by: bapt (mentor)
Obtained from: OpenBSD
Differential Revision: https://reviews.freebsd.org/D4549
ldap.c
7e0d3844ca8f1f6eaaad7c08d37c89132debebb3 15-Dec-2015 araujo <araujo@FreeBSD.org> Remove wrong header and the NULL check before free().

Approved by: bapt (mentor)
Obtained from: OpenBSD
Differential Revision: https://reviews.freebsd.org/D4548
er.c
99a0984f8bab31482ce2826097face2119a304e6 15-Dec-2015 araujo <araujo@FreeBSD.org> EAGAIN handling for imsg_read.

Approved by: bapt (mentor)
Obtained from: OpenBSD
Differential Revision: https://reviews.freebsd.org/D4547
dapclient.c
pldap.c
pldap_dns.c
4fa762588477ce47c72de04254d9b68f49cd6f42 16-Nov-2015 rodrigc <rodrigc@FreeBSD.org> Add include of signal.h for signal() prototype.
dapclient.c
bba159a487b1c48b29b09dd5c4d9b725b115cfc2 16-Nov-2015 rodrigc <rodrigc@FreeBSD.org> Replace __svc_fdset with svc_fdset.

FreeBSD lacks __svc_fdset and __svc_fdsetsize.
p.c
68b3fb6aaf3a793d87f8bcfc7e75c1a9e0849688 16-Nov-2015 rodrigc <rodrigc@FreeBSD.org> Do not use SA_LEN() to dereference sa_len.

FreeBSD lacks the SA_LEN() macro.
dapclient.c
84a8f489f2e344845c1584364c1227b903f4a4ec 16-Nov-2015 rodrigc <rodrigc@FreeBSD.org> Add include of time.h for tzset() prototype.
og.c
aa02ae250de10316b02a804898afb2834235c199 16-Nov-2015 rodrigc <rodrigc@FreeBSD.org> Replace __dead with __dead2.

FreeBSD lacks __dead.
og.c
pldap.c
1ca828578c856a6616ffd650ddde8feca7e903ba 16-Nov-2015 rodrigc <rodrigc@FreeBSD.org> Add include of sys/param.h for MAXHOSTNAMELEN
ntries.c
arse.y
p.c
pldap.c
pldap_dns.c
c20370bb1b072092f6a47b689ff953a82a7325a1 16-Nov-2015 rodrigc <rodrigc@FreeBSD.org> Replace __dead with __dead2.

FreeBSD lacks __dead.
pldap.h
cbf7792efde26f9d6677ccd75d70bf2d757db1d4 16-Nov-2015 rodrigc <rodrigc@FreeBSD.org> Replace HOST_NAME_MAX with MAXHOSTNAMELEN.

FreeBSD lacks HOST_NAME_MAX.
pldap.h
9dc16cbb6ac9534c24b141c0983fdb5108cd65e7 16-Nov-2015 rodrigc <rodrigc@FreeBSD.org> Remove reference to EAI_NODATA.

It does not exist on FreeBSD.
pldap_dns.c
8dff23c527b3f539c4e9e66fb3f362b5dda9aa0c 16-Nov-2015 rodrigc <rodrigc@FreeBSD.org> Add include of <string.h> for strlen() prototype.
er.c
8fc8f40e0d49c50a9f764c472aefe5211674a28e 16-Nov-2015 rodrigc <rodrigc@FreeBSD.org> Convert Makefile to FreeBSD style.

Add libopenbsd to link line for imsg.
akefile
d2078e379a508e6ee362fc30ecc041c9b5161d62 16-Nov-2015 rodrigc <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.
akefile
ldap.c
ldap.h
er.c
er.h
ntries.c
dapclient.c
og.c
arse.y
p.c
pldap.8
pldap.c
pldap.conf.5
pldap.h
pldap_dns.c