Commit Graph

42 Commits

Author SHA1 Message Date
lukem
c49e808721 #include "reentrant.h" instead of <threadlib.h> 2004-10-29 06:32:08 +00:00
christos
04562cac02 add a simple lock in _yp_check(), to make it re-entrant. 2004-05-27 18:41:11 +00:00
agc
7db1d33cba Modify the licences of code written by Theo De Raadt from a 4-clause
to a 2-clause licence (retaining UCB clauses (1) and (2)), per PR
22409 from Joel Baker, approved by Theo de Raadt, and ratified by
myself - the only discrepancy being the handling of the original
clause 3 in src/usr.sbin/yppoll/yppoll.c.
2003-12-10 12:06:25 +00:00
itojun
9134efabd0 use strlcpy where it is more appropriate. 2002-11-17 01:51:24 +00:00
thorpej
ff64706c9f Fix signed/unsigned comparison warnings. 2002-11-11 22:53:19 +00:00
christos
473ea2c4e7 add explicit casts to avoid parameter conversion warnings. 2000-07-06 03:14:05 +00:00
mycroft
605490369c Delint.
Remove trailing ; from uses of __weak_alias().  The macro inserts this if
needed.
2000-01-22 22:19:07 +00:00
lukem
d896261208 back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
1999-09-20 04:38:56 +00:00
lukem
b48252f365 * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
  and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

		_DIAGASSERT(path != NULL)
	#ifdef _DIAGNOSTIC
		if (path == NULL) {
			errno = EFAULT;
			return (-1);
		}
	#endif
1999-09-16 11:44:54 +00:00
christos
b2a14ab2d3 xdrproc_t casts 1999-01-31 20:46:12 +00:00
mycroft
780ffacdd8 Remove a little lint. 1998-07-27 12:29:21 +00:00
lukem
23d6c4fa54 Relax checks in _yp_invalid_domain(); yp domains don't have to be
RFC1035 compliant. Still ensure that the give domain isn't empty,
isn't too long, and isn't going to be a security problem.
1997-07-23 05:29:38 +00:00
jtc
43fa6fe319 If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore.  The library will use those
names internally.  Weak aliases are used to provide the original names
to the API.

This is only the first part of this change.  It is most of the functions
which are implemented in C for all NetBSD ports.  Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
1997-07-21 14:06:24 +00:00
christos
e7cc550330 Fix RCSID's
printf -> warnx
Fix gcc warnings
Put locally declared functions in local.h
1997-07-13 20:28:09 +00:00
lukem
42736edb4d * implement _yp_invalid_domain, which returns non-zero if the given
domainname isn't RFC1035 compliant. Also ensure that the length <=
  YPMAXDOMAIN (which is less than what RFC1035 allows).
* use _yp_invalid_domain in the public front-ends, instead of using
  hand-rolled checks
* fix a typo
1997-07-07 02:00:30 +00:00
mrg
9cd5492c02 - convert unsafe strcpy(), strcat() and sprintf() to the `n' versions.
- some KNF.
1997-01-23 14:01:45 +00:00
thorpej
ac6352fdc7 Use a different timeout for the underlying RPC transmission than the
upper-level YP call.  This allows the RPC code to retry the transaction,
which is helpful for busy networks.

Problem noted and suggested fix from Michael.Eriksson@era-t.ericsson.se,
and slightly modified by me to compute the RPC timeout one at compile-time,
rather than N times at run-time.

Fixes PR #3117.
1997-01-21 20:40:07 +00:00
christos
772697e293 Report yp errors every _yplib_nerrs like the other routines. 1996-12-24 15:08:39 +00:00
thorpej
7a26f6a8ac Pull down yp/xdr fixes from release branch. 1996-05-29 20:00:52 +00:00
christos
409a9590f3 Avoid using clnt_perror() on the first rpc failure, since it is going to be
retried anyway. Only report it every _yplib_nerrs times.
1996-05-23 13:48:59 +00:00
jtc
76bf46a33e Split yp_first, yp_next, yp_maplist and yperr_prot out of yplib.c.
Use a constant struct timeval for yp timeouts instead of creating
a new struct timeval in each yp function at runtime.
1996-05-18 18:43:24 +00:00
jtc
5d8adb683d Split yperr_match out of yplib.c; makes many static executables a bit smaller. 1996-05-15 05:27:50 +00:00
jtc
7808771d84 Split yp_all, yp_master, and yp_other out of yplib.c; makes some static
executables a bit smaller.
1996-05-14 23:37:27 +00:00
jtc
3b32f2c7c0 Split yperr_string out of yplib.c; makes many static executables a bit smaller. 1996-05-14 13:36:49 +00:00
christos
c1a26f1198 Fix PR/2348: infinite loop when RPC_PROCUNAVAIL 1996-05-09 22:52:24 +00:00
jtc
6bb5d0a08c Change conditionals around RCS IDs to be like rest of libc.
From John Birrell <jb@cimlogic.com.au>.
1996-02-04 23:26:21 +00:00
christos
a667b8f7d4 - Const poisoning
- KNF police
- Detect malloc failures
1995-07-14 21:04:17 +00:00
mycroft
5860921eda Fill in sin_len. 1995-06-03 22:37:19 +00:00
cgd
693e99f736 clean up Ids 1995-02-27 12:54:33 +00:00
deraadt
d87a87c753 check for ypbind.lock file, which indicates yp is alive. 1994-09-28 01:38:06 +00:00
deraadt
432a32dc33 don't print a "not responding" message for first failure. 1994-09-20 07:20:36 +00:00
deraadt
9de7a8a1d8 If the binding file doesn't exist, we need to try RPC to ypbind
to wake it up. This probably fixes my problem with amd.
1994-09-18 02:56:00 +00:00
mycroft
465a1c6bc1 Kill some totally minor ugliness that crept in. 1994-08-18 00:45:07 +00:00
jtc
fac4c46f81 Post 1.0 cleanup:
* Include appropriate header files to bring prototypes into scope.
 * bcopy -> memcpy
 * bzero -> memset
 * bcmp  -> memcmp
 * Tweak yp xdr routines so compiler can do a better job --- saves
   at least 5 instructions per function call on the i386.
1994-08-06 23:07:47 +00:00
deraadt
3bf2b62f1f correct copyright 1994-05-25 09:52:05 +00:00
deraadt
66cf56ad97 sunos compatible /var/yp/binding/ files.
fix const warning
1993-12-03 10:10:21 +00:00
jtc
9c20f740a3 Declare rcsid strings so they are stored in text segment. 1993-08-26 00:43:03 +00:00
deraadt
80795f5a8e new header files are more ansi-like 1993-07-24 18:29:16 +00:00
deraadt
ef08b20d7a a few typecasts because of the new prototypes 1993-06-12 19:46:31 +00:00
deraadt
77c037ed51 added my copyright.. how self efacing of me 1993-05-16 02:47:20 +00:00
deraadt
7ca353ff8d YP functions are always in libc. They just might not be called by getpwent()
and friends.
1993-04-27 02:14:43 +00:00
deraadt
42d384ba4c parts of YP inside libc.. 1993-04-26 08:23:39 +00:00