Commit Graph

55 Commits

Author SHA1 Message Date
jtc c8f77c0b8b Fix tipo inherited from old version of TNF copyright template. 1997-10-09 07:25:45 +00:00
jtc 990a11b9c6 Fix files using old TNF copyright notice 1997-07-30 23:53:32 +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
lukem db4fd8d56f Don't return allocated memory in an error condition in a char **outXXX argument
(set them to the null pointer instead).
Thus, code that doesn't specificallly attempt to clean up allocated
memory after an error result is returned from yp_...() won't have an
unexpected memory leak (i.e, most 3rd party code)
1997-05-21 06:55:25 +00:00
lukem 220410601a yp_match() should return errors of the form YPERR_xxx not RPC_xxx.
return YPERR_RESRC instead of RPC_SYSTEMERROR
1997-05-21 01:48:46 +00:00
lukem 301e6e6c32 Some cleanups for [lib/3655]
* Ensure that all 'char **outXXX' pointers aren't the null pointer before use.
* Set *outXXX=NULL before checking any other arguments.
* Document that *outXXX will always be NULL or a malloc(3)ed string
  unless outXXX was NULL (in which case YPERR_BADARGS will be returned
  and the caller shouldn't attempt to free(*outXXX) if *outXXX != NULL;

These changes should prevent most occurances of coredumps when a bad
argument was given to a yp client function and the caller attempts to
free an outvalue that isn't the null pointer. To be really safe, the
caller probably should set the *outvalue=NULL anyway (ref: PR [lib/3580])
1997-05-20 15:25:38 +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
chuck 3dc0d5258f fix xdr_ypmap_parms (missing "&"'s in calls to xdr_ypdomain_wrap_string
and xdr_ypmap_wrap_string).   prevents segv in ypserv.
1996-08-15 21:43:03 +00:00
thorpej bb516fa80e Fix some potential type-size problems. 1996-08-09 10:06:02 +00:00
christos 1d4349e7c8 ypset(8) stopped working; reason:
xdr_ypbind_setdom() would always fail because the test for
xdr_ypdomain_wrap_string() was reversed. Fixed this and in
the process made all the function tests to be of the form:

	if (!xdr_foo())
		return FALSE;
	....
	return TRUE;

instead of having some of them like above and others like:
	if (xdr_foo() == FALSE)
		return FALSE;
	...

	return xdr_bar();

this is more consistant now and hopefully in the future people
will pattern match correctly and not introduce spurious errors.
1996-06-18 20:05:59 +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
cgd 64331ae191 these files all need to include <string.h> 1996-05-20 15:17:31 +00:00
jtc 159bafea3c Split yp_first, yp_next, yp_maplist and yperr_prot out of yplib.c. 1996-05-18 19:06:39 +00:00
jtc 2039c263f3 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.
Check arguments and return YPERR_BADARGS if invalid.
1996-05-18 19:03:45 +00:00
jtc 0724069f60 Use a constant struct timeval for yp timeouts instead of creating
a new struct timeval in each yp function at runtime.
Check arguments and return YPERR_BADARGS if invalid.
1996-05-18 19:01:19 +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
thorpej 0ffa7d7b3c Copyright assigned to The NetBSD Foundation. 1996-02-28 00:47:42 +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
thorpej 60f8dae203 Add the manual page links suggested my Luke Mewburn in PR 1449. This
is consistent with at least 2 other operating systems with YP subsystems.
1995-09-12 19:40:27 +00:00
thorpej 84b1a32da6 Fix typo pointed out by Luke Mewburn in PR 1449. Kill duplicate RCS id. 1995-09-12 19:33:03 +00:00
thorpej 110b961e86 Change a few bogus instances of ';' to the syntactically correct ','. 1995-08-11 01:10: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
cgd ae9172d6cd specify man pages the new way. 1994-12-22 09:57:51 +00:00
deraadt ce0ad41a78 man page from Jason Thorpe 1994-10-28 23:03:02 +00:00
deraadt 17595b3407 man page from Jason Thorpe 1994-10-28 16:46:57 +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
cgd 0ada107897 update for .S and MACHINE_ARCH 1993-12-04 02:33:35 +00:00
deraadt 66cf56ad97 sunos compatible /var/yp/binding/ files.
fix const warning
1993-12-03 10:10:21 +00:00
cgd 0b9f50897e make an arch directory in libc, and move all machine dirs into it 1993-10-07 00:17:24 +00:00
jtc 9c20f740a3 Declare rcsid strings so they are stored in text segment. 1993-08-26 00:43:03 +00:00
mycroft cda4f8f6ee Add RCS identifiers. 1993-08-01 05:37:30 +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