summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Add lockf().Dmitrij Tejblum1998-07-081-3/+3
| | | | Notes: svn path=/head/; revision=37515
* Make this look more FreeBSDish.Dmitrij Tejblum1998-07-081-8/+2
| | | | Notes: svn path=/head/; revision=37513
* This commit was generated by cvs2svn to compensate for changes in r37510,Dmitrij Tejblum1998-07-082-0/+345
|\ | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=37511
| * An implementation of lockf() function call.Dmitrij Tejblum1998-07-082-0/+345
| | | | | | | | | | | | | | Obtained from: NetBSD (author: Klaus Klein) Notes: svn path=/vendor/NetBSD/dist/; revision=37510
* | Replace my original asprintf() and vasprintf() hacks with somethingPeter Wemm1998-07-084-142/+99
| | | | | | | | | | | | | | | | | | | | | | more cleanly integrated with stdio. This should be faster and cleaner since it doesn't memcpy() the data into a seperate buffer. This lets stdio allocate and manage the buffer and then hand it over to the user. Obtained from: Todd Miller <Todd.Miller@courtesan.com> via OpenBSD Notes: svn path=/head/; revision=37487
* | fts_close calls free(sp), the ISSET(FTS_NOCHDIR) which is a macro thatPoul-Henning Kamp1998-07-032-6/+8
| | | | | | | | | | | | | | | | | | | | | | references sp. The free needs to follow ISSET PR: 7148 Reviewed by: phk Submitted by: Ken Mayer <kmayer@freegate.com> Notes: svn path=/head/; revision=37349
* | Cross-reference to sysconf(3).Eivind Eklund1998-06-301-1/+2
| | | | | | | | Notes: svn path=/head/; revision=37319
* | Fixed printf format errors.Bruce Evans1998-06-304-7/+7
| | | | | | | | Notes: svn path=/head/; revision=37301
* | Fixed scanf format errors. The error handling is not quite bug for bugBruce Evans1998-06-301-7/+4
| | | | | | | | | | | | | | | | | | compatible. I think small negative uids are handled compatibly but other out of bounds ones are truncated differently for certain sizes of uid_t. Notes: svn path=/head/; revision=37300
* | Fixed printf format errors. Don't assume so many things about time_t.Bruce Evans1998-06-301-20/+16
| | | | | | | | | | | | | | | | | | Obtained from: partial merge of ADO version tzcode96h (was fully merged in 1.10 but backed out in 1.11; the FreeBSD code for %s was earlier, prettier but buggier). Notes: svn path=/head/; revision=37299
* | Fix btree problems. This passes regressions tests.Guido van Rooij1998-06-252-2/+5
| | | | | | | | | | | | | | | | | | PR: 7009 Obtained from: http://www.sleepycat.com/update/patch.185.html, patches 1.2, 1.3 and 1.4 Notes: svn path=/head/; revision=37155
* | preserve errno across the readlink() calls. There is no value in trashingPeter Wemm1998-06-181-1/+4
| | | | | | | | | | | | | | errno during a successful malloc() call. Notes: svn path=/head/; revision=37048
* | Don't compile in the use of poll() when building libc_r. This isn'tPeter Wemm1998-06-141-1/+15
| | | | | | | | | | | | | | | | so much a "fix", rather a bandaid to buy time to fix it properly within the thread engine. Notes: svn path=/head/; revision=36967
* | Document EINVAL return value.Bruce Evans1998-06-141-0/+7
| | | | | | | | Notes: svn path=/head/; revision=36962
* | Make nlist() understand elf unconditionallyPeter Wemm1998-06-122-5/+2
| | | | | | | | Notes: svn path=/head/; revision=36919
* | Update the resolver parts to bind-8.1.2 level. I have not touched thePeter Wemm1998-06-1125-1733/+3219
| | | | | | | | | | | | | | | | | | getXXXXbyYYYY() interfaces yet. Obtained from: diff relative to bind-8.1.2 sources Notes: svn path=/head/; revision=36891
* | Move ftok() from libcompat to libc, so that it can be closer to itsJohn Polstra1998-06-101-3/+3
| | | | | | | | | | | | | | | | | | friend shmget(). PR: closes misc/6763 Notes: svn path=/head/; revision=36859
* | Fix grammar, "null" -> "NUL"Daniel O'Callaghan1998-06-101-5/+5
| | | | | | | | Notes: svn path=/head/; revision=36854
* | This is a null commit to log the fact that I have done a repositoryJohn Polstra1998-06-102-2/+2
| | | | | | | | | | | | | | | | | | | | copy to bring these files into libc from libcompat. I will enable them and kill off the libcompat versions on the main branch soon. PR: step one toward closing misc/6763 Notes: svn path=/head/; revision=36836
* | Remove __NETBSD_SYSCALLS from CFLAGS now that it is set in sys.mk.John Birrell1998-06-091-2/+3
| | | | | | | | Notes: svn path=/head/; revision=36825
* | Rename calls when building libc_r.John Birrell1998-06-091-3/+3
| | | | | | | | Notes: svn path=/head/; revision=36824
* | Make this thread-safe in both libc as well as libc_r.John Birrell1998-06-091-13/+2
| | | | | | | | Notes: svn path=/head/; revision=36823
* | Rename when building libc_r.John Birrell1998-06-095-9/+9
| | | | | | | | Notes: svn path=/head/; revision=36822
* | Add rename support for libc_r.John Birrell1998-06-091-1/+50
| | | | | | | | Notes: svn path=/head/; revision=36821
* | Fix potential resource leak: when call to des_crypt_1() fails, rememberBill Paul1998-06-091-2/+3
| | | | | | | | | | | | | | to destroy the RPC CLIENT handle before returning. Notes: svn path=/head/; revision=36816
* | Implement compile time thread lock debug.John Birrell1998-06-092-4/+4
| | | | | | | | Notes: svn path=/head/; revision=36808
* | Rename fstat as _thread_sys_fstat if being built into libc_r.John Birrell1998-06-091-1/+5
| | | | | | | | Notes: svn path=/head/; revision=36807
* | Implement thread support for libc_r. Make the lseek syscall directlyJohn Birrell1998-06-091-2/+7
| | | | | | | | | | | | | | to avoid recursive locking. Notes: svn path=/head/; revision=36806
* | Implement compile time debug mode for thread locks.John Birrell1998-06-093-11/+11
| | | | | | | | Notes: svn path=/head/; revision=36805
* | Add support for thread lock debug. No impact of the malloc code.John Birrell1998-06-091-4/+4
| | | | | | | | Notes: svn path=/head/; revision=36804
* | Implement compile time debug support for spinlocks.John Birrell1998-06-091-5/+24
| | | | | | | | | | | | | | | | | | Simplify the atomic lock prototype, removing the lock value. Delete the unlock prototypes that are not required. Notes: svn path=/head/; revision=36803
* | Fix this so that it compiles in the !__STDC__ case.Steve Price1998-06-061-1/+5
| | | | | | | | | | | | | | | | | | Also be consistent about usage of #if ... Pointed out by: bde Notes: svn path=/head/; revision=36706
* | Spelling corrections.Joseph Koshy1998-06-063-4/+4
| | | | | | | | | | | | | | | | PR: 6868 Submitted by: Josh Gilliam <josh@quick.net> Notes: svn path=/head/; revision=36692
* | Spelling nits.Joseph Koshy1998-06-062-4/+4
| | | | | | | | | | | | | | Pointed out by: Sue Blake <sue@welearn.com.au> Notes: svn path=/head/; revision=36688
* | Fix handling more than 1 char with non-C localeAndrey A. Chernov1998-06-051-16/+4
| | | | | | | | | | | | | | | | | | Misc. cleanup PR: 6825 Submitted by: Sergey Gershtein <sg@mplik.ru> Notes: svn path=/head/; revision=36665
* | Mention that tftpd(8) also uses syslog(3).Joseph Koshy1998-06-051-2/+3
| | | | | | | | Notes: svn path=/head/; revision=36664
* | Fix a bunch of spelling errors.Steve Price1998-06-0410-18/+18
| | | | | | | | | | | | | | | | PR: 6856 Submitted by: Josh Gilliam <josh@quick.net> Notes: svn path=/head/; revision=36649
* | Correct wrong claim about `telldir()' cookie lifetimes.Joseph Koshy1998-06-031-16/+11
| | | | | | | | | | | | | | | | PR: 4043 Submitted by: Joe Orthoefer <j_orthoefer@tia.net> Notes: svn path=/head/; revision=36603
* | Add a trivial mechanism for returning a useful default value if one isMike Smith1998-06-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | available and the kernel MIB setting is zero. Return the result from getpagesize() if the p1003_1b.pagesize MIB value is zero. Suggested by: Joerg Schilling <schilling@fokus.gmd.de> Notes: svn path=/head/; revision=36577
* | Several sources including Unix98 say that semctl's fourthSteve Price1998-05-311-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | parameter is optional except where: cmd == {IPC_SET || IPC_STAT || GETALL || SETVAL || SETALL} PR: 2448 Reviewed by: bde Submitted by: Tim Singletary <tsingle@sunland.gsfc.nasa.gov> Minor tweaks by: steve Notes: svn path=/head/; revision=36482
* | Remove references to getvfsbytype. Also remove getvfsbynameSteve Price1998-05-301-32/+13
| | | | | | | | | | | | | | | | | | as it has its own manpage. Discussed with: bde Notes: svn path=/head/; revision=36474
* | Remove a couple style bugs from the code snippet thatSteve Price1998-05-261-3/+3
| | | | | | | | | | | | | | | | | | slipped in on the previous commit. Submitted by: bde Notes: svn path=/head/; revision=36388
* | Update code example to reflect current practice.Steve Price1998-05-251-12/+10
| | | | | | | | Notes: svn path=/head/; revision=36381
* | The incorrect select() timeout calculation that I fixed in svc_tcp.cBill Paul1998-05-211-2/+2
| | | | | | | | | | | | | | | | also exists here (the timeout can expire much sooner than it's supposed to). Notes: svn path=/head/; revision=36280
* | Change the sanity test here. It's not correct to assume that the recordBill Paul1998-05-201-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | size we receive here should fit into the receive buffer. Unfortunately, there's no 100% foolproof way to distinguish a ridiculously large record size that a client actually meant to send us from a ridiculously large record size that was sent as a spoof attempt. The one value that we can positively identify as bogus is zero. A zero-sized record makes absolutely no sense, and sending an endless supply of zeroes will cause the server to loop forever trying to fill its receive buffer. Note that the changes made to readtcp() make it okay to revert this sanity test since the deadlock case where a client can keep the server occupied forever in the readtcp() select() loop can't happen anymore. This solution is not ideal, but is relatively easy to implement. The ideal solution would be to re-arrange the way dispatching is handled so that the select() loop in readtcp() can be eliminated, but this is difficult to implement. I do plan to implement the complete solution eventually but in the meantime I don't want to leave the RPC library totally vulnerable. That you very much Sun, may I have another. Notes: svn path=/head/; revision=36257
* | Replace the getpublickey() stub with the real thing.Bill Paul1998-05-181-33/+160
| | | | | | | | Notes: svn path=/head/; revision=36165
* | Improve DoS avoidance in RPC stream oriented transports. The TCP transportBill Paul1998-05-182-34/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | uses readtcp() to gather data from the network; readtcp() uses select(), with a timeout of 35 seconds. The problem with this is that if you connect to a TCP server, send two bytes of data, then just pause, the server will remain blocked in readtcp() for up to 35 seconds, which is sort of a long time. If you keep doing this every 35 seconds, you can keep the server occupied indefinitely. To fix this, I modified readtcp() (and its cousin, readunix() in svc_unix.c) to monitor all service transport handles instead of just the current socket. This allows the server to keep handling new connections that arrive while readtcp() is running. This prevents one client from potentially monopolizing a server. Also, while I was here, I fixed a bug in the timeout calculations. Someone attempted to adjust the timeout so that if select() returned EINTR and the loop was restarted, the timeout would be reduced so that rather than waiting for another 35 seconds, you could never wait for more than 35 seconds total. Unfortunately, the calculation was wrong, and the timeout could expire much sooner than 35 seconds. Notes: svn path=/head/; revision=36156
* | kill.1: Remove reference to obsolete sigvec(2) man page. RemovedJoseph Koshy1998-05-181-2/+1
| | | | | | | | | | | | | | | | | | | | self reference in sigaction(2) man page. Submitted by: Josh Gilliam <josh@quick.net> PR: 6617 Notes: svn path=/head/; revision=36143
* | Patch RPC library to avoid possible denial of service attacks as describedBill Paul1998-05-151-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | recently in BUGTRAQ. The set_input_fragment() routine in the XDR record marking code blindly trusts that the first two bytes it sees will in fact be an actual record header and that the specified size will be sane. In fact, if you just telnet to a listening port of an RPC service and send a few carriage returns, set_input_fragment() will obtain a ridiculously large record size and sit there for a long time trying to read from the network. A sanity test is required: if the record size is larger than the receive buffer, punt. Notes: svn path=/head/; revision=36087
* | Patch RPC library to avoid possible denial of service attacks as describedBill Paul1998-05-152-2/+4
| | | | | | | | | | | | | | | | | | recently in BUGTRAQ. If a stream oriented transport fails to properly decode an RPC message header structure where there should be one, it should mark the stream as dead so that the connection will be dropped. Notes: svn path=/head/; revision=36086