summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* and so on...Poul-Henning Kamp1995-10-221-5/+3
| | | | Notes: svn path=/head/; revision=11662
* As above.Poul-Henning Kamp1995-10-223-5/+7
| | | | Notes: svn path=/head/; revision=11661
* As above.Poul-Henning Kamp1995-10-223-3/+2
| | | | | | | Oh I also put in a couple of compile-time warnings for the crypt stuff. Notes: svn path=/head/; revision=11660
* Minor cleanup, mostly unused vars and missing #includes.Poul-Henning Kamp1995-10-2219-43/+46
| | | | Notes: svn path=/head/; revision=11659
* Add $Id$ since this version of the file has diverged from the BSD base aPeter Wemm1995-10-211-1/+5
| | | | | | | fair bit. I forgot to add it when I made the fixes some time ago. Notes: svn path=/head/; revision=11606
* Propogate default table to restricted 8859-1 templateAndrey A. Chernov1995-10-191-0/+32
| | | | | | | | (only control/graph/punct/print tags used) Based on: kaleb@x.org and Bruce suggestions Notes: svn path=/head/; revision=11575
* Remove the bugs section. sh(1) now has a ulimit builtin.Joerg Wunsch1995-10-191-9/+0
| | | | Notes: svn path=/head/; revision=11572
* Doubled the performance of getenv()/__findenv() by rewriting it to notDavid Greenman1995-10-171-20/+24
| | | | | | | use strncmp().. Notes: svn path=/head/; revision=11549
* Add moncontrol.3 -> monstartup.3 link here.Poul-Henning Kamp1995-10-151-0/+1
| | | | Notes: svn path=/head/; revision=11522
* Another tweak/speedup pass:Bill Paul1995-10-111-62/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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. Notes: svn path=/head/; revision=11436
* phkmalloc/2Poul-Henning Kamp1995-10-082-311/+370
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "zero' and 'junk' options to help find and diagnose malloc abuse. EXTRA_SANITY defaults "junk" to on. Don't dump the internal state, unless EXTRA_SANITY. General code cleanup. Error messages cleaned up a bit, more checking earlier. EXTRA_SANITY is default at this time (just in case). Performance (without EXTRA_SANITY) is better, beats gnumalloc in both time & space most of the time: # In-memory test. ./malloc 50000000 2000 8192 159.2u 1.5s 2:41.85 99.3% 5+7742k 0+0io 0pf+0w ./gnumalloc 50000000 2000 8192 272.6u 0.4s 4:35.01 99.3% 5+8533k 0+0io 0pf+0w # Swap-space test. ./malloc 500000 14000 8192 6.5u 4.1s 4:08.87 4.3% 5+49209k 0+0io 9772pf+0w ./gnumalloc 500000 14000 8192 16.2u 14.5s 15:36.14 3.2% 5+54100k 0+0io 47651pf+0w # Small items test. ./malloc 20000000 20000 2048 67.0u 0.3s 1:07.83 99.2% 5+18199k 0+0io 4pf+0w ./gnumalloc 20000000 20000 2048 66.2u 0.3s 1:07.03 99.3% 5+18107k 0+0io 0pf+0w SANITY is not an option anymore. (!!) Notes: svn path=/head/; revision=11338
* Some NIS bug stomping:Bill Paul1995-10-061-24/+41
| | | | | | | | | | | | | | | | | | | | | | | | | - In some cases, we don't properly resolve _all_ possible group memberships. If a user is a member of both local and NIS groups, we sometimes lose some of the membership info from NIS. (Reported by: Thorsten Kukuk <kukuk@uni-paderborn.de>) - Make NIS +groupname overrides actually work the way the SunOS group(5) man page says they should (make them work for all cases: getgrent(), getgrnam() and getgrgid()). - When not compiled with -DYP, grscan() should ignore entries that begin with a '+'. When compiled _with_ -DYP, grscan() should ignore +groupname entries that don't refer to real NIS groups. - Remove redundant redeclaration of fgets(), strsep() and index() inside grscan(). We already #include all the right header files for these. Note: -groupname exclusion as specified in the Sun documentation still isn't supported. This'll be a 2.2 addition. Right now I just want this stuff to work. Notes: svn path=/head/; revision=11286
* remove GCC support functions from libc.Poul-Henning Kamp1995-10-052-4/+2
| | | | | | | Should never have been here in the first place. Notes: svn path=/head/; revision=11221
* Fix the problem that I aroused with the last commit..Peter Wemm1995-10-051-4/+10
| | | | | | | | | | | | | | | | | | What was happening, is if syslogd was not running, syslog() would do a strcat("\r\n") on a non-null-terminated buffer, and write it to the console. This meant that sometimes extra characters could be written to the console during boot, depending on the stack contents. This totally avoids the potential problem by using writev() like the rest of the does, and avoid modifying the buffer after the trouble we've gone to to carefully protect it. This is actually a trivial fix, in spite of the long commit message.. :-) It only appeared during boot and shutdown with syslogd stopped. Notes: svn path=/head/; revision=11192
* Make a link-time warning for the use of gets().Peter Wemm1995-10-041-0/+3
| | | | | | | | | | IMHO, the run-time warning should come out, but I'm not game to start that fight yet... This uses a feature of the gnu linker. Inspired by: NetBSD Notes: svn path=/head/; revision=11185
* Calling sbrk(2) with zero argument doesn't need to generate a syscall.Poul-Henning Kamp1995-10-042-8/+20
| | | | | | | Reviewed by: bde Notes: svn path=/head/; revision=11183
* Add man pages for the SYSV shm* and sem* functions.Joerg Wunsch1995-10-037-1/+890
| | | | | | | | | | This partially closes PR # docs/177. This should probably also go into 2.1. Submitted by: daveho@infocom.com (David Hovemeyer) Notes: svn path=/head/; revision=11151
* This gets() used \r\n, which is doggish.Bruce Evans1995-09-291-1/+1
| | | | Notes: svn path=/head/; revision=11064
* Make ttyname() use posix-style tcgetattr() to check to see that it'sPeter Wemm1995-09-221-3/+3
| | | | | | | | | running on a tty. (Same as isatty()) The old-style TIOCGETP ioctl wouldn't fly if the kernel didn't have COMPAT_43. Submitted by: Carl Fongheiser <cmf@netins.net> Notes: svn path=/head/; revision=10954
* A buglet when dumping and a stylistic point from Mike.Poul-Henning Kamp1995-09-221-8/+8
| | | | | | | Submitted by: Mike Pritchard <mpp@mpp.minn.net> Notes: svn path=/head/; revision=10952
* ``phkmalloc''Poul-Henning Kamp1995-09-163-373/+1123
| | | | | | | | | | Performance is comparable to gnumalloc if you have sufficient RAM, and it screams around it if you don't. Compiled with "EXTRA_SANITY" until further notice. see malloc.3 for more details. Notes: svn path=/head/; revision=10818
* Fix security bugs with a "new approach", using stdio's powerful bufferPeter Wemm1995-09-151-18/+86
| | | | | | | | | | | control hooks. It is similar to an unrolled multi-part snprintf(), in that a "FILE *" is attached to a string buffer. There is also an optimisation for the case where the syslog format string does not contain %m, which should improve performance of "informational" logging, like from ftpd. Notes: svn path=/head/; revision=10794
* Indicate that backlog limit is 32.David Greenman1995-09-151-1/+1
| | | | Notes: svn path=/head/; revision=10788
* getgrent.c: adjust _nextypgroup() slightly so that it continues processingBill Paul1995-09-052-4/+10
| | | | | | | | | | | | | | | | 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.) Notes: svn path=/head/; revision=10565
* Clear up a minor bogosity in yp_match(): we have YPMATCHCACHE turnedBill Paul1995-09-021-5/+5
| | | | | | | | | | | | on, which is fine, except that _yp_dobind() is called before we check the cache. The means we can return from the cache check (if we have a hit) without calling _yp_unbind(). We should do the cache check first and _then_ drop into the section that binds the server and does the yp_match query. Notes: svn path=/head/; revision=10522
* getpwent.c: turn the code that checks the override caches into aBill Paul1995-09-023-74/+79
| | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=10521
* National date/time representation in syslog logfiles looks ugly,Andrey A. Chernov1995-08-291-2/+1
| | | | | | | | change strftime to ctime. Logfiles must have default (english) date/time representation for access/view from various places. Notes: svn path=/head/; revision=10414
* Remove the CFLAGS+=-I${CURDIR}/net that I previously added.Peter Wemm1995-08-211-1/+0
| | | | | | | | | Since Bruce changed the #include <res_config.h> to #include "res_config.h" this is no longer needed, and only makes the 'make' more verbose for no real reason. Notes: svn path=/head/; revision=10156
* Define DEBUG as 1 instead of as nothing so that it doesn't conflict withBruce Evans1995-08-211-1/+1
| | | | | | | -DDEBUG in libresolv/Makefile. Notes: svn path=/head/; revision=10151
* Fix bogus include paths, some of which stopped libresolv from compiling.Bruce Evans1995-08-216-14/+12
| | | | Notes: svn path=/head/; revision=10150
* Update the resolver part of libc to bind-4.9.3-beta24 level (from beta9p1)Peter Wemm1995-08-209-215/+420
| | | | | | | | | | | Note that this was done by selective patching from diffs, to not conflict with the 4.4bsd base code.. This was *not* a trivial task.. I have been testing this code (apart from cosmetic changes) in my libc for a while now. Obtained from: Paul Vixie <paul@vix.com> Notes: svn path=/head/; revision=10133
* fgetline does not exist.. fgetln is in it's place. Correct the X-Ref.Peter Wemm1995-08-181-1/+1
| | | | | | | Noticed by: Brian Tao, Bruce Evans Notes: svn path=/head/; revision=10100
* There is no such file as /usr/include/ufs/quota.h. There is a fileJoerg Wunsch1995-08-151-1/+1
| | | | | | | | | | | | /usr/include/ufs/ufs/quota (#include <ufs/ufs/quota.h>) that seems to work ok though. Closes PR # docs/670: quotactl man page incorr... Submitted by: evans@scnc.k12.mi.us (Jeffrey Evans) Notes: svn path=/head/; revision=10066
* Submitted by: Bill Fenner <fenner@parc.xerox.com>Bill Paul1995-08-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for PR #510. The original problem was that __ivaliduser() was failing to grant access to a machine listed in a +@netgroup specified in /etc/hosts.equiv, even though the host being checked was most certainly in the +@netgroup. The /etc/hosts.equiv file in question looked like this: localhost +@netgroup The reason for the failure was had to do with gethostbyaddr(). Inside the __ivaliduser() routine, we need to do a gethostbyaddr() in order to get back the actual name of the host we're trying to validate since we're only passed its IP address. The hostname returned by gethostbyaddr() is later passed as an argument to innetgr(). The problem is that __icheckhost() later does a gethostbyname() of its own, which clobbers the buffer returned by gethostbyaddr(). The fix is just to copy the hostname into a private buffer and use _that_ as the 'host' argument that gets passed to innetgr(). And here I was crawling all over the innetgr() code thinking the problem was there. *sigh* Notes: svn path=/head/; revision=10059
* Forget to close fileAndrey A. Chernov1995-08-112-0/+2
| | | | | | | Submitted by: SANETO Takanori sanewo@strg.sony.co.jp Notes: svn path=/head/; revision=10026
* Bump shlib minor because xdr_* functions have been enabled. Do NOTSatoshi Asami1995-08-091-1/+1
| | | | | | | | | | | | | bump it again if something else is added before 2.2. The xdr_* functions are enabled only in the 2.2 (-current) branch so far. If that modification is moved to the 2.1 (-stable) branch, this one should, too. Reviewed by: the mailing lists Notes: svn path=/head/; revision=10012
* Fix _listmatch() so that it doesn't fall off the end of the list string.Bill Paul1995-08-081-6/+5
| | | | Notes: svn path=/head/; revision=9998
* Fix manpage to reflect current sourcesAndrey A. Chernov1995-08-071-21/+49
| | | | Notes: svn path=/head/; revision=9989
* Restore %s format support from previous versionAndrey A. Chernov1995-08-071-1/+22
| | | | Notes: svn path=/head/; revision=9988
* Just when you thought it was safe...Bill Paul1995-08-073-40/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - getnetgrent.c: address some NIS compatibility problems. We really need to use the netgroup.byuser and netgroup.byhost maps to speed up innetgr() when using NIS. Also, change the NIS interaction in the following way: If /etc/netgroup does not exist or is empty (or contains only the NIS '+' token), we now use NIS exclusively. This lets us use the 'reverse netgroup' maps and is more or less the behavior of other platforms. If /etc/netgroup exists and contains local netgroup data (but no '+'). we use only lthe local stuff and ignore NIS. If /etc/netgroup exists and contains both local data and the '+', we use the local data nd the netgroup map as a single combined database (which, unfortunately, can be slow when the netgroup database is large). This is what we have been doing up until now. Head off a potential NULL pointer dereference in the old innetgr() matching code. Also fix the way the NIS netgroup map is incorporated into things: adding the '+' is supposed to make it seem as though the netgroup database is 'inserted' wherever the '+' is placed. We didn't quite do it that way before. (The NetBSD people apparently use a real, honest-to-gosh, netgroup.db database that works just like the password database. This is actually a neat idea since netgroups is the sort of thing that can really benefit from having multi-key search capability, particularly since reverse lookups require more than a trivial amount of processing. Should we do something like this too?) - netgroup.5: document all this stuff. - rcmd.c: some sleuthing with some test programs linked with my own version of innetgr() has revealed that SunOS always passes the NIS domain name to innetgr() in the 'domain' argument. We might as well do the same (if YP is defined). - ether_addr.c: also fix the NIS interaction so that placing the '+' token in the /etc/ethers file makes it seem like the NIS ethers data is 'inserted' at that point. (Chances are nobody will notice the effect of this change, which is just te way I like it. :) Notes: svn path=/head/; revision=9978
* Install non-source files with the optional flag ${COPY}, not with the flag -c.Bruce Evans1995-08-061-1/+1
| | | | Notes: svn path=/head/; revision=9972
* Change `install' to `${INSTALL}' so that default install flags can beBruce Evans1995-08-061-1/+1
| | | | | | | | | | specified in the top level Makefiles. Previously I missed dozens of Makefiles that skip the install after using `cmp -s' to decide that the install isn't necessary. Notes: svn path=/head/; revision=9970
* Fix default %c to be ctime-compatible as supposed (by Solaris too)Andrey A. Chernov1995-08-061-4/+4
| | | | Notes: svn path=/head/; revision=9964
* The European Commission went out and invented a new sort of summer-timeGarrett Wollman1995-08-053-224/+321
| | | | | | | | | changeover, so we have to extend the format of timezone files (in a backward- compatible way, of course). This probably means that libc needs a minor version number bump before 2.2 is released (or maybe not). Notes: svn path=/head/; revision=9936
* Don't depend on bogusly-installed <tzfile.h>.Garrett Wollman1995-08-051-1/+1
| | | | Notes: svn path=/head/; revision=9935
* Fix cut&paste error: LC_COLLATE should be LC_TIMEAndrey A. Chernov1995-08-051-3/+3
| | | | Notes: svn path=/head/; revision=9929
* Add time locale loadingAndrey A. Chernov1995-08-051-0/+8
| | | | Notes: svn path=/head/; revision=9927
* Move rtprio.2 from usr.sbin/rtprio to lib/libc/sys, overwriting the bogusBruce Evans1995-08-051-28/+42
| | | | | | | | | version in the latter directory. Reviewed by: davidg Notes: svn path=/head/; revision=9919
* Implement locale-sensitive strftime () from ADO (heavily modifiedGarrett Wollman1995-08-043-106/+254
| | | | | | | | | | | | | by me). This probably loses for multibyte characters, but I have no way of telling. I'll let ache decide whether to add this support to startup_setlocale. Note that for this to make any sense at all, the symlinks in /usr/share/locale must go. (For the moment, this doesn't make any difference since there are no locales supplied.) Obtained from: Arthur David Olson <ado@elsie.nci.nih.gov> Notes: svn path=/head/; revision=9912
* Reviewed by: David GreenmanBill Paul1995-08-021-14/+4
| | | | | | | | | | | | | | | | | | Back out the 'help NIS rebind faster' hack. This change used a connect()/send() pair rather than the original sendto() to allow RPC to pass ICMP host unreachable and similar errors up to RPC programs that use UDP. This is not a terrible thing by itself, but it can cause trouble in environments with multi-homed hosts: if the portmapper on the multi-homed machine sends a reply with a source address that's different than the one associated with the connection by connect(), the kernel will send a port unreachable message and drop the reply. For the sake of compatibility with everybody else on the planet, it's best to revert to the old behavior. *long, heavy sigh* Notes: svn path=/head/; revision=9853