OpenBSD CVS

CVS log for src/usr.sbin/ypldap/aldap.c


[BACK] Up to [local] / src / usr.sbin / ypldap

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.49 / (download) - annotate - [select for diffs], Thu Oct 13 04:55:33 2022 UTC (19 months, 3 weeks ago) by jmatthew
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.48: +37 -1 lines
Diff to previous 1.48 (colored)

Add client certificate authentication and optional SASL EXTERNAL bind,
which allows the client to bind as the subject of the certificate in cases
where the directory doesn't implicitly do that.

The client certificate is configured with 'certfile' and 'keyfile'
directives, and SASL EXTERNAL bind is configured with the 'bindext'
directive.

ok tb@

Revision 1.48 / (download) - annotate - [select for diffs], Thu Mar 31 09:06:55 2022 UTC (2 years, 2 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.47: +6 -7 lines
Diff to previous 1.47 (colored)

'e' is no longer an optional element for ober_scanf_elements.
This caused the last attribute to be dropped.

Reported by Allan Streib (astreib <at> fastmail <dot> fm)
Reminded by Raf Czlonka (rczlonka <at> gmail <dot> com)
OK tb@ claudio@

Revision 1.46.2.1 / (download) - annotate - [select for diffs], Sun Oct 27 20:05:13 2019 UTC (4 years, 7 months ago) by tb
Branch: OPENBSD_6_6
Changes since 1.46: +85 -85 lines
Diff to previous 1.46 (colored) next main 1.47 (colored)

The ber_* namespace is used by liblber since time immemorial,
so move our BER API to the unused ober_* prefix to avoid some
breakage in ports.

Problem diagnosed by jmatthew with ber_free() in samba, but
there are many others as pointed out by sthen.

tests & ok rob
ok sthen (who had an almost identical diff for libutil)
"go head hit it" deraadt

OpenBSD 6.6 errata 002

Revision 1.47 / (download) - annotate - [select for diffs], Thu Oct 24 12:39:27 2019 UTC (4 years, 7 months ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.46: +85 -85 lines
Diff to previous 1.46 (colored)

The ber_* namespace is used by liblber since time immemorial,
so move our BER API to the unused ober_* prefix to avoid some
breakage in ports.

Problem diagnosed by jmatthew with ber_free() in samba, but
there are many others as pointed out by sthen.

tests & ok rob
ok sthen (who had an almost identical diff for libutil)
"go head hit it" deraadt

Revision 1.46 / (download) - annotate - [select for diffs], Tue Sep 10 14:35:32 2019 UTC (4 years, 8 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE
Branch point for: OPENBSD_6_6
Changes since 1.45: +6 -4 lines
Diff to previous 1.45 (colored)

During libutil/ber.c r1.12 I made sure that every element that's requested
by ber_scanf_elements must exist.

aldap.c apparently abused the old behaviour by always trying to retrieve
the referral element, which according to RFC4511 section 4.1.9 is optional.

This diff only requests the referral element if we get a referral response.

OK rob@

Revision 1.45 / (download) - annotate - [select for diffs], Thu Jan 17 06:22:54 2019 UTC (5 years, 4 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.44: +1 -2 lines
Diff to previous 1.44 (colored)

use $OpenBSD markers only

Revision 1.44 / (download) - annotate - [select for diffs], Tue Nov 27 12:06:39 2018 UTC (5 years, 6 months ago) by martijn
Branch: MAIN
Changes since 1.43: +30 -29 lines
Diff to previous 1.43 (colored)

Sync aldap and ber with ldap(1).

OK claudio@

Revision 1.43 / (download) - annotate - [select for diffs], Sun Aug 12 22:04:09 2018 UTC (5 years, 9 months ago) by rob
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.42: +4 -4 lines
Diff to previous 1.42 (colored)

Change ber_write_elements() to return ssize_t instead of int.

ok claudio@

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jul 31 11:37:18 2018 UTC (5 years, 10 months ago) by rob
Branch: MAIN
Changes since 1.41: +4 -4 lines
Diff to previous 1.41 (colored)

Fix some debugging output now that ber type and encoding are unsigned int.

ok claudio@

Revision 1.41 / (download) - annotate - [select for diffs], Tue Jul 31 11:00:12 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.40: +9 -10 lines
Diff to previous 1.40 (colored)

Make ber type and encoding a unsigned int instead of unsigned long.
This way the size is the same on all archs and 32bit should be good enough.
OK rob@

Revision 1.40 / (download) - annotate - [select for diffs], Thu Jun 21 10:37:00 2018 UTC (5 years, 11 months ago) by reyk
Branch: MAIN
Changes since 1.39: +20 -14 lines
Diff to previous 1.39 (colored)

Sync aldap from ldap(1).

This also fixes the _url functions that was previously #ifdef'ed out.

OK claudio@

Revision 1.39 / (download) - annotate - [select for diffs], Thu Feb 8 18:02:06 2018 UTC (6 years, 4 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.38: +2 -5 lines
Diff to previous 1.38 (colored)

Kill ber.c support for direct fd read/writes

This mechanism is already unused and annotated with lots of XXX's, no
need to keep it around.  ok claudio@

Revision 1.38 / (download) - annotate - [select for diffs], Thu Dec 21 05:09:56 2017 UTC (6 years, 5 months ago) by jmatthew
Branch: MAIN
Changes since 1.37: +7 -7 lines
Diff to previous 1.37 (colored)

Close the right file descriptor and clean up the tls context in aldap_close().

ok zhuk@ deraadt@

Revision 1.37 / (download) - annotate - [select for diffs], Tue May 30 09:33:31 2017 UTC (7 years ago) by jmatthew
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.36: +166 -24 lines
Diff to previous 1.36 (colored)

Teach ypldap to use tls when connecting to ldap servers.
libtls help from jsing@, linker help from deraadt@

Revision 1.36 / (download) - annotate - [select for diffs], Mon Mar 27 04:46:47 2017 UTC (7 years, 2 months ago) by jmatthew
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.35: +8 -19 lines
Diff to previous 1.35 (colored)

simplify parseval() by allocating a buffer the size of the input string,
which will always be big enough to hold the output string.

ok dlg@

Revision 1.35 / (download) - annotate - [select for diffs], Fri Feb 3 08:23:46 2017 UTC (7 years, 4 months ago) by guenther
Branch: MAIN
Changes since 1.34: +3 -2 lines
Diff to previous 1.34 (colored)

Stop assuming that in_{addr,port}_t are typedefed in <sys/types.h> and
instead pull in <netinet/in.h> or <arpa/inet.h> when those are needed.

ok florian@ beck@ millert@

Revision 1.34 / (download) - annotate - [select for diffs], Sat Oct 22 03:37:13 2016 UTC (7 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

string terminators are called NUL, not NULL

Revision 1.33 / (download) - annotate - [select for diffs], Sat Oct 22 03:34:32 2016 UTC (7 years, 7 months ago) by guenther
Branch: MAIN
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

Fix copy-pasto in comment; from Rob Pierce (rob (at) 2keys.ca)

Revision 1.32 / (download) - annotate - [select for diffs], Wed Apr 27 10:53:27 2016 UTC (8 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.31: +17 -29 lines
Diff to previous 1.31 (colored)

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.

Problem originally discovered and fix OK by stsp@.
eric@ agrees with the direction.

Revision 1.31 / (download) - annotate - [select for diffs], Sat Dec 5 19:10:19 2015 UTC (8 years, 6 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.30: +3 -4 lines
Diff to previous 1.30 (colored)

strings.h -> string.h to prevent an implicit declaration. Also removes
two NULL-checks before free().

Revision 1.30 / (download) - annotate - [select for diffs], Mon Apr 30 21:40:03 2012 UTC (12 years, 1 month ago) by jmatthew
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.29: +122 -12 lines
Diff to previous 1.29 (colored)

Use paged searches so we can handle larger directories.  Servers that don't
understand paging, such as ldapd(8), ignore it and return a single set of
results as before.
from Jim Smith, some tweaks and fixes by me, ok dlg@

Revision 1.29 / (download) - annotate - [select for diffs], Thu Mar 15 03:44:46 2012 UTC (12 years, 2 months ago) by jmatthew
Branch: MAIN
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

Accept empty/nonexistant ldap attributes when we want a list.  This allows
empty groups to show up, which is helpful if they're used as primary
groups.

ok dlg@

Revision 1.28 / (download) - annotate - [select for diffs], Sun Aug 28 16:37:28 2011 UTC (12 years, 9 months ago) by aschrijver
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.27: +17 -17 lines
Diff to previous 1.27 (colored)

Use the correct terminology, replace the term "entry" with the term "attribute" where applicable.

OK martinh@ pyr@

Revision 1.27 / (download) - annotate - [select for diffs], Wed Apr 6 11:36:26 2011 UTC (13 years, 2 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.26: +4 -4 lines
Diff to previous 1.26 (colored)

Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0'
for chars.

Revision 1.26 / (download) - annotate - [select for diffs], Wed Jul 21 17:32:12 2010 UTC (13 years, 10 months ago) by martinh
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.25: +4 -4 lines
Diff to previous 1.25 (colored)

Search filter BER tags use a context-specific class, not an application
class. This allows ypldap to talk to ldapd, which otherwise refuses the
search filter.

ok gilles@

Revision 1.25 / (download) - annotate - [select for diffs], Wed Jul 21 14:45:59 2010 UTC (13 years, 10 months ago) by gilles
Branch: MAIN
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored)

fix NULL-deref, ok martinh@

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jun 14 13:15:22 2010 UTC (13 years, 11 months ago) by pyr
Branch: MAIN
Changes since 1.23: +3 -2 lines
Diff to previous 1.23 (colored)

fix a memory leak, from aschrivjer

Revision 1.23 / (download) - annotate - [select for diffs], Wed Apr 28 10:05:28 2010 UTC (14 years, 1 month ago) by jasper
Branch: MAIN
Changes since 1.22: +3 -2 lines
Diff to previous 1.22 (colored)

- plug memleak (in #if 0'd code)

ok pyr@

Revision 1.22 / (download) - annotate - [select for diffs], Sun Feb 7 13:04:25 2010 UTC (14 years, 4 months ago) by blambert
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.21: +13 -12 lines
Diff to previous 1.21 (colored)

A few visual cleanups, and clarify a comment.

Also:

	for (i = 0; i >= 0 && foo; i++)

is functionally equivalent to:

	for (i = 0; foo; i++)

so use the clearer construct where appropriate.

ok pyr@

Revision 1.21 / (download) - annotate - [select for diffs], Sat Feb 6 08:04:45 2010 UTC (14 years, 4 months ago) by blambert
Branch: MAIN
Changes since 1.20: +42 -21 lines
Diff to previous 1.20 (colored)

Simplify LDAP URL handling (currently unused):
instead of strdup()'ing multiple values from an already strdup'ed
buffer (none of which were checked for NULL upon return, which is
also fixed in this), just use a buffer attached to the aldap_url
struct.

Add an aldap_search_url() function, which is a wrapper around
aldap_parse_url and aldap_search.

Finally, since the URL bits are unused, wrap them in #if 0 for now.

ok pyr@, whose heart was a little broken by the #if 0 (temporary, I swear!)

Revision 1.20 / (download) - annotate - [select for diffs], Wed Jul 8 13:13:17 2009 UTC (14 years, 11 months ago) by blambert
Branch: MAIN
Changes since 1.19: +9 -9 lines
Diff to previous 1.19 (colored)

Fix memory leak in sarch filter parsing code.

ok pyr@

Revision 1.19 / (download) - annotate - [select for diffs], Thu Jan 29 11:43:31 2009 UTC (15 years, 4 months ago) by aschrijver
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.18: +7 -2 lines
Diff to previous 1.18 (colored)



Make anonymous binds work properly.

Revision 1.18 / (download) - annotate - [select for diffs], Wed Jan 28 00:53:29 2009 UTC (15 years, 4 months ago) by aschrijver
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)



Correct dup to dupstr.

Revision 1.17 / (download) - annotate - [select for diffs], Tue Jan 27 16:17:49 2009 UTC (15 years, 4 months ago) by aschrijver
Branch: MAIN
Changes since 1.16: +100 -100 lines
Diff to previous 1.16 (colored)



Add space after keywords.

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jan 27 15:37:03 2009 UTC (15 years, 4 months ago) by aschrijver
Branch: MAIN
Changes since 1.15: +12 -10 lines
Diff to previous 1.15 (colored)



Oops, fix the error handling. Found by blambert@

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jan 27 13:24:25 2009 UTC (15 years, 4 months ago) by aschrijver
Branch: MAIN
Changes since 1.14: +3 -2 lines
Diff to previous 1.14 (colored)



Fix another double free in the filter parser.

Revision 1.14 / (download) - annotate - [select for diffs], Tue Jan 27 11:38:32 2009 UTC (15 years, 4 months ago) by aschrijver
Branch: MAIN
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)



Remove unnecessary comment.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Jan 27 11:33:22 2009 UTC (15 years, 4 months ago) by aschrijver
Branch: MAIN
Changes since 1.12: +32 -2 lines
Diff to previous 1.12 (colored)



Add correct error handling to the aldap API.
Use the error handling in the ldapclient.

with help from pyr@

Revision 1.12 / (download) - annotate - [select for diffs], Mon Jan 26 21:56:15 2009 UTC (15 years, 4 months ago) by pyr
Branch: MAIN
Changes since 1.11: +18 -5 lines
Diff to previous 1.11 (colored)

move aldap_close in aldap.c, where it belongs.
discussed with aschrijver@

Revision 1.11 / (download) - annotate - [select for diffs], Fri Jan 16 13:11:15 2009 UTC (15 years, 4 months ago) by aschrijver
Branch: MAIN
Changes since 1.10: +58 -23 lines
Diff to previous 1.10 (colored)



Fix double free with invalid ldap filter (reported by dlg@).
Fix more memory leaks.

Revision 1.10 / (download) - annotate - [select for diffs], Sun Jan 4 00:11:05 2009 UTC (15 years, 5 months ago) by aschrijver
Branch: MAIN
Changes since 1.9: +19 -16 lines
Diff to previous 1.9 (colored)



Fix memory leak (diff from blambert@)

Fix debug messages.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Dec 28 22:03:59 2008 UTC (15 years, 5 months ago) by blambert
Branch: MAIN
Changes since 1.8: +7 -5 lines
Diff to previous 1.8 (colored)

Plug some memory leakage in aldap_parse by calling aldap_freemsg
Let aldap_freemsg allow for a NULL ber_element tree, since it's now
possible to pass one in.

"looks fine to me :-)" aschrijver@

Revision 1.8 / (download) - annotate - [select for diffs], Sat Dec 27 19:46:12 2008 UTC (15 years, 5 months ago) by aschrijver
Branch: MAIN
Changes since 1.7: +8 -2 lines
Diff to previous 1.7 (colored)



Fix memory leak.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Nov 28 10:07:56 2008 UTC (15 years, 6 months ago) by aschrijver
Branch: MAIN
Changes since 1.6: +61 -10 lines
Diff to previous 1.6 (colored)

Add support for escaped characters to the search filter parsing function.

Revision 1.6 / (download) - annotate - [select for diffs], Tue Oct 28 13:47:22 2008 UTC (15 years, 7 months ago) by aschrijver
Branch: MAIN
Changes since 1.5: +23 -7 lines
Diff to previous 1.5 (colored)

Do the DNS resolution in a seperate process. A lot of code is copied from ntpd.
This is necessary because DNS resolution is not possible from a chroot.

Cleanup the aldap interface a bit.

Revision 1.5 / (download) - annotate - [select for diffs], Tue Oct 14 21:41:03 2008 UTC (15 years, 7 months ago) by aschrijver
Branch: MAIN
Changes since 1.4: +13 -8 lines
Diff to previous 1.4 (colored)

Add support for referrals and lists of attributes.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Oct 6 08:01:28 2008 UTC (15 years, 8 months ago) by aschrijver
Branch: MAIN
Changes since 1.3: +12 -8 lines
Diff to previous 1.3 (colored)

use strtonum() instead of atoi() and remove an unnecessary bzero()

ok pyr@

Revision 1.3 / (download) - annotate - [select for diffs], Thu Oct 2 15:24:14 2008 UTC (15 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +4 -6 lines
Diff to previous 1.2 (colored)

use calloc() instead of malloc() and bzero()

Revision 1.2 / (download) - annotate - [select for diffs], Tue Sep 30 17:31:04 2008 UTC (15 years, 8 months ago) by pyr
Branch: MAIN
Changes since 1.1: +5 -4 lines
Diff to previous 1.1 (colored)

fix ugly comments.

Revision 1.1 / (download) - annotate - [select for diffs], Tue Sep 30 16:24:16 2008 UTC (15 years, 8 months ago) by aschrijver
Branch: MAIN

aldap library -- Replacement for openldap used in ypldap. aldap is an semi-asynchronous client interface to connect to LDAP servers.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.