#
b5acd001 |
| 15-Sep-1998 |
Dmitrij Tejblum <dt@FreeBSD.org> |
Don't initialize NIS until it is really necessary. Now, in case of network or NIS server problems, local user can login without a pause.
Also, -Wsomething cleanup.
|
Revision tags: release/2.2.7, release/2.2.6 |
|
#
2e645a20 |
| 01-Feb-1998 |
Steve Price <steve@FreeBSD.org> |
XOpen says the void setpwent(void) is correct. Also call setpassent(0) instead of duplicating code, albeit trivial (inspired by NetBSD).
PR: 5524
|
Revision tags: release/2.2.5_cvs |
|
#
d030d2d2 |
| 18-Sep-1997 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Many places in the code NULL is used in integer context, where plain 0 should be used. This happens to work because we #define NULL to 0, but is stylistically wrong and can cause problems for people
Many places in the code NULL is used in integer context, where plain 0 should be used. This happens to work because we #define NULL to 0, but is stylistically wrong and can cause problems for people trying to port bits of code to other environments.
PR: 2752 Submitted by: Arne Henrik Juul <arnej@imf.unit.no>
show more ...
|
#
211fed7e |
| 15-Sep-1997 |
Wolfram Schneider <wosch@FreeBSD.org> |
Fix yet a minor stylistic nit from Bruce. (`cvs diff -ib' print one new char ;-).
|
#
8be26e5d |
| 14-Sep-1997 |
Wolfram Schneider <wosch@FreeBSD.org> |
Potential bufferflow in getpwent(), getpwnam() and getpwuid()
PR: bin/4134 Submitted by: nick@foobar.org
|
Revision tags: release/2.2.2_cvs, release/2.2.1_cvs |
|
#
c333ae82 |
| 26-Mar-1997 |
David Nugent <davidn@FreeBSD.org> |
Remove minor warning (for -Wall -Wshadow); clarifies code.
|
Revision tags: release/2.2.0 |
|
#
adf6ad9e |
| 11-Mar-1997 |
Peter Wemm <peter@FreeBSD.org> |
Merge from Lite2: filesystem include updates, duplicate group suppression, cleanups, filesystem whiteout support (unionfs), bidir popen().
|
#
662909a7 |
| 11-Mar-1997 |
Peter Wemm <peter@FreeBSD.org> |
Import CSRG 4.4BSD-Lite2 lib/libc onto vendor branch
|
Revision tags: release/2.1.7_cvs |
|
#
09e84628 |
| 10-Mar-1997 |
Bill Paul <wpaul@FreeBSD.org> |
Fix brain-o in SunOS passwd.adjunct stuff: !strstr(s, "##") is a) bad style and b) the wrong logic. Should be strstr(s, "##") != NULL. (Note that the passwd.adjunct stuff has not been merged into 2.2
Fix brain-o in SunOS passwd.adjunct stuff: !strstr(s, "##") is a) bad style and b) the wrong logic. Should be strstr(s, "##") != NULL. (Note that the passwd.adjunct stuff has not been merged into 2.2 so this bug is not in that branch.)
show more ...
|
Revision tags: release/2.1.6_cvs, release/2.1.6.1 |
|
#
1d2493ff |
| 27-Dec-1996 |
Bill Paul <wpaul@FreeBSD.org> |
Small yet significant tweaks/cleanups:
- getpwent: o adjunctbuf should be NUL terminated after copying o _pw_breakout_yp() needs to know the length of the buffer returned from YP so it can p
Small yet significant tweaks/cleanups:
- getpwent: o adjunctbuf should be NUL terminated after copying o _pw_breakout_yp() needs to know the length of the buffer returned from YP so it can properly NUL terminate its local buffer.
- getgrent: o YP buffers should be YPMAXRECORD + 2 bytes long and NUL terminated. (Previously they were hardcoded to 1024 bytes.)
- getnetgrent: o YP data should be copied with snprintf(), not sprintf()
These are 2.2 candidates. I will wait a few days to make sure these don't break anything and then, if there are no objections, move them to the 2.2 branch.
show more ...
|
#
2be5d4cb |
| 03-Dec-1996 |
Bill Paul <wpaul@FreeBSD.org> |
Add support for detecting and hopefully using the passwd.adjunct.byname NIS map which is present on SunOS NIS servers with the SunOS C2 security hack^Woption installed. I'm convinced that the C2 secu
Add support for detecting and hopefully using the passwd.adjunct.byname NIS map which is present on SunOS NIS servers with the SunOS C2 security hack^Woption installed. I'm convinced that the C2 security option restricts access to the passwd.adjunct.byname map in the same way that I restrict access to the master.passwd.{byname,buid} maps (checking for reserved ports), which means that we should be able to handle passwd.adjunct.byname map correctly.
If _havemaster() doesn't find a master.passwd.byname map, it will now test for a passwd.adjunct.byname map before defaulting back to the standard non-shadowed passwd.{byname,byuid} maps. If _pw_breakout_yp() sees that the adjunct map was found and the password from the standard maps starts with ##, it will try to grab the correct password field from the adjunct map. As with the master.passwd maps, this only happens if the caller is root, so the shadowing feature is preserved; non-root users just get back ##username as the encrypted password.
Note that all we do is grab the second field from the passwd.adjunct.byname entry, which is designated to be the real encrypted password. There are other auditing fields in the entry but they aren't of much use to us.
Also switched back to using yp_order() to probe for the maps (instead of yp_first()). The original problem with yp_order() was that it barfed with NIS+ servers in YP compat mode since they don't support the YPPROC_ORDER procedure. This condition is handled a bit more gracefully in yplib now: we can detect the error and just punt on the probing.
show more ...
|
Revision tags: release/2.1.5_cvs |
|
#
51295a4d |
| 12-Jul-1996 |
Jordan K. Hubbard <jkh@FreeBSD.org> |
General -Wall warning cleanup, part I. Submitted-By: Kent Vander Velden <graphix@iastate.edu>
|
#
03cee47d |
| 07-May-1996 |
Bill Paul <wpaul@FreeBSD.org> |
Grrrr... yet another variation on Murphy's Law: the best way to find bugs in your code is to put it in the -stable branch. (Corollary: the day you discover the bug is the day the Internet decides to
Grrrr... yet another variation on Murphy's Law: the best way to find bugs in your code is to put it in the -stable branch. (Corollary: the day you discover the bug is the day the Internet decides to route your telnet session to the repository box via Zimbabwe.)
Remove one bogus free(result) (from _havemaster()) that slipped by me.
Flagged by: phkmalloc Pointed out to me by: Stefan Esser
show more ...
|
#
88ce2dd1 |
| 29-Apr-1996 |
Bill Paul <wpaul@FreeBSD.org> |
Very minor tweak:
In __initdb(), a failure to open the local password database is supposed to result in a warning message being syslog()ed. This warning is only supposed to be generated as long as t
Very minor tweak:
In __initdb(), a failure to open the local password database is supposed to result in a warning message being syslog()ed. This warning is only supposed to be generated as long as the 'warned' flag hasn't been yet; once the warning is generated, the flag should be set so that the message is only syslog()ed once. However, while the state of the flag is checked properly, the flag's state is never changed, so you always get multiple warnings instead of just one.
Pointed out by: Peter Wemm
show more ...
|
#
94c53e1f |
| 16-Apr-1996 |
Bill Paul <wpaul@FreeBSD.org> |
NIS cleanups and fixes, the next generation.
getnetgrent.c:
- Catch one bogon that snuck by: in _listmatch(), check for '\0' rather than '\n'; strings returned from yp_match() are terminated wi
NIS cleanups and fixes, the next generation.
getnetgrent.c:
- Catch one bogon that snuck by: in _listmatch(), check for '\0' rather than '\n'; strings returned from yp_match() are terminated with a nul, not a newline.
getpwent.c:
- Rip out all of the +inclusion/-exclusion stuff from before and replace it with something a little less grotty. The main problem with the old mechanism was that it wasted many cycles processing NIS entries even after it already knew they were to be exlcuded (or not included, depending on your pointof view). The highlights of these changes include:
o Uses an in-memory hash database table to keep track of all the -@netgroup, -user, and -@group exclusions.
o Tries harder to duplicate the behavior normally obtained when using NIS inclusions/exclusions on a flat /etc/passwd file (meaning things come out in much the same order).
o Uses seperate methods for handling getpwent() and getpwnam()/getpwuid() operations instead of trying to do everything with one general function, which didn't work as well as I thought it would.
o Uses both getnetgrent() and innetgr() to try to save time where possible.
o Use only one special token in the local password database (_PW_KEYYPBYNUM) instead of seperate tokens to mark + and - entries (and stop using the counter tokens too). If this new token doesn't exist, the code will make due with the standard _PW_KEYBYNUM token in order to support older databases that won't have the new token in them.
All this is an attempt to make this stuff work better in environments with large NIS passwd databases.
show more ...
|
#
70520b51 |
| 29-Jan-1996 |
Mike Pritchard <mpp@FreeBSD.org> |
Getpwent() and getservent() can wind up calling free() with an invalid pointer if a call to yp_first() fails. Closes PR # 964, and possibly # 952.
|
Revision tags: release/2.1.0_cvs |
|
#
8b102407 |
| 22-Oct-1995 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Minor cleanup, mostly unused vars and missing #includes.
|
#
3948edc2 |
| 11-Oct-1995 |
Bill Paul <wpaul@FreeBSD.org> |
Another tweak/speedup pass:
- Fix buffer overflow problem once and for all: do away with the buffer copies to 'user' prior to calling _scancaches() and just pass a pointer to the buffer returned
Another tweak/speedup pass:
- Fix buffer overflow problem once and for all: do away with the buffer copies to 'user' prior to calling _scancaches() and just pass a pointer to the buffer returned by yp_match()/yp_first()/yp_next()/whatever. (We turn the first ':' to a NUL first so strcmp() works, then change it back later. Submitted by Bill Fenner <fenner@parc.xerox.com> and tweaked slightly by me.
- Give _pw_breakout_yp() the 'more elegant solution' I promised way back when. Eliminate several copies to static buffers and replace them with just one copy. (The buffer returned by the NIS functions is at most YPMAXRECORD bytes long, so we should only need one static buffer of the same length (plus 2 for paranoia's sake).)
- Also in _pw_breakout_yp(): always set pw.pw_passwd to the username obtained via NIS regardless of what pw_fields says: usernames cannot be overridden so we have no choice but to use the name returned by NIS.
- _Again_ in _pw_breakout_yp(): before doing anything else, check that the first character of the NIS-returned buffer is not a '+' or '-'. If it is, drop the entry. (#define EXTRA_PARANOIA 1 :)
- Probe for the master.passwd.* maps once during __initdb() instead of doing it each time _getyppass() or _nextyppass() is called.
- Don't copy the NIS data buffers to static memory in _getyppass() and _nextyppass(): this is done in _pw_breakout_yp() now.
- Test against phkmalloc and phkmalloc/2 (TNG!) to make sure we're free()ing the yp buffers sanely.
- Put _havemaster(), _getyppass() and nextyppass() prototypes under #ifdef YP. (Somehow they ended up on the wrong side of the #endif.)
- Remove unused variable ___yp_only.
show more ...
|
#
400b8413 |
| 05-Sep-1995 |
Bill Paul <wpaul@FreeBSD.org> |
getgrent.c: adjust _nextypgroup() slightly so that it continues processing the group map after encountering a badly formatted entry.
getpwent.c: same as above for _nextyppass(), and also turn a coup
getgrent.c: adjust _nextypgroup() slightly so that it continues processing the group map after encountering a badly formatted entry.
getpwent.c: same as above for _nextyppass(), and also turn a couple of sprintf()s into snprintf()s to avoid potential buffer overruns. (The other day I nearly went mad because of a username in my NIS database that's actually 9 characters long instead of 8. Stuffing a 9-character username into an 8-character buffer can do some strange things.)
(This reminds me: I hope somebody's planning to fix the buffer overrun security hole in syslog(3) before 2.1 ships.)
show more ...
|
#
d454389c |
| 02-Sep-1995 |
Bill Paul <wpaul@FreeBSD.org> |
getpwent.c: turn the code that checks the override caches into a seperate function to avoid duplication. Also fix getpwent() a small bit to properly handle the case where the magic NIS '+' entry appe
getpwent.c: turn the code that checks the override caches into a seperate function to avoid duplication. Also fix getpwent() a small bit to properly handle the case where the magic NIS '+' entry appears before the end of the password file.
getgrent.c: be a little more SunOS-ish. Make it look like the NIS group map is 'inserted' at the the point(s) where the magic NIS '+' entry/entries appear.
getgrent: fix a file descriptor leak: remember to close the netgroup file after we determine that we're using NIS-only innetgr() lookups.
show more ...
|
#
6c0828a6 |
| 26-Jun-1995 |
Bill Paul <wpaul@FreeBSD.org> |
Do the same sanity checking in _pw_breakout_yp() that we do in _gr_breakout_yp(): if we encounter a NULL pointer generated as the result of a badly formatted NIS passwd entry (e.g. missing fields), w
Do the same sanity checking in _pw_breakout_yp() that we do in _gr_breakout_yp(): if we encounter a NULL pointer generated as the result of a badly formatted NIS passwd entry (e.g. missing fields), we punt and return an error code, thereby silently skipping the bad entry.
show more ...
|
#
85e8f5be |
| 17-Jun-1995 |
Bill Paul <wpaul@FreeBSD.org> |
Make _havemaster() use yp_first() (again) instead of yp_order() to ward off possible NIS+ evil. (I might be overly paranoid with this, but it doesn't hurt, so...)
|
#
d3628763 |
| 11-Jun-1995 |
Rodney W. Grimes <rgrimes@FreeBSD.org> |
Merge RELENG_2_0_5 into HEAD
|
Revision tags: release/2.0.5_cvs |
|
#
6c06b4e2 |
| 30-May-1995 |
Rodney W. Grimes <rgrimes@FreeBSD.org> |
Remove trailing whitespace.
|
#
243ae8c7 |
| 22-Apr-1995 |
Bill Paul <wpaul@FreeBSD.org> |
in _freecaches(): strdup() allocates us memory -- remember to free it.
|