History log of /openbsd-current/usr.sbin/ypserv/ypserv/ypserv_db.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.32 09-Oct-2021 deraadt

delete unneccessary arpa/nameser.h includes
ok millert


Revision tags: OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.31 03-Jul-2019 deraadt

snprintf/vsnprintf return < 0 on error, rather than -1.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.30 08-Dec-2015 mmcc

Remove NULL-checks before free().


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.29 16-Jan-2015 deraadt

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.28 05-Dec-2013 jca

In lookup_host(), return to caller a properly calculated message length
instead of using an uninitialized variable. While here, simplify the
code that calculates the message length, and use snprintf/strlcat more
carefully. ok millert@


# 1.27 04-Dec-2013 krw

opt_map CIRCLEQ -> TAILQ.

ok jsing@ (with nit), jca@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.26 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.25 29-May-2007 maja

Remove clause 3 and 4. Ok with Chuck. -moj


# 1.24 27-May-2007 pyr

use macros from sys/queue.h
ok otto@


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.23 03-Apr-2006 deraadt

spreading the lint love (very minimal things..)


Revision tags: OPENBSD_3_9_BASE
# 1.22 21-Dec-2005 millert

Userland programs should include <errno.h> not <sys/errno.h>
OK deraadt@


# 1.21 15-Oct-2005 otto

Use queue macros instead of directly accessing fields. ok miod@ pat@ millert@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.20 15-Jul-2003 deraadt

protos and repairs


# 1.19 05-May-2003 avsm

-Wall cleanup: trim unused vars, better err() message in stdhosts,
and constify rcsid[]

deraadt@ ok


# 1.18 05-Apr-2003 avsm

simplify a loop, convert it to strlcat; tedu@ ok


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.17 19-Jul-2002 deraadt

4344 lines of KNF diff


Revision tags: OPENBSD_3_1_BASE
# 1.16 19-Nov-2001 deraadt

use a private svc_run() function that checks for a signal handler flag;
now signal safe. Also, massive KNF.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.15 11-Jan-2001 deraadt

indent


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.14 08-Jan-1998 maja

Fix some problems with xfr of secure maps. Problem reported by
Eric Rungi <rungus@openface.org> -moj


Revision tags: OPENBSD_2_2_BASE
# 1.13 09-Aug-1997 maja

Increased performance in ypserv by two different actions:

1) ypdb_open_db now check error condition when something goes wrong.
Instead of always as before. by request of theo.

2) turned on -DOPTDB in Makefile. This will cause ypserv to keep databases
opened. If not defined ypserv will open and close the map for every
request. I think it was turned off before when yppush didn't work.

If a map changes yppush will signal to ypserv that the map has changed
and ypserv will reopen the map.

ypserv will start closing maps when it run out of file descriptors. Then
it will close the map least resent used.

-moj


Revision tags: OPENBSD_2_1_BASE
# 1.12 01-May-1997 niklas

Umm, fix signedness error in my last commit, be explicit
about the fact that ordernumbers are 32 bit


# 1.11 12-Apr-1997 deraadt

careful about bad domain/mapnames


# 1.10 11-Mar-1997 maja

Now with support for "secure" maps a'la FreeBSD. Support exists in makedbm
and ypxfrd since dawn of time. Support is missing in YP-makefile and in
libc. I have the changes for YP-makefile to support master.passwd but since
the support is missing in libc I will not commit them yet. -moj


# 1.9 02-Dec-1996 deraadt

bail nice


# 1.8 11-Nov-1996 niklas

plug db descriptor leak


Revision tags: OPENBSD_2_0_BASE
# 1.7 29-Sep-1996 dm

Fix hostname lookups (improper use of strncpy).


# 1.6 27-Jun-1996 deraadt

for DNS hosts.byname queries, supply all addresses


# 1.5 26-Jun-1996 maja

Same copyright all over, removed my name from ypdb.[ch], small bugfix
in ypserv_db.c /moj


# 1.4 30-May-1996 deraadt

$OpenBSD$ tag and few spelling errors


# 1.3 30-May-1996 deraadt

force gethostby{name,addr} to use bind (really ugly & trivial hack)


# 1.2 20-Jan-1996 chuck

major cleanup by Chuck Cranor
- use queue.h rather than do by hand
- fix up logging to use new yplog
- fix a few off by one errors
- don't double malloc the DBM structure
- avoid possible sprintf buffer overflows
- random code cleanup


# 1.1 01-Nov-1995 deraadt

+ full set of ypserv tools that compile


# 1.31 03-Jul-2019 deraadt

snprintf/vsnprintf return < 0 on error, rather than -1.


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.30 08-Dec-2015 mmcc

Remove NULL-checks before free().


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.29 16-Jan-2015 deraadt

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.28 05-Dec-2013 jca

In lookup_host(), return to caller a properly calculated message length
instead of using an uninitialized variable. While here, simplify the
code that calculates the message length, and use snprintf/strlcat more
carefully. ok millert@


# 1.27 04-Dec-2013 krw

opt_map CIRCLEQ -> TAILQ.

ok jsing@ (with nit), jca@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.26 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.25 29-May-2007 maja

Remove clause 3 and 4. Ok with Chuck. -moj


# 1.24 27-May-2007 pyr

use macros from sys/queue.h
ok otto@


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.23 03-Apr-2006 deraadt

spreading the lint love (very minimal things..)


Revision tags: OPENBSD_3_9_BASE
# 1.22 21-Dec-2005 millert

Userland programs should include <errno.h> not <sys/errno.h>
OK deraadt@


# 1.21 15-Oct-2005 otto

Use queue macros instead of directly accessing fields. ok miod@ pat@ millert@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.20 15-Jul-2003 deraadt

protos and repairs


# 1.19 05-May-2003 avsm

-Wall cleanup: trim unused vars, better err() message in stdhosts,
and constify rcsid[]

deraadt@ ok


# 1.18 05-Apr-2003 avsm

simplify a loop, convert it to strlcat; tedu@ ok


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.17 19-Jul-2002 deraadt

4344 lines of KNF diff


Revision tags: OPENBSD_3_1_BASE
# 1.16 19-Nov-2001 deraadt

use a private svc_run() function that checks for a signal handler flag;
now signal safe. Also, massive KNF.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.15 11-Jan-2001 deraadt

indent


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.14 08-Jan-1998 maja

Fix some problems with xfr of secure maps. Problem reported by
Eric Rungi <rungus@openface.org> -moj


Revision tags: OPENBSD_2_2_BASE
# 1.13 09-Aug-1997 maja

Increased performance in ypserv by two different actions:

1) ypdb_open_db now check error condition when something goes wrong.
Instead of always as before. by request of theo.

2) turned on -DOPTDB in Makefile. This will cause ypserv to keep databases
opened. If not defined ypserv will open and close the map for every
request. I think it was turned off before when yppush didn't work.

If a map changes yppush will signal to ypserv that the map has changed
and ypserv will reopen the map.

ypserv will start closing maps when it run out of file descriptors. Then
it will close the map least resent used.

-moj


Revision tags: OPENBSD_2_1_BASE
# 1.12 01-May-1997 niklas

Umm, fix signedness error in my last commit, be explicit
about the fact that ordernumbers are 32 bit


# 1.11 12-Apr-1997 deraadt

careful about bad domain/mapnames


# 1.10 11-Mar-1997 maja

Now with support for "secure" maps a'la FreeBSD. Support exists in makedbm
and ypxfrd since dawn of time. Support is missing in YP-makefile and in
libc. I have the changes for YP-makefile to support master.passwd but since
the support is missing in libc I will not commit them yet. -moj


# 1.9 02-Dec-1996 deraadt

bail nice


# 1.8 11-Nov-1996 niklas

plug db descriptor leak


Revision tags: OPENBSD_2_0_BASE
# 1.7 29-Sep-1996 dm

Fix hostname lookups (improper use of strncpy).


# 1.6 27-Jun-1996 deraadt

for DNS hosts.byname queries, supply all addresses


# 1.5 26-Jun-1996 maja

Same copyright all over, removed my name from ypdb.[ch], small bugfix
in ypserv_db.c /moj


# 1.4 30-May-1996 deraadt

$OpenBSD$ tag and few spelling errors


# 1.3 30-May-1996 deraadt

force gethostby{name,addr} to use bind (really ugly & trivial hack)


# 1.2 20-Jan-1996 chuck

major cleanup by Chuck Cranor
- use queue.h rather than do by hand
- fix up logging to use new yplog
- fix a few off by one errors
- don't double malloc the DBM structure
- avoid possible sprintf buffer overflows
- random code cleanup


# 1.1 01-Nov-1995 deraadt

+ full set of ypserv tools that compile


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.30 08-Dec-2015 mmcc

Remove NULL-checks before free().


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.29 16-Jan-2015 deraadt

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.28 05-Dec-2013 jca

In lookup_host(), return to caller a properly calculated message length
instead of using an uninitialized variable. While here, simplify the
code that calculates the message length, and use snprintf/strlcat more
carefully. ok millert@


# 1.27 04-Dec-2013 krw

opt_map CIRCLEQ -> TAILQ.

ok jsing@ (with nit), jca@


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.26 27-Oct-2009 deraadt

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms


Revision tags: OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.25 29-May-2007 maja

Remove clause 3 and 4. Ok with Chuck. -moj


# 1.24 27-May-2007 pyr

use macros from sys/queue.h
ok otto@


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.23 03-Apr-2006 deraadt

spreading the lint love (very minimal things..)


Revision tags: OPENBSD_3_9_BASE
# 1.22 21-Dec-2005 millert

Userland programs should include <errno.h> not <sys/errno.h>
OK deraadt@


# 1.21 15-Oct-2005 otto

Use queue macros instead of directly accessing fields. ok miod@ pat@ millert@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
# 1.20 15-Jul-2003 deraadt

protos and repairs


# 1.19 05-May-2003 avsm

-Wall cleanup: trim unused vars, better err() message in stdhosts,
and constify rcsid[]

deraadt@ ok


# 1.18 05-Apr-2003 avsm

simplify a loop, convert it to strlcat; tedu@ ok


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.17 19-Jul-2002 deraadt

4344 lines of KNF diff


Revision tags: OPENBSD_3_1_BASE
# 1.16 19-Nov-2001 deraadt

use a private svc_run() function that checks for a signal handler flag;
now signal safe. Also, massive KNF.


Revision tags: OPENBSD_2_9_BASE OPENBSD_3_0_BASE
# 1.15 11-Jan-2001 deraadt

indent


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.14 08-Jan-1998 maja

Fix some problems with xfr of secure maps. Problem reported by
Eric Rungi <rungus@openface.org> -moj


Revision tags: OPENBSD_2_2_BASE
# 1.13 09-Aug-1997 maja

Increased performance in ypserv by two different actions:

1) ypdb_open_db now check error condition when something goes wrong.
Instead of always as before. by request of theo.

2) turned on -DOPTDB in Makefile. This will cause ypserv to keep databases
opened. If not defined ypserv will open and close the map for every
request. I think it was turned off before when yppush didn't work.

If a map changes yppush will signal to ypserv that the map has changed
and ypserv will reopen the map.

ypserv will start closing maps when it run out of file descriptors. Then
it will close the map least resent used.

-moj


Revision tags: OPENBSD_2_1_BASE
# 1.12 01-May-1997 niklas

Umm, fix signedness error in my last commit, be explicit
about the fact that ordernumbers are 32 bit


# 1.11 12-Apr-1997 deraadt

careful about bad domain/mapnames


# 1.10 11-Mar-1997 maja

Now with support for "secure" maps a'la FreeBSD. Support exists in makedbm
and ypxfrd since dawn of time. Support is missing in YP-makefile and in
libc. I have the changes for YP-makefile to support master.passwd but since
the support is missing in libc I will not commit them yet. -moj


# 1.9 02-Dec-1996 deraadt

bail nice


# 1.8 11-Nov-1996 niklas

plug db descriptor leak


Revision tags: OPENBSD_2_0_BASE
# 1.7 29-Sep-1996 dm

Fix hostname lookups (improper use of strncpy).


# 1.6 27-Jun-1996 deraadt

for DNS hosts.byname queries, supply all addresses


# 1.5 26-Jun-1996 maja

Same copyright all over, removed my name from ypdb.[ch], small bugfix
in ypserv_db.c /moj


# 1.4 30-May-1996 deraadt

$OpenBSD$ tag and few spelling errors


# 1.3 30-May-1996 deraadt

force gethostby{name,addr} to use bind (really ugly & trivial hack)


# 1.2 20-Jan-1996 chuck

major cleanup by Chuck Cranor
- use queue.h rather than do by hand
- fix up logging to use new yplog
- fix a few off by one errors
- don't double malloc the DBM structure
- avoid possible sprintf buffer overflows
- random code cleanup


# 1.1 01-Nov-1995 deraadt

+ full set of ypserv tools that compile