Commit graph

8337 commits

Author SHA1 Message Date
Andrey A. Chernov ee43cb7a22 Change "-"-started options when POSIX_CORRECTLY is set handling
in favour of GNU instead of NetBSD, because configure's use us and
expect GNU.
2004-03-01 10:03:34 +00:00
Tim Kientzle 09951e89e9 Back out the "clean_environment()" function from libutil.
Further contemplation has convinced me that this was
not going to really solve the problem of environment-poisoning
without raising serious administrative headaches.  There
must be a better way...
2004-02-29 22:13:28 +00:00
Diomidis Spinellis 3f0a01ea87 Make consistent with the better written wcsrtombs function:
- Fix syntax
- Remove the (slightly wrong) duplicate explanation of the error condition
- Change reference to invalid multibyte character into invalid wide character
2004-02-27 15:03:22 +00:00
Tim Kientzle a0a7e17219 Add the clean_environment call to libutil.h also.
MFC after: 2 weeks
2004-02-26 22:44:11 +00:00
Tim Kientzle f9efe8694a Add a clean_environment call to libutil.
This function removes all environment variables except
the ones listed on a "whitelist."

The function accepts two whitelist arguments.
If the first is NULL, a built-in default list will be
used.  This allows callers to get a variety of behaviors:
  * Default screening: provide NULL for both lists
  * Custom screening: provide a custom list for the first argument
  * Modified default screening: provide NULL for first arg,
     list of additional variables to preserve in the second arg

Idea from: Jacques Vidrine

MFC after: 2 weeks
2004-02-26 22:41:47 +00:00
Maksim Yevmenkin 0d60ad30ca Add extra sanity check for SDP packets in libsdp(3)
Fix yet another endianess bug in sdpd(8)
2004-02-26 20:44:55 +00:00
Bruce Evans 5c3a55dea7 Backed out rev.1.6 and subsequent copying of it (bogus addition of
-static to CFLAGS).  It just turned rev.1.5 into an obfuscated no-op.
As explained in the log for rev.1.5, testing should be done in the
host environment but there is a problem in cross-compilation environments.
As not explained in the log for rev.1.6, there was apparently a practical
problem with cross-compiling (makeworld should have set -static in
LDFLAGS but apparently didn't).  Cross-compilation was especially
complicated because the relevant programs are test programs that were
run at beforeinstall time -- dynamic libraries might or might not exist
depending on the build options.  The complications became moot in
rev.1.8 when beforeinstall was renamed "test".
2004-02-26 07:44:37 +00:00
Brian Feldman 33dee81933 Make the resolver(3) and many associated interfaces much more reentrant.
The getaddrinfo(3), getipnodebyname(3) and resolver(3) can coincide now
with what should be totally reentrant, and h_errno values will now
be preserved correctly, but this does not affect interfaces such as
gethostbyname(3) which are still mostly non-reentrant.

In all of these relevant functions, the thread-safety has been pushed
down as far as it seems possible right now.  This means that operations
that are selected via nsdispatch(3) (i.e. files, yp, dns) are protected
still under global locks that getaddrinfo(3) defines, but where possible
the locking is greatly reduced.  The most noticeable improvement is
that multiple DNS lookups can now be run at the same time, and this
shows major improvement in performance of DNS-lookup threaded programs,
and solves the "Mozilla tab serialization" problem.

No single-threaded applications need to be recompiled.  Multi-threaded
applications that reference "_res" to change resolver(3) options will
need to be recompiled, and ones which reference "h_errno" will also
if they desire the correct h_errno values.  If the applications already
understood that _res and h_errno were not thread-safe and had their own
locking, they will see no performance improvement but will not
actually break in any way.

Please note that when NSS modules are used, or when nsdispatch(3)
defaults to adding any lookups of its own to the individual libc
_nsdispatch() calls, those MUST be reentrant as well.
2004-02-25 21:03:46 +00:00
Robert Watson 47ab23aa82 Add bsde_add_rule(), which is similar to bsde_set_rule() except that
the caller does not specify the rule number -- instead, the kernel
module is probed for the next available rule, which is then used.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, McAfee Research
2004-02-25 03:24:39 +00:00
Peter Grehan bf7c848b97 No reason to disable this test on powerpc. 2004-02-25 00:53:06 +00:00
Peter Grehan 8509c106ef Use signed char cast to avoid out-of-range error on PowerPC (which has
unsigned char by default). This is a no-op on all other current arches.

Tested by: md5 sum before/after same on i386
2004-02-25 00:52:14 +00:00
Andrey A. Chernov 829a229d88 Add getopt_long_only() from OpenBSD and other OpenBSD cleanups
PR:             63173
Submitted by:   Marius Strobl <marius@alchemy.franken.de>
2004-02-24 08:07:26 +00:00
Brian Feldman 7ce21b2023 Apply style(9).
Submitted by:	"Christian S.J. Peron" <maneo@bsdpro.com>
PR:		bin/63283
2004-02-23 20:42:03 +00:00
Johan Karlsson b51049906c style.Makefile:
Use WARNS?= instead of WARNS=.
2004-02-23 20:07:47 +00:00
Josef El-Rayes 474f8512ae Add signal numbers to signal(3).
Approved by:    simon(mentor)
Reviewed by:    ru
Submitted by:   Stefan Farfeleder <stefan@fafoe.narf.at>
PR:             docs/60044
2004-02-23 13:20:03 +00:00
Andrey A. Chernov 75207c7a43 Add optarg, optind, opterr, optopt, optreset to SYNOPSYS 2004-02-23 05:07:11 +00:00
Andrey A. Chernov 60fb481f43 POSIX clearly states that getsubopt() should be declared in <stdlib.h>
not in <unistd.h>
2004-02-23 03:32:10 +00:00
Andrey A. Chernov f0d82b33be Remove unneccessary <unistd.h> 2004-02-23 03:30:02 +00:00
Daniel Eischen f3e170bbdb Update man page to reflect additional flag to allow selection of threads. 2004-02-22 18:12:56 +00:00
Daniel Eischen 694127f89c Teach kvm_getprocs() to recognize a sysctl flag for including threads. 2004-02-22 17:57:10 +00:00
Peter Wemm efbef97de9 Change the syscall stub branch orders so that the static branch prediction
will assume that syscalls will succeed rather than fail.
2004-02-22 02:11:39 +00:00
Hartmut Brandt 936d55b515 Fix a couple of potential buffer overflows.
Submitted by:	christer.oberg@texonet.com
2004-02-21 16:29:10 +00:00
Poul-Henning Kamp 1b105d0c6e Remove the triplicity in the public functions by vectoring them all
through a realloc like function.

Make the malloc_active variable a local static to this new function.

Don't warn about recursion more than once per base call.

constify malloc_func.
2004-02-21 09:14:38 +00:00
Poul-Henning Kamp 1044082184 Move the check for sensitive processes to the point where the exception
has been hit, this makes it cover more cases.

Call the message function directly rather than fiddle with flag-saving
when we find an unknown character in our options.

The 'A' flag should not trigger on legal out of memory conditions.
2004-02-21 08:55:38 +00:00
Hajimu UMEMOTO b8b31f33b1 add destination address selection support for getipnodebyname(3).
though getipnodebyname(3) is obsoleted api, some major applications
such as Mozilla are still using it.  so, it will help ipv4 users.
2004-02-20 17:59:33 +00:00
Ruslan Ermilov f3b6219857 Unbreak the upgrade path from 4.9 after removal of GNU getopt and
<gnuregex.h>.
2004-02-20 11:55:14 +00:00
Brian Feldman d1cd079e12 Document dependence of mktemp(3) on the non-reentrant arc4random(3). 2004-02-20 04:08:28 +00:00
Marcel Moolenaar 6b582d5433 Moving forward, there's no reason to exclude libpthread on sparc64. 2004-02-20 03:42:34 +00:00
Mike Makonnen d4d7df5c0c Implement PThreads barriers and barrier attributes. 2004-02-19 13:51:52 +00:00
Mike Makonnen 8c18819a81 Don't wake up the thread after the signal handler
has been executed. On return from the signal handler
the call will either be restarted or EINTR will be returned,
but it will not go back to its previous state. So, it is
sufficient to simply change the state to 'running' without
actually trying to wake up the thread.
2004-02-19 13:47:12 +00:00
Mike Makonnen 097c5e8da4 Remove thr_getschedparam.c since it's contents have been moved into
thr_setschedparam.c
2004-02-18 15:59:54 +00:00
Mike Makonnen 32eaa7dddd There are consumers of rwlocks, inluding our own libc, that depend on
a PTHREAD_RWLOCK_INITIALIZER to do for rwlocks what
a similarly named symbol does for statically initialized mutexes.
This symbol was dropped in The Open Group Base Specifications Issue 6
and does not exist in IEEE Std 1003.1, 2003, but it should still be
supported for backwards compatibility.

Pointy hat: mtm
2004-02-18 15:30:10 +00:00
Mike Makonnen b3d73b9b1e o Catch up with the mutex priority protocol fixes.
o Move pthread_getschedparam() into the same file with it's
  pthread_set* counterpart. Copyright on both files is identical.
2004-02-18 15:26:00 +00:00
Mike Makonnen b325a92087 o Style
o Instead of checking both the passed in pointer and its value
  for NULL, only check the latter. Any caller that passes in
  a NULL pointer is obviously wrong.
2004-02-18 15:22:52 +00:00
Mike Makonnen a561651c34 o Refactor and, among other things, get rid of insane nesting levels.
o Fix mutex priority protocols. Keep separate counts of priority
  inheritance and protection mutexes to make things easier.
  This will not have much affect since this is only the
  userland side, and the rest involves kernel scheduling.
2004-02-18 15:16:31 +00:00
Mike Makonnen 06e5becb69 Move the initialization of thread priority to a common function. 2004-02-18 15:05:56 +00:00
Mike Makonnen 0d48409fe2 Move the weak references to the top of the file to conform
to the format of other similar files in libthr.
2004-02-18 14:56:20 +00:00
David Schultz a94707138b Remove the code and an associated comment for gcc 1.x compatibility
and fix a typo in the !__GNUC__ case.
2004-02-16 10:03:02 +00:00
David Schultz 0f6da645e5 Fix a typo in the !__GNUC__ case and remove an obsolete comment. 2004-02-16 10:02:51 +00:00
David Schultz 36e22bed27 Fix some aliasing problems. 2004-02-16 10:02:40 +00:00
Tim Kientzle c56e5beb9c sys/types.h must be included before sys/acl.h,
as clearly documented in the acl manpage.

Thanks to bde for catching this blunder.
2004-02-12 20:35:59 +00:00
Tim Kientzle bcaf9acc49 Connect libarchive to the build. 2004-02-12 16:41:33 +00:00
Peter Grehan 88d2dd24fd Add forgotten IEEE functions. The Perl 5.8 port now compiles.
Submitted by: Suleiman Souhlal <refugee@segfaulted.com>
Obtained from:  NetBSD
2004-02-12 09:11:06 +00:00
Tim Kientzle 06d2a666e4 libarchive itself is now completely clean at WARNS=10 on all architectures.
Unfortunately, the stock zlib.h is not:
  line 885: 'err' parameter shadows global 'err' definition from <err.h>

Back the WARNS level down to 3 to accomodate borked zlib.h.
2004-02-12 04:11:40 +00:00
Maksim Yevmenkin e898d5ad97 Do not cast dval.
Make global _usage_page unsigned.

Reviewed by:	imp (mentor)
2004-02-11 21:09:13 +00:00
Dag-Erling Smørgrav 4d3d90ad0a Slight tweak to previous commit: don't forget to call _http_seterr() if
we get a genuine 416 reply.
2004-02-11 09:35:27 +00:00
Dag-Erling Smørgrav b5e1214546 When restarting a transfer that has already completed, the server will
reply with a 416 error code (requested range not satisfiable) because
we ask it to start at the end of the file.  Handle this gracefully by
considering a 416 reply a success if the requested offset exactly
matches the length of the file and the requested length is zero.
2004-02-11 09:31:39 +00:00
Dag-Erling Smørgrav 2576e45915 Re-wrap some comments. 2004-02-11 09:23:35 +00:00
Bruce M Simpson 1922fd129e Initial import of RFC 2385 (TCP-MD5) digest support.
This is the second of two commits; bring in the userland support to finish.

Teach libipsec and setkey about the tcp-md5 class of security associations,
thus allowing administrators to add per-host keys to the SADB for use by
the tcpsignature_compute() function.

Document that a single SPI must be used until such time as the code which
adds support to the SPD to specify flows for tcp-md5 treatment is suitable
for production.

Sponsored by:	sentex.net
2004-02-11 04:34:34 +00:00
Colin Percival 1c81bd2c60 style cleanup: Remove duplicate $FreeBSD$ tags.
These files had tags after teh copyright notice,
inside the comment block (incorrect, removed),
and outside the comment block (correct).

Approved by:	rwatson (mentor)
2004-02-10 20:45:28 +00:00