History log of /freebsd-10.0-release/lib/libc/db/hash/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


254289 13-Aug-2013 jilles

db: Use O_CLOEXEC instead of separate fcntl() call.


254222 11-Aug-2013 jilles

db/hash: Use O_CLOEXEC instead of separate fcntl() call.

In particular, a hash db is used by getpwnam() and getpwuid().

MFC after: 1 week


206178 05-Apr-2010 avg

libc/db/hash: cap auto-tuned block size with a value that actually works

This fix mostly matters after r206129 that made it possible for
st_blksize to be greater than 4K. For this reason, this change should
be MFC-ed before r206129.
Also, it seems that all FreeBSD uitlities that use db(3) hash databases
and create new databases in files, specify their own block size value
and thus do not depend on block size autotuning.

PR: bin/144446
Submitted by: Peter Jeremy <peterjeremy@acm.org>
MFC after: 5 days


196525 24-Aug-2009 delphij

Consider flag == 0 as the same of flag == R_NEXT. This change will restore
a historical behavior that has been changed by revision 190491, and has seen
to break exim.


190500 28-Mar-2009 delphij

Add some casts to silence compiler warning about signedness.


190498 28-Mar-2009 delphij

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


190496 28-Mar-2009 delphij

Plug memory leaks and a potential NULL dereference.

Obtained from: OpenBSD


190495 28-Mar-2009 delphij

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


190494 28-Mar-2009 delphij

- 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


190493 28-Mar-2009 delphij

Avoid NULL deference which causes DEBUG1 to crash, not to print useful
information.

Obtained from: OpenBSD


190492 28-Mar-2009 delphij

- 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


190491 28-Mar-2009 delphij

Fix a crash when iterating over a hash and removing its elements.

Obtained from: OpenBSD


190490 28-Mar-2009 delphij

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


190489 28-Mar-2009 delphij

Diff reduce against OpenBSD, no functional change.


190487 28-Mar-2009 delphij

Return meaningful errno in overflow case; print error message to stderr
in one more case.

Obtained from: NetBSD via OpenBSD


190486 28-Mar-2009 delphij

Use pread(2) and pwrite(2) instead of lseek(2) + read(2) / write(2).

Obtained from: NetBSD via OpenBSD


190485 28-Mar-2009 delphij

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


190484 28-Mar-2009 delphij

Several signed/unsigned warning fixes.


190482 28-Mar-2009 delphij

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).


189330 04-Mar-2009 delphij

Explicitly specify bit width for on-disk data structure.

Obtained from: OpenBSD


189327 04-Mar-2009 delphij

Style changes (including additional casts to shut up warnings). This
commit does not affect MD5 of object file.


189291 02-Mar-2009 delphij

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)


169979 25-May-2007 delphij

The usage of "info" in init_hash() is read-only, so constify
the internal interface instead of casting away the constant
constraint upon calling.


165903 09-Jan-2007 imp

Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.


135024 10-Sep-2004 kuriyama

Fix format strings to unbreak with -DDEBUG option.


111010 16-Feb-2003 nectar

Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go).
Only warnings that could be fixed without changing the generated object
code and without restructuring the source code have been handled.

Reviewed by: /sbin/md5


107052 18-Nov-2002 ru

libc_r wasn't so tied to libc for 22 months.


92991 22-Mar-2002 obrien

Fix the style of the SCM ID's.
I believe have made all of libc .h's as consistent as possible.


92986 22-Mar-2002 obrien

Fix the style of the SCM ID's.
I believe have made all of libc .c's as consistent as possible.


92941 22-Mar-2002 obrien

Remove multi-line __P() usage.


92905 21-Mar-2002 obrien

Remove __P() usage.


92889 21-Mar-2002 obrien

Remove 'register' keyword.


76613 15-May-2001 ru

Add new, from scratch implementation of hsearch() et al that actually works.

Obtained from: NetBSD
MFC after: 1 month


72092 06-Feb-2001 asmodai

Fix typo: compatability -> compatibility.

Compatability is not an existing english word.

Add $FreeBSD$.


71579 24-Jan-2001 deischen

Remove _THREAD_SAFE and make libc thread-safe by default by
adding (weak definitions to) stubs for some of the pthread
functions. If the threads library is linked in, the real
pthread functions will pulled in.

Use the following convention for system calls wrapped by the
threads library:
__sys_foo - actual system call
_foo - weak definition to __sys_foo
foo - weak definition to __sys_foo

Change all libc uses of system calls wrapped by the threads
library from foo to _foo. In order to define the prototypes
for _foo(), we introduce namespace.h and un-namespace.h
(suggested by bde). All files that need to reference these
system calls, should include namespace.h before any standard
includes, then include un-namespace.h after the standard
includes and before any local includes. <db.h> is an exception
and shouldn't be included in between namespace.h and
un-namespace.h namespace.h will define foo to _foo, and
un-namespace.h will undefine foo.

Try to eliminate some of the recursive calls to MT-safe
functions in libc/stdio in preparation for adding a mutex
to FILE. We have recursive mutexes, but would like to avoid
using them if possible.

Remove uneeded includes of <errno.h> from a few files.

Add $FreeBSD$ to a few files in order to pass commitprep.

Approved by: -arch


62684 06-Jul-2000 alfred

cleanup the tsearch import.

remove (comment out) functions defined or depricated elsewhere:
bsearch, lfind, lsearch, insque, remque

change hcreate to take a size_t rather than uint (essentially the same)

since hcreate/hdestroy are now in <search.h>, remove private search.h
in lib/libc/db/hash/

add $FreeBSD tags to hsearch.c


56698 27-Jan-2000 jasone

Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
just use _foo() <-- foo(). In the case of a libpthread that doesn't do
call conversion (such as linuxthreads and our upcoming libpthread), this
is adequate. In the case of libc_r, we still need three names, which are
now _thread_sys_foo() <-- _foo() <-- foo().

Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(),
nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo().

Remove all internal libc usage of: creat(), pause(), sleep(), system(),
tcdrain(), wait(), and waitpid().

Make thread cancellation fully POSIX-compliant.

Suggested by: deischen


55837 12-Jan-2000 jasone

Add three-tier symbol naming in support of POSIX thread cancellation
points. For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep(). The arrows represent weak aliases. For
system calls, the pattern is _read() <-- _libc_read() <-- read().


50476 28-Aug-1999 peter

$Id$ -> $FreeBSD$


25401 03-May-1997 jb

Changed all paths to be relative to src/lib instead of src/lib/libc
so that all these makefiles can be used to build libc_r too.

Added .if ${LIB} == "c" tests to restrict man page builds to libc
to avoid needlessly building them with libc_r too.

Split libc Makefile into Makefile and Makefile.inc to allow the
libc_r Makefile to include Makefile.inc too.


22736 15-Feb-1997 danny

Reviewed by: Bruce Evans <bde@freebsd.org>

Guard against possible buffer overrun in filename passed.
Another candidate for 2.2.


19029 19-Oct-1996 peter

Back out most of the last backout. :-) Guido removed the 1.1.1.1->1.1.1.2
changes from the vendor branch as well, backing the db-1.82 changes.

This file should now be the same as it was in rev 1.1.1.2.


19024 18-Oct-1996 guido

Backout bzero patch.

Somehow, I also managed to get quite some other changes in this file at
the same time. All I did was checkout the file and made a single change.
If someone has an explanation how these PURIFFY defines got in...


18997 17-Oct-1996 guido

When freeing buffers in the db routines, also zeroize them
This should solve the bug where a coredumping ftpd reveals
encrypted passwords.
Obtained from: OpenBSD


17235 21-Jul-1996 pst

Bring in fixes to db 1.85 from NetBSD. These fixes have been documented as
being sent back to Bostic by the NetBSD crew.
Obtained from: NetBSD-current


17141 12-Jul-1996 jkh

General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>


14287 27-Feb-1996 pst

Fix conflicts and merge into mainline


14273 27-Feb-1996 pst

This commit was generated by cvs2svn to compensate for changes in r14272,
which included commits to RCS files with non-trunk default branches.


14244 25-Feb-1996 pst

move stat behind open to cover corner case


14213 23-Feb-1996 pst

If a .db file is 0 length, initialize it as if it did not exist.
Reviewed by: wollman


13545 22-Jan-1996 julian

Reviewed by: julian and (hsu?)
Submitted by: John Birrel(L?)

changes for threadsafe operations


8870 30-May-1995 rgrimes

Remove trailing whitespace.


1574 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1573,
which included commits to RCS files with non-trunk default branches.