Commit Graph

6013 Commits

Author SHA1 Message Date
kib
e965f0a26d Unconditionally build wrappers for i386_get_ioperm(), i386_set_ioperm(),
i386_get_ldt() and i386_set_ldt().

In collaboration with:	pho
Reviewed by:	jhb
2009-04-01 19:23:46 +00:00
kib
2b9fbfce36 Document RTLD_NODELETE, -z nodelete and -z origin support. 2009-04-01 14:38:20 +00:00
ume
cb768e2631 Query DNS only once per an address family.
Obtained from:	KAME
MFC after:	2 weeks
2009-03-29 17:55:11 +00:00
delphij
fc0a0dc5f6 Add some casts to silence compiler warning about signedness. 2009-03-28 07:44:08 +00:00
delphij
1db7e98746 Minor changes from Berkeley DB 1.86 and further improvements from OpenBSD.
This does not include the new hash routines since they will cause problems
when reading old hash files.

Since mpool(3) has been changed, provide a compatibility shim for older
binaries.

Obtained from:	OpenBSD
2009-03-28 07:31:02 +00:00
delphij
2ca1d8e1e9 Allow O_SYNC and O_NOFOLLOW flags in dbopen().
Obtained from:	OpenBSD
2009-03-28 07:26:00 +00:00
delphij
b4ced14429 Plug memory leaks and a potential NULL dereference.
Obtained from:	OpenBSD
2009-03-28 07:20:39 +00:00
delphij
67cfc8aca6 Simplify the logic when determining whether to zero out a db file to after
open().  The previous logic only initializes the database when O_CREAT is
set, but as long as we can open and write the database, and the database
is empty, we should initialize it anyway.

Obtained from:	OpenBSD
2009-03-28 07:09:51 +00:00
delphij
643b09b140 - If (keysize+datasize)%(bsize=14)==0, insertion of a `big key' would cause
an invariant (actually, an ugly hack) to fail, and all Hell would break
   loose.

   When deleting a big key, the offset of an empty page should be bsize, not
   bsize-1; otherwise an insertion into the empty page will cause the new key to
   be elongated by 1 byte.

   Make the packing more dense in a couple of cases.

 - fix NULL dereference exposed on big bsize values;

Obtained from:	NetBSD via OpenBSD
2009-03-28 06:47:05 +00:00
delphij
e486185356 Avoid NULL deference which causes DEBUG1 to crash, not to print useful
information.

Obtained from:	OpenBSD
2009-03-28 06:40:48 +00:00
delphij
8d5f207dd1 - Avoid overwriting the cursor page when the cursor page becomes the
LRU page.
 - Fix for sequential retrieval failure when using large key/data pairs.

Obtained from:	OpenBSD
2009-03-28 06:38:31 +00:00
delphij
be23f69f40 Fix a crash when iterating over a hash and removing its elements.
Obtained from:	OpenBSD
2009-03-28 06:30:43 +00:00
delphij
7a713ce8b4 Only squeeze a short key/value pair onto a page with other complete key/value
pairs, not onto a page containing the end of a big pair.

Obtained from:	NetBSD via OpenBSD
2009-03-28 06:25:33 +00:00
delphij
1f25699513 Diff reduce against OpenBSD, no functional change. 2009-03-28 06:23:10 +00:00
delphij
b0050a5c17 Return meaningful errno in overflow case; print error message to stderr
in one more case.

Obtained from:	NetBSD via OpenBSD
2009-03-28 06:12:39 +00:00
delphij
f7cf5b5c6b Use pread(2) and pwrite(2) instead of lseek(2) + read(2) / write(2).
Obtained from:	NetBSD via OpenBSD
2009-03-28 06:05:53 +00:00
delphij
13f44a2a24 db/btree/bt_open.c: check return value of snprintf() and return value
if the result is truncated.

db/hash/hash_page.c: use the same way to create temporary file as
bt_open.c; check snprintf() return value.

Obtained from:	OpenBSD
2009-03-28 05:57:27 +00:00
delphij
21b00fc42b Several signed/unsigned warning fixes. 2009-03-28 05:45:29 +00:00
delphij
38e77f4482 When allocating memory, zero out them if we don't intend to overwrite them
all; before freeing memory, zero out them before we release it as free
heap.  This will eliminate some potential information leak issue.

While there, remove the PURIFY option.  There is a slight difference between
the new behavior and the old -DPURIFY behavior, with the latter initializes
memory with 0xff's.  The difference between old and new approach does not
generate observable difference.

Obtained from:	OpenBSD (partly).
2009-03-28 04:00:46 +00:00
dds
f8bd382c24 Document missing requests. 2009-03-27 11:03:02 +00:00
ume
b9602dae34 Add support for SCTP to getaddrinfo(3).
Now, getaddrinfo(3) returns two SOCK_STREAMs, IPPROTO_TCP and
IPPROTO_SCTP.  It confuses some programs.  If getaddrinfo(3) returns
IPPROTO_SCTP when SOCK_STREAM is specified by hints.ai_socktype, at
least Apache doesn't work.  So, I made getaddrinfo(3) to return
IPPROTO_SCTP with SOCK_STREAM only when IPPROTO_SCTP is specified
explicitly by hints.ai_protocol.

PR:		bin/128167
Submitted by:	Bruce Cran <bruce__at__cran.org.uk> (partly)
MFC after:	2 week
2009-03-25 16:23:43 +00:00
netchild
6273335e54 Improve the German translation.
Some parts (ERANGE, ETXTBSY) triggered by Christoph Mallon.

Discussed with:	brueffer, gabor (previous version)
2009-03-25 12:36:37 +00:00
gabor
6e4ec9f54d - Add Belarusian catalog
PR:		conf/133004
Submitted by:	Tatsiana Elavaya <t.elavaya@gmail.com>
2009-03-24 23:31:41 +00:00
ume
9572ca2bf0 getaddrinfo(3) should accept numeric when ai_socktype is not
specified in hint or hints is NULL.

PR:		bin/51827
Submitted by:	Mark Andrews <marka__at__isc.org>
MFC after:	1 week
2009-03-24 17:47:24 +00:00
delphij
78c7bc43de Save errno before calling _close(), which may clear it.
Obtained from:	OpenBSD
2009-03-23 23:43:07 +00:00
delphij
58a5285ab7 use more proper format string.
Obtained from:	NetBSD via OpenBSD
2009-03-23 23:22:09 +00:00
kib
3460a89ecb 7.2 will be the first release where strndup() appears.
Submitted by:	Florian Smeets <flo kasimir com>
MFC after:	3 days
2009-03-22 15:29:12 +00:00
maxim
8215a8427b o Spell. 2009-03-21 10:10:33 +00:00
gabor
930d8468b2 - Add Ukranian catalog
Submitted by:	Alex Kozlov <spam@rm-rf.kiev.ua> (via private mail)
2009-03-20 23:55:01 +00:00
gabor
79d9ed6723 - Fix typo
PR:		kern/132773
Reported by:	Alan R. S. Bueno <alan.bsd@gmail.com>
Submitted by:	Murilo Opsfelder <mopsfelder@gmail.com>
2009-03-18 14:33:10 +00:00
gabor
cd56ced92d - Add Brazilian Portuguese catalog [1]
- Fixes for German catalog [2]

PR:		kern/132694 [1], conf/80504 [2]
Submitted by:	Murilo Opsfelder <mopsfelder@gmail.com> [1],
		brueffer [2]
2009-03-16 16:33:08 +00:00
gabor
0592710988 - Create the buildworld object directories with mtree instead of various
mkdir calls
- Remove the ugly workaroung from libc NLS, which was to create some of
  these directories
2009-03-15 13:14:06 +00:00
gabor
2bf7071f66 - Fix object directory creation when running threaded buildworld 2009-03-13 22:41:30 +00:00
gabor
a9bdc02cf2 - Reenable Native Language Support in libc. This feature was disabled due
to possible breakages in the catalog handling code.  Since then, that
  code has been replaced by the secure code from NetBSD but NLS in libc
  remained turned off.  Tests have shown that the feature is stable and
  working so we can now turn it on again.

- Add several new catalog files:
  - ca_ES.ISO8859-1
  - de_DE.ISO8859-1
  - el_GR.ISO8859-7  (by manolis@ and keramida@)
  - es_ES.ISO8859-1  (kern/123179, by carvay@)
  - fi_FI.ISO8859-1
  - fr_FR.ISO8859-1  (kern/78756, by thierry@)
  - hu_HU.ISO8859-2  (by gabor@)
  - it_IT.ISO8859-15
  - nl_NL.ISO8859-1  (corrections by rene@)
  - no_NO.ISO8859-1
  - mn_MN.UTF-8      (by ganbold@)
  - sk_SK.ISO8859-2
  - sv_SE.ISO8859-1
  (The catalogs without explicit source has been obtained from NetBSD.)

Approved by:	attilio
2009-03-13 10:40:38 +00:00
delphij
e7929cb0bc Reflect license change from NetBSD.
Obtained from:	NetBSD
2009-03-10 21:13:26 +00:00
kib
9d2aa84a7a Hopefully, improve the grammar and wording in the changes to shmctl(2)
manpage and UPDATING entry 20090302.

UPDATING changes suggested by bf2006a yahoo com.
man page corrections by bde.
2009-03-05 12:04:42 +00:00
delphij
02654885c3 Our realloc(3) and reallocf(3) can handle NULL, which turns it into a
malloc(3) call, so don't test if a pointer is NULL.

Obtained from:	OpenBSD (in spirit)
2009-03-05 00:57:01 +00:00
das
e609fbb43b Add wcpcpy(3) and wcpncpy(3). 2009-03-04 06:01:27 +00:00
das
d92111a8dc Add dprintf() and vdprintf() from POSIX.1-2008. Like getline(),
dprintf() is a simple wrapper around another function, so we may as
well implement it. But also like getline(), we can't prototype it by
default right now because it would break too many ports.
2009-03-04 03:38:51 +00:00
das
9dd8da86ee Fix a file descriptor leak in fts_child().
Obtained from:	NetBSD
2009-03-04 03:30:21 +00:00
bms
0d63b902b4 Considerably improve the wording of this man page. 2009-03-04 01:59:14 +00:00
bms
76de7f52e0 Update copyright. 2009-03-04 01:58:48 +00:00
delphij
5e2baa07da Explicitly specify bit width for on-disk data structure.
Obtained from:	OpenBSD
2009-03-04 01:17:05 +00:00
delphij
086696e18d Sync license changes.
Obtained from:	NetBSD
2009-03-04 01:01:26 +00:00
delphij
60ee3b72bf Style changes (including additional casts to shut up warnings). This
commit does not affect MD5 of object file.
2009-03-04 00:58:04 +00:00
delphij
f90b85d3ba Rename variable 'index' to 'idx' to avoid name collision with index(3),
this commit does not affect any object code.

Obtained from:	OpenBSD
Verified with:	md5(1)
2009-03-03 02:16:12 +00:00
delphij
7fd77a056c Diff reduction against OpenBSD: ANSI'fy prototypes.
(This is part of a larger changeset which is intended to reduce diff only,
thus some prototypes were left intact since they will be changed in the
future).

Verified with:	md5(1)
2009-03-02 23:47:18 +00:00
kib
453adb14fb Correct types of variables used to track amount of allocated SysV shared
memory from int to size_t. Implement a workaround for current ABI not
allowing to properly save size for and report more then 2Gb sized segment
of shared memory.

This makes it possible to use > 2 Gb shared memory segments on 64bit
architectures. Please note the new BUGS section in shmctl(2) and
UPDATING note for limitations of this temporal solution.

Reviewed by:	csjp
Tested by:	Nikolay Dzham <i levsha org ua>
MFC after:	2 weeks
2009-03-02 18:53:30 +00:00
das
57e007ca3f Rewrite asprintf() as a wrapper around vasprintf(), thus reducing the
number of functions that have an incestuous relationship with the
arcane innards of stdio.
2009-03-02 04:11:42 +00:00
das
f45a0d48ab The argument corresponding to %zn is supposed to be an ssize_t *, not
a size_t *, although the distinction is moot in practice.
2009-03-02 04:07:58 +00:00