1
0
Fork 0
mirror of https://git.savannah.gnu.org/git/gdbm.git synced 2025-12-05 22:47:05 +00:00
No description
Find a file
Sergey Poznyakoff fb46d987d6 dump/load: correctly handle zero-length datum.
It had been reported that gdbm_load was unable to load ascii dumps
that contain zero-length keys.  Further investigation has shown that
the same is true for binary dumps as well.

This fix installs a workaround to handle such inputs, and fixes
gdbm_dump to unambiguously delimit parameter blocks on the output.
The modified ascii dump format is assigned version number 1.2.  It
is backward-compatible with 1.1, exept for the cases where the dump
contains zero-length data.  The exception does no harm, since prior
gdbm versions are not able to handle such cases anyway.

* src/gdbmdump.c (print_datum): Output empty comment for zero-length
datum.
(_gdbm_dump_ascii): Mark as version 1.2.
* src/gdbmimp.c (gdbm_import_from_file): Don't attempt to read zero
length data.
* src/gdbmload.c (get_data): Skip leading comment lines.
(get_parms): Stop reading if a comment is encountered.
Special handling for duplicate "len" parameter.
(read_record): Don't attempt to read zero length data.

* tests/t_dumpload.c: Add new tests for zero-length k/v.
* tests/emptydatum.at: New testcase.
* tests/Makefile.am: Add new test.
* tests/testsuite.at: Include new test.
2025-08-24 13:24:42 +03:00
compat Update copyright years 2025-03-03 19:58:15 +02:00
doc Version 1.25 2025-03-22 16:23:32 +02:00
fuzz Update copyright years 2025-03-03 19:58:15 +02:00
po Minor spelling fixes 2025-04-11 12:16:31 +03:00
src dump/load: correctly handle zero-length datum. 2025-08-24 13:24:42 +03:00
tests dump/load: correctly handle zero-length datum. 2025-08-24 13:24:42 +03:00
tools Fix column calculations in wordwrap 2025-04-11 11:08:17 +03:00
.gitignore Rearrange the directory structure 2021-11-20 08:59:03 +02:00
AUTHORS Initial revision 2008-11-21 21:33:39 +00:00
bootstrap Update copyright years 2025-03-03 19:58:15 +02:00
ChangeLog.cvs Generate ChangeLog from Git log 2016-07-07 22:58:04 +03:00
configure.ac Version 1.26 2025-07-30 13:17:28 +03:00
COPYING Update copyright headers. 2011-08-03 13:10:23 +00:00
Makefile.am Update copyright years 2025-03-03 19:58:15 +02:00
NEWS Version 1.26 2025-07-30 13:17:28 +03:00
NOTE-WARNING Update the docs 2021-10-17 12:21:08 +03:00
README Update copyright years 2025-03-03 19:58:15 +02:00
README-alpha Update copyright years 2025-03-03 19:58:15 +02:00
README-hacking Update copyright years 2025-03-03 19:58:15 +02:00
THANKS Update NEWS and THANKS 2025-02-06 14:59:19 +02:00

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

GNU dbm README
See the end of file for copying conditions.

* Introduction

This file contains brief information about configuring, testing
and using GNU dbm.  It is *not* intended as a replacement
for the documentation, instead it is provided as a brief reference
only. The complete documentation is available in doc/ subdirectory.
To read the manpage without installing the package use `man
doc/gdbm.3'.  To read texinfo documentation without installing the
package, run `info -f doc/gdbm.info'.  After the package is installed
the documentation can be accessed by running `man gdbm' and
`info gdbm'.

* Overview

GNU dbm is a set of database routines that use extendable hashing and
works similar to the standard UNIX dbm routines.  The library provides
also an optional compatibility layer for UNIX-like dbm and ndbm calls.

* Configuration

   a)  configure [PARAMETERS]
   b)  make 

For a list of generic PARAMETERS, see the file INCLUDE.  The gdbm-specific
parameters are:

** --enable-memory-mapped-io

Enable the use of mmap(2) for I/O optimizations.  This is the default,
if mmap is available.  To disable mmap, use --disable-memory-mapped-io.

** --enable-libgdbm-compat

Build and install libgdbm_compat, a compatibility layer which provides
UNIX-like dbm and ndbm interfaces.  It includes two header files:
dbm.h and ndbm.h, which are installed into $includedir.  If you wish
to install them elsewhere, define the variable COMPATINCLUDEDIR, e.g.

 ./configure --enable-libgdbm-compat COMPATINCLUDEDIR=/usr/include/gdbm

** --without-readline

Don't compile GNU Readline support.  By default, configure enables
line-editing support if GNU Readline is available on the system.

** --enable-gdbmtool-debug

This option instruments gdbmtool for additional debugging. Configured
with this option, gdbmtool accepts two additional arguments:
--lex-trace, which enables tracing the operation of the lexical
analyzer, and --gram-trace, which enables parser tracing output.

Note, that bison and flex must be installed for this option to take effect, 

* Installation 

  make install

This package also contains the 'magic' file for the file(1) utility -
src/gdbm.magic.  It is not installed by default, as its installation
location differs considerably between various distributions.  The most
straightforward (but not the best one) approach is appending its
content to /etc/magic:

  cat src/gdbm.magic >> /etc/magic

See the documentation in your distribution for detailed instructions
on how to install this file.
  
* Bug reporting

Please report bugs via email to <bug-gdbm@gnu.org>.  You can also use
bug-tracker at <https://puszcza.gnu.org.ua/bugs/?group=gdbm>.

* Documentation, updates etc.

For the latest updates, visit <http://www.gnu.org/software/gdbm>,

In particular, a copy of GDBM documentation in various formats is
available online at <https://www.gnu.org/software/gdbm/manual>.

Latest versions of GDBM can be downloaded from
<https://ftp.gnu.org/gnu/gdbm>.  You can also use anonymous fpt at
the same location, if you prefer.

To track the development, visit
<http://puszcza.gnu.org.ua/projects/gdbm>.


* Copyright information:

Copyright (C) 2011-2025 Free Software Foundation, Inc.

   Permission is granted to anyone to make or distribute verbatim copies
   of this document as received, in any medium, provided that the
   copyright notice and this permission notice are preserved,
   thus giving the recipient permission to redistribute in turn.

   Permission is granted to distribute modified versions
   of this document, or of portions of it,
   under the above conditions, provided also that they
   carry prominent notices stating who last changed them.


Local Variables:
mode: outline
paragraph-separate: "[ 	]*$"
version-control: never
End: