Commit Graph

38 Commits

Author SHA1 Message Date
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
lukem
326483c4de change getgrent() backends so that a flag (per source) is set once the
source has been exhausted. this allows getgrent() across multiple
sources (e.g, ``group: files nis'') to work correctly. the flags are
reset in setgrent()/endgrent().

(as per similar change in getpwent.c rev 1.42)

XXX: this change means that code that uses getgrent() to obtain a list
of groups will have to do duplicate suppression... getgrouplist()
springs to mind; i'm about to modify that
1999-04-25 13:39:41 +00:00
lukem
73e9ef01be specifically include stdarg/varargs.h 1999-04-18 02:04:04 +00:00
lukem
7f1c203c11 always compile in support for `compat' backends (even if !YP & !HESIOD),
and make it the responsibility of the backends to fallback to `files'
if !YP & !HESIOD. fixes chsh problem noted by billc@netbsd.org.
1999-01-26 01:08:06 +00:00
lukem
147dea105a convert from hes_*() -> hesiod_*() 1999-01-25 01:09:34 +00:00
lukem
40901ecd3c nsdispatch defaults now: "group: compat", "group_compat: nis" 1999-01-20 02:59:37 +00:00
lukem
b247a8eceb * passwd' defaults to compat', and passwd_compat' defaults to nis'
* constify ns_dtab defs
1999-01-19 08:30:46 +00:00
lukem
6a471ed8f9 convert to new nsdispatch(3) 1999-01-19 08:07:58 +00:00
christos
6304dadc4d delint 1999-01-18 20:36:32 +00:00
lukem
e50f4e6efc fix some gid casts 1999-01-16 14:44:33 +00:00
lukem
0eb8645e3a pull nsswitch up to main branch 1999-01-16 07:47:18 +00:00
perry
98b9f211ee fix bcopy->memcpy with memcpy->memmove -- not strictly needed, but... 1998-08-26 00:38:39 +00:00
perry
a843f0f8a5 bzero->memset, bcopy->memcpy, bcmp->memcmp 1998-08-10 02:43:08 +00:00
mycroft
131e747015 Make these compile without __AUDIT__. 1998-07-27 09:47:44 +00:00
mycroft
e5d9823796 const poisoning. 1998-07-26 19:05:06 +00:00
perry
1f95191dfb trivial changes to reduce lint complaints 1998-02-26 03:01:12 +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
11cac2080a Add missing prototypes
Fix RCSID's
Fix gcc warnings
1997-07-13 19:01:22 +00:00
lukem
76c3314d9b a valid uid/gid *ends* in \0 (i.e, barf if (*ep != '\0'), not if (*ep == '\0')) 1997-05-22 10:38:07 +00:00
lukem
50820e9b86 * parse gid with strtoul() instead of atoi(), and sanity check a) the parsed
value was just a number, b) it doesn't exceed GID_MAX
* convert gid to a string with %u not %d
* use [gu]id_t instead of int
1997-05-22 03:24:37 +00:00
lukem
8041f4f4ab fix potential memory leaks: before calling yp_next(), reset key to NULL. if
an error occurred, and key != NULL, free(key).
1997-05-21 01:51:39 +00:00
lukem
27d1a6365b * ensure that "outdata" values to various yp_xxx() functions are set
to the null pointer before invocation, so that the test in the
  error case of "if (outdata != NULL) free(outdata)" won't potentially
  try and free memory that wasn't malloc()ed.
* factor some duplicated code out of both parts of an "if {} else {}"
  construct.
* remove use of `register' & KNFify.
1997-05-20 15:46:03 +00:00
thorpej
30ec3e8a63 Don't transfer the entire YP database using yp_{first,next}(); instead
use yp_match(), which is much more efficient.

From Michael.Eriksson@era-t.ericsson.se, PR #3114.
1997-01-22 01:21:06 +00:00
cgd
7edc9015ae grscan()'s last arg has to be a const char *, not just a char * 1996-12-20 19:38:16 +00:00
phil
e69d413643 Improvements to YP support from Jason Downs. 1995-07-28 05:43:01 +00:00
pk
a63744d63c Speed up getgrnam() and getgrpid() by using yp_match(). 1995-03-16 11:48:01 +00:00
cgd
b585e843ca update from Lite, with local changes. fix Ids, etc. 1995-02-27 04:12:15 +00:00
deraadt
8b4fd14bfb be lenient; let a few other forms of + activate YP 1994-08-02 05:15:25 +00:00
deraadt
02fe919c29 avoid core dump 1994-07-29 18:54:17 +00:00
deraadt
46703c8a4d better, more forgiving solution to previous problem. 1994-03-07 00:58:10 +00:00
deraadt
90250ee80b fix small obscure YP buglet, and properly terminate gr_mem 1994-03-06 09:04:11 +00:00
jtc
9bd83209f0 Change C library functions to use strchr() and strrchr() instead of index()
and rindex().  This will allow (strict {ANSI, POSIX, XOPEN}) applications
to redefine index() and rindex() without effecting the library internals.
1993-11-24 19:43:49 +00:00
jtc
71afdb430b Update source and manual pages to match X/Open 1170 specification.
Updated setpassent() to understand YP (a bug), and changed setpwent()
to simply be a call to setpassent(0) (to remove duplicated code).
1993-10-25 23:36:51 +00:00
jtc
9c20f740a3 Declare rcsid strings so they are stored in text segment. 1993-08-26 00:43:03 +00:00
mycroft
f23f94cb77 Add even more RCS frobs. 1993-07-30 08:21:41 +00:00
deraadt
3cbc24e4f9 I was horrified to find these had not been commited with the YP changes. 1993-05-04 05:10:45 +00:00
cgd
61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00