Commit Graph

1733 Commits

Author SHA1 Message Date
Wes Peters
4d3be89f2a Document the getlogin_r function. 1999-11-28 22:41:50 +00:00
Wes Peters
8166f7fd4b Provide the getlogin_r function. 1999-11-28 22:41:38 +00:00
Alfred Perlstein
7285bccf1a add pthread_cancel, obtained from OpenBSD.
eischen (Daniel Eischen) added wrappers to protect against cancled
threads orphaning internal resources.

the cancelability code is still a bit fuzzy but works for test
programs of my own, OpenBSD's and some examples from ORA's books.

add readdir_r to both libc and libc_r

add some 'const' attributes to function parameters

Reviewed by: eischen, jasone
1999-11-28 05:38:13 +00:00
Poul-Henning Kamp
9b962c56a4 General clean-up of socket.h and associated sources to synchronise up
with NetBSD and the Single Unix Specification v2.

This updates some structures with other, almost equivalent types and
effort is under way to get the whole more consistent.

Also removes a double definition of INET6 and some other clean-ups.

Reviewed by: green, bde, phk
Some part obtained from: NetBSD, SUSv2 specification
1999-11-24 20:49:04 +00:00
Eivind Eklund
637bc59616 Allow empty UIDs if we are processing NIS records. I am not entirely
happy with how this end up and will re-visit the entire empty field
problem, but this patch solves the NIS problem for now.

Submitted by:	Dan Nelson <dan@emsphone.com>
PR:	14865,14984
1999-11-22 12:42:38 +00:00
Dmitrij Tejblum
dcd26325e8 Make __sfp() even more thread-safe. 1999-11-21 22:34:57 +00:00
Dmitrij Tejblum
32fc781e06 Add (FILE *) locking. 1999-11-20 14:52:03 +00:00
Dmitrij Tejblum
e33f599134 Make __sfp() (FILE allocator) thread-safe: added locking like in malloc(). 1999-11-20 14:01:48 +00:00
David E. O'Brien
3c0c03cdf1 Fix HISTORY - the copyright header on the file of the GCC version was
misleading.

Submitted by:	Theo de Raadt <deraadt@cvs.openbsd.org>
1999-11-20 00:15:17 +00:00
David E. O'Brien
b6419b666f Add to the HISTORY. 1999-11-19 17:13:31 +00:00
John Polstra
e2e3d0a401 For the TCP transport, put the listening socket in non-blocking
mode.  This addresses a well-known race condition that can cause
servers to hang in accept().  The relevant case is when somebody
connects to the server and then immediately kills the connection
by sending a TCP reset.  On the server this causes select to report
a ready condition on the socket, after which the accept call blocks
because there is no longer any pending connection to accept.

In -current there is already a work-around for this in the kernel.
It was merged into -stable some time ago, but then David Greenman
reverted it because it seemed to be causing a socket leak in some
cases.  (See uipc_socket.c revision 1.51.2.3.)  Hence this userland
fix is needed in -stable, and I plan to merge it into that branch
soon because it fixes a potential DoS attack.  It may also be needed
in -current if the suspected socket leak turns out to be real.  In
any case, after thinking it over I believe the fix belongs in
userland.  An application shouldn't assume that a ready return from
select guarantees that the subsequent I/O operation cannot block.
A lot can happen between the select and the accept.

A similar fix should most likely be applied to the Unix domain
socket transport too.

Submitted by:	peter
Reviewed by:	jdp
1999-11-18 03:01:06 +00:00
Brian Somers
0675e24de0 Make setproctitle(NULL) restore all of the original arguments
(if it's able).
1999-11-17 21:12:17 +00:00
John Polstra
6b2bdf2c08 Fix a bug in the hack that protects against FTP bounce attacks.
It used to loop back up to the accept() call and block there,
shutting out all other transports until a new connection came in.
Now it returns instead after dropping the connection.  That will
take it back to the select() loop where all transports can be
serviced.  I intend to MFC this within a day or two since it
fixes a DoS vulnerability.
1999-11-17 01:54:17 +00:00
Poul-Henning Kamp
b9df5231ca Introduce commandline caching in the kernel.
This fixes some nasty procfs problems for SMP, makes ps(1) run much faster,
and makes ps(1) even less dependent on /proc which will aid chroot and
jails alike.

To disable this facility and revert to previous behaviour:
        sysctl -w kern.ps_arg_cache_limit=0

For full details see the current@FreeBSD.org mail-archives.
1999-11-16 20:31:58 +00:00
Sheldon Hearn
18138b08d8 Add to pwd_mkdb a -q option to silence warnings about large IDs. Add a
suitably ominous warning in the manual page.

The diff applied is not the one provided in the attributed PR.

PR:		13344
Reviewed by:	bde
1999-11-15 16:45:37 +00:00
Kris Kennaway
6b65064ba7 fts_pathlen and fts_namelen are u_short, not short
Obtained from:	OpenBSD
1999-11-15 03:29:19 +00:00
Kris Kennaway
a8b4fa4aaf Typo
Obtained from:	OpenBSD
1999-11-15 03:13:23 +00:00
Chris Costello
328984c261 Properly document what ENOENT really means for kldfind(2). 1999-11-14 18:15:33 +00:00
Peter Wemm
0d052386ba Go to a bit more trouble to make it absolutely clear that malloc(3)
does not zero the allocated memory.
1999-11-12 16:41:21 +00:00
Sheldon Hearn
33dbb0a630 Decremement by 1 the value taken for %j before assigning it to tm_yday,
which is zero-based.

Correct the range checking for the value taken for %S.

Add %w for the day of the week (0-6).

Accept (but do nothing with) %U and %W.  The comment for this change was
taken from NetBSD.

These changes were made after several failed attempts to contact the
author of our strptime.c .

PR:		10131
Submitted by:	tadf@kt.rim.or.jp (Tadayoshi Funaba)
1999-11-10 14:40:59 +00:00
Andrey A. Chernov
5d1706df0d Fix dead loop if locale contains / and not all categories specified
PR:		14742
Submitted by:	peter@wahoo.com.tw
1999-11-09 11:09:16 +00:00
Alexey Zelkin
880dead128 Remove useless section.
PR:		docs/14764
Submitted by:	David Malone <dwmalone@maths.tcd.ie>
1999-11-09 00:28:34 +00:00
Eivind Eklund
aa510d6741 Flag empty UID entries as errors (to stop typos from turning into
alternate root accounts).
1999-11-06 20:21:04 +00:00
Andrey A. Chernov
deee919e7e Add unsigned char cast to isalpha 1999-11-04 05:01:28 +00:00
Andrey A. Chernov
bac6a61c15 Add unsigned char cast to isdigit 1999-11-04 04:57:05 +00:00
Andrey A. Chernov
fbc8d502c5 Add unsigned char cast to is[x]digit 1999-11-04 04:52:34 +00:00
Andrey A. Chernov
d67f4d918d Add unsigned char cast to isdigit 1999-11-04 04:46:18 +00:00
Andrey A. Chernov
3c7ffaa1fe Add unsigned char cast to isupper 1999-11-04 04:40:56 +00:00
Andrey A. Chernov
3fb85bff81 unsigned char cast to ctype macros 1999-11-04 04:35:33 +00:00
Andrey A. Chernov
9ea99d349b Add unsigned char cast to ctype macros arg 1999-11-04 04:30:44 +00:00
Andrey A. Chernov
49435560cc Add unsigned char cast to isspace arg 1999-11-04 04:16:28 +00:00
Brian Feldman
433a027b0e Fix a really lame buglet which broke with IPs of 34
(ERANGE...)
1999-11-03 04:18:34 +00:00
Joerg Wunsch
c786c636ba It is no longer necessary to prepend underscores to external symbols under
ELF.

Submitted by:	A.Leidinger@WJPServer.CS.Uni-SB.de (Alexander Leidinger)
1999-11-02 18:18:26 +00:00
Nik Clayton
de1efdfc1a Document that bind(2) can fail with EAGAIN.
PR:             docs/14173 docs/14181
Submitted by:   Charles Randall <crandall@matchlogic.com>
Submitted by:   Kelly Yancey <kbyanc@posi.net>
1999-11-01 19:43:07 +00:00
Brian Feldman
8308463eba Allow whitespace termination. Internal use of /etc/resolv.conf relies
on this, and who knows what else would, too...
1999-10-31 04:43:55 +00:00
Brian Feldman
28585846d6 This is the new inet_addr/inet_aton with proper error checking. This
should close all outstanding PRs on incorrect inet_aton behavior, and
since it has a decent parsing routine, doesn't allow some hysterically
working behavior.

PR:		13628
Submitted by:	Adrian Chadd <adrian@FreeBSD.org>
1999-10-31 04:07:56 +00:00
Alexey Zelkin
e1e5fdf6d4 mdoc(7)'fy 1999-10-30 15:12:25 +00:00
David E. O'Brien
dd4bd1e7ba Add HISTORY. 1999-10-29 16:50:22 +00:00
David E. O'Brien
dd30998fb1 "S" comes before "U"...
Alphabet taught to Green by:	obrien
1999-10-25 03:51:01 +00:00
Andrey A. Chernov
5eb8ccf583 Remove UNSAFE_WARN ifdef for mktemp warning (never defined)
Use _mktemp internally
1999-10-24 11:57:24 +00:00
Andrey A. Chernov
0200080b60 YP/NIS code: remove unnecessary endgrent() calls which can cause fail on
next try over chroot (descriptor closed). getgrnam() used already handles
endgrent() properly and honors _gr_stayopen. Automatically call
setgroupent(1) when _pw_stayopen is set (for YP/NIS code).
1999-10-16 12:31:49 +00:00
Andrey A. Chernov
8b7690ea77 Fix longstanding bug "unused stayopen" introduced in rev1.11
PR:		14201
1999-10-16 11:50:37 +00:00
Marcel Moolenaar
7023c66887 Remove osig* from NOASM. It bogus now. 1999-10-14 10:00:39 +00:00
John Polstra
bdf5faebaf In longjmp, call sigreturn instead of osigreturn. The latter isn't
visible from userland any more.

Reviewed by:	luoqi
1999-10-14 01:16:51 +00:00
Marcel Moolenaar
e28ceff6d6 Not needed now the syscall matches the prototype. 1999-10-12 09:38:57 +00:00
Marcel Moolenaar
23cd96d8ce \begin{quote}
setjmp() gets the jmp_buf pointer from the wrong place (the place
where the return address is) in the shlib case, and uses it (only)
to fetch the current signal mask to address (return_address + 28).
This address is normally read-only (I hope), so the sigprocmask()
call has no effect except to return an error code.
\end{quote}

Submitted by: bde
1999-10-10 08:38:33 +00:00
Marcel Moolenaar
0cec71466c Remove syscall wrappers. 1999-10-09 15:27:09 +00:00
Doug Rabson
a51c074b64 Remove old sig* wrappers. 1999-10-09 12:11:31 +00:00
Wes Peters
9466cad206 Correct the description of the timeout argument. I've examined
the code, which seems to implement the POSIX requirements, and
have described the behavior here.  Basically, it behaves the same
as select(2).

Noticed by: John Polstra
1999-10-09 01:35:58 +00:00
John Polstra
2bc2b29270 Fix sigvec(). When the sigset_t changes came in, it was altered
to call osigaction().  But that's wrong because it causes the
handler to receive a struct osigcontext instead of the expected
struct sigcontext.  Use sigaction() instead, copying the compatible
portion of the signal mask.

Reviewed by:	marcel
1999-10-09 00:25:29 +00:00