Newer upstream release
This commit is contained in:
parent
01330c93af
commit
d650a25e66
@ -1 +1 @@
|
||||
gdbm-1.8.0.tar.gz
|
||||
gdbm-1.8.3.tar.gz
|
||||
|
@ -1,64 +0,0 @@
|
||||
diff -buNr gdbm-1.8.0.orig/falloc.c gdbm-1.8.0/falloc.c
|
||||
--- gdbm-1.8.0.orig/falloc.c Tue May 18 20:16:06 1999
|
||||
+++ gdbm-1.8.0/falloc.c Thu Apr 25 18:20:45 2002
|
||||
@@ -180,6 +180,13 @@
|
||||
avail_block *new_blk;
|
||||
int index;
|
||||
|
||||
+ if (dbf->header->avail.count == dbf->header->avail.size)
|
||||
+ {
|
||||
+ /* We're kind of stuck here, so we re-split the header in order to
|
||||
+ avoid crashing. Sigh. */
|
||||
+ push_avail_block(dbf);
|
||||
+ }
|
||||
+
|
||||
/* Set up variables. */
|
||||
new_el.av_adr = dbf->header->avail.next_block;
|
||||
new_el.av_size = ( ( (dbf->header->avail.size * sizeof (avail_elem)) >> 1)
|
||||
@@ -196,12 +203,24 @@
|
||||
if (num_bytes != new_el.av_size) _gdbm_fatal (dbf, "read error");
|
||||
|
||||
/* Add the elements from the new block to the header. */
|
||||
- for (index = 0; index < new_blk->count; index++)
|
||||
+ index = 0;
|
||||
+ while (index < new_blk->count)
|
||||
+ {
|
||||
+ while(index < new_blk->count
|
||||
+ && dbf->header->avail.count < dbf->header->avail.size)
|
||||
{
|
||||
/* With luck, this will merge a lot of blocks! */
|
||||
_gdbm_put_av_elem(new_blk->av_table[index],
|
||||
dbf->header->avail.av_table,
|
||||
- &dbf->header->avail.count, dbf->coalesce_blocks);
|
||||
+ &dbf->header->avail.count, TRUE);
|
||||
+ index++;
|
||||
+ }
|
||||
+ if (dbf->header->avail.count == dbf->header->avail.size)
|
||||
+ {
|
||||
+ /* We're kind of stuck here, so we re-split the header in order to
|
||||
+ avoid crashing. Sigh. */
|
||||
+ push_avail_block(dbf);
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Fix next_block, as well. */
|
||||
@@ -210,9 +229,17 @@
|
||||
/* We changed the header. */
|
||||
dbf->header_changed = TRUE;
|
||||
|
||||
- /* Free the previous avail block. */
|
||||
+ /* Free the previous avail block. It is possible that the header table
|
||||
+ is now FULL, which will cause us to overflow it! */
|
||||
+ if (dbf->header->avail.count == dbf->header->avail.size)
|
||||
+ {
|
||||
+ /* We're kind of stuck here, so we re-split the header in order to
|
||||
+ avoid crashing. Sigh. */
|
||||
+ push_avail_block(dbf);
|
||||
+ }
|
||||
+
|
||||
_gdbm_put_av_elem (new_el, dbf->header->avail.av_table,
|
||||
- &dbf->header->avail.count, dbf->coalesce_blocks);
|
||||
+ &dbf->header->avail.count, TRUE);
|
||||
free (new_blk);
|
||||
}
|
||||
|
@ -1,96 +0,0 @@
|
||||
2009-02-27 Stepan Kasal <skasal@redhat.com>
|
||||
|
||||
* Makefile.in: respect the *dir variables as set by configure;
|
||||
clean up.
|
||||
|
||||
--- gdbm-1.8.0/Makefile.in.fhs 1999-05-19 05:16:06.000000000 +0200
|
||||
+++ gdbm-1.8.0/Makefile.in 2009-02-27 18:52:19.000000000 +0100
|
||||
@@ -1,7 +1,7 @@
|
||||
#### Start of system configuration section. ####
|
||||
|
||||
srcdir = @srcdir@
|
||||
-top_builddir = @srcdir@
|
||||
+top_builddir = @top_builddir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
CC = @CC@
|
||||
@@ -14,36 +14,29 @@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
|
||||
-# File ownership and group
|
||||
-BINOWN = bin
|
||||
-BINGRP = bin
|
||||
-
|
||||
MAKEINFO = makeinfo
|
||||
TEXI2DVI = texi2dvi
|
||||
|
||||
-DEFS =
|
||||
+DEFS = @DEFS@
|
||||
|
||||
# Where the system [n]dbm routines are...
|
||||
-LIBS = @LIBS@ -lc
|
||||
+LIBS = @LIBS@
|
||||
|
||||
# SunOS 4 users might wish to add '-fpcc-struct-return' to CFLAGS. see INSTALL.
|
||||
-CFLAGS = -O
|
||||
-LDFLAGS =
|
||||
+CPPFLAGS = @CPPFLAGS@
|
||||
+CFLAGS = @CFLAGS@
|
||||
+LDFLAGS = @LDFLAGS@
|
||||
|
||||
# Common prefix for installation directories
|
||||
-prefix = /usr/local
|
||||
-exec_prefix = $(prefix)
|
||||
-binprefix = $(exec_prefix)
|
||||
-manprefix = $(prefix)
|
||||
-
|
||||
-# Directory in which to put libgdbm.a.
|
||||
-libdir = $(exec_prefix)/lib
|
||||
-# The include directory for gdbm.h and dbm.h.
|
||||
-includedir = $(prefix)/include
|
||||
-# Info and man directories.
|
||||
-infodir = $(prefix)/info
|
||||
-man3dir = $(prefix)/man/man3
|
||||
-manext = 3
|
||||
+prefix = @prefix@
|
||||
+exec_prefix = @exec_prefix@
|
||||
+datarootdir = @datarootdir@
|
||||
+mandir = @mandir@
|
||||
+libdir = @libdir@
|
||||
+includedir = @includedir@
|
||||
+pkgincludedir = $(includedir)/gdbm
|
||||
+infodir = @infodir@
|
||||
+man3dir = $(mandir)/man3
|
||||
|
||||
#### End of system configuration section. ####
|
||||
|
||||
@@ -120,20 +113,16 @@
|
||||
progs: $(PROGS)
|
||||
|
||||
install: libgdbm.la gdbm.h gdbm.info
|
||||
- $(srcdir)/mkinstalldirs $(libdir) $(includedir) $(man3dir) $(infodir)
|
||||
- $(LIBTOOL) install -c libgdbm.la $(libdir)/libgdbm.la
|
||||
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) gdbm.h $(includedir)/gdbm.h
|
||||
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.3 \
|
||||
- $(man3dir)/gdbm.3
|
||||
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.info \
|
||||
- $(infodir)/gdbm.info
|
||||
+ $(srcdir)/mkinstalldirs $(libdir) $(pkgincludedir) $(man3dir) $(infodir)
|
||||
+ $(LIBTOOL) install install libgdbm.la $(libdir)/libgdbm.la
|
||||
+ $(INSTALL_DATA) gdbm.h $(pkgincludedir)/gdbm.h
|
||||
+ $(INSTALL_DATA) $(srcdir)/gdbm.3 $(man3dir)/gdbm.3
|
||||
+ $(INSTALL_DATA) $(srcdir)/gdbm.info $(infodir)/gdbm.info
|
||||
|
||||
install-compat:
|
||||
- $(srcdir)/mkinstalldirs $(includedir)
|
||||
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/dbm.h \
|
||||
- $(includedir)/dbm.h
|
||||
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/ndbm.h \
|
||||
- $(includedir)/ndbm.h
|
||||
+ $(srcdir)/mkinstalldirs $(pkgincludedir)
|
||||
+ $(INSTALL_DATA) $(srcdir)/dbm.h $(pkgincludedir)/dbm.h
|
||||
+ $(INSTALL_DATA) $(srcdir)/ndbm.h $(pkgincludedir)/ndbm.h
|
||||
|
||||
#libgdbm.a: $(OBJS) gdbm.h
|
||||
# rm -f libgdbm.a
|
@ -1,11 +0,0 @@
|
||||
--- gdbm-1.8.0/gdbmopen.c.jbj Tue Aug 10 10:57:38 1999
|
||||
+++ gdbm-1.8.0/gdbmopen.c Tue Aug 10 10:59:06 1999
|
||||
@@ -214,7 +214,7 @@
|
||||
file_block_size = block_size;
|
||||
|
||||
/* Get space for the file header. */
|
||||
- dbf->header = (gdbm_file_header *) malloc (file_block_size);
|
||||
+ dbf->header = (gdbm_file_header *) calloc (1, file_block_size);
|
||||
if (dbf->header == NULL)
|
||||
{
|
||||
gdbm_close (dbf);
|
138
gdbm-1.8.3-fhs.patch
Normal file
138
gdbm-1.8.3-fhs.patch
Normal file
@ -0,0 +1,138 @@
|
||||
diff -up gdbm-1.8.3/Makefile.in.fhs gdbm-1.8.3/Makefile.in
|
||||
--- gdbm-1.8.3/Makefile.in.fhs 2002-10-08 18:09:12.000000000 +0200
|
||||
+++ gdbm-1.8.3/Makefile.in 2010-03-10 15:41:01.516025096 +0100
|
||||
@@ -1,7 +1,7 @@
|
||||
#### Start of system configuration section. ####
|
||||
|
||||
srcdir = @srcdir@
|
||||
-top_builddir = .
|
||||
+top_builddir = @top_builddir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
CC = @CC@
|
||||
@@ -14,17 +14,13 @@ INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
|
||||
-# File ownership and group
|
||||
-BINOWN = bin
|
||||
-BINGRP = bin
|
||||
-
|
||||
MAKEINFO = makeinfo
|
||||
TEXI2DVI = texi2dvi
|
||||
|
||||
-DEFS =
|
||||
+DEFS = @DEFS@
|
||||
|
||||
# Where the system [n]dbm routines are...
|
||||
-LIBS = @LIBS@ -lc
|
||||
+LIBS = @LIBS@
|
||||
|
||||
CFLAGS = @CFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
@@ -32,16 +28,17 @@ LDFLAGS = @LDFLAGS@
|
||||
# Common prefix for installation directories
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
-binprefix = $(exec_prefix)
|
||||
-manprefix = $(prefix)
|
||||
+datarootdir = @datarootdir@
|
||||
|
||||
# Directory in which to put libgdbm.a.
|
||||
libdir = @libdir@
|
||||
# The include directory for gdbm.h and dbm.h.
|
||||
includedir = @includedir@
|
||||
+pkgincludedir = $(includedir)/gdbm
|
||||
# Info and man directories.
|
||||
infodir = @infodir@
|
||||
-man3dir = @mandir@/man3
|
||||
+mandir = @mandir@
|
||||
+man3dir = $(mandir)/man3
|
||||
manext = 3
|
||||
|
||||
#### End of system configuration section. ####
|
||||
@@ -57,7 +54,7 @@ manext = 3
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
-PROGS = libgdbm.la testgdbm testdbm testndbm tndbm tdbm conv2gdbm
|
||||
+PROGS = libgdbm.la testgdbm testdbm testndbm conv2gdbm
|
||||
|
||||
DBM_CF = dbminit.c delete.c fetch.c store.c seq.c close.c
|
||||
|
||||
@@ -127,26 +124,17 @@ all: libgdbm.la libgdbm_compat.la
|
||||
progs: $(PROGS)
|
||||
|
||||
install: libgdbm.la gdbm.h gdbm.info
|
||||
- $(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
|
||||
- $(INSTALL_ROOT)$(includedir) $(INSTALL_ROOT)$(man3dir) \
|
||||
- $(INSTALL_ROOT)$(infodir)
|
||||
- $(LIBTOOL) $(INSTALL) -c libgdbm.la $(INSTALL_ROOT)$(libdir)/libgdbm.la
|
||||
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) gdbm.h \
|
||||
- $(INSTALL_ROOT)$(includedir)/gdbm.h
|
||||
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.3 \
|
||||
- $(INSTALL_ROOT)$(man3dir)/gdbm.3
|
||||
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.info \
|
||||
- $(INSTALL_ROOT)$(infodir)/gdbm.info
|
||||
+ $(srcdir)/mkinstalldirs $(libdir) $(pkgincludedir) $(man3dir) $(infodir)
|
||||
+ $(LIBTOOL) install install libgdbm.la $(libdir)/libgdbm.la
|
||||
+ $(INSTALL_DATA) gdbm.h $(pkgincludedir)/gdbm.h
|
||||
+ $(INSTALL_DATA) $(srcdir)/gdbm.3 $(man3dir)/gdbm.3
|
||||
+ $(INSTALL_DATA) $(srcdir)/gdbm.info $(infodir)/gdbm.info
|
||||
|
||||
install-compat:
|
||||
- $(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
|
||||
- $(INSTALL_ROOT)$(includedir)
|
||||
- $(LIBTOOL) $(INSTALL) -c libgdbm_compat.la \
|
||||
- $(INSTALL_ROOT)$(libdir)/libgdbm_compat.la
|
||||
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/dbm.h \
|
||||
- $(INSTALL_ROOT)$(includedir)/dbm.h
|
||||
- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/ndbm.h \
|
||||
- $(INSTALL_ROOT)$(includedir)/ndbm.h
|
||||
+ $(srcdir)/mkinstalldirs $(libdir) $(pkgincludedir)
|
||||
+ $(LIBTOOL) install install libgdbm_compat.la $(libdir)/libgdbm_compat.la
|
||||
+ $(INSTALL_DATA) $(srcdir)/dbm.h $(pkgincludedir)/dbm.h
|
||||
+ $(INSTALL_DATA) $(srcdir)/ndbm.h $(pkgincludedir)/ndbm.h
|
||||
|
||||
#libgdbm.a: $(OBJS) gdbm.h
|
||||
# rm -f libgdbm.a
|
||||
@@ -161,7 +149,7 @@ libgdbm.la: $(LOBJS) gdbm.h
|
||||
libgdbm_compat.la: $(C_LOBJS) gdbm.h
|
||||
rm -f libgdbm_compat.la
|
||||
$(LIBTOOL) --mode=link $(CC) -o libgdbm_compat.la -rpath $(libdir) \
|
||||
- -version-info $(SHLIB_VER) $(C_LOBJS)
|
||||
+ -version-info $(SHLIB_VER) $(C_LOBJS) -lgdbm
|
||||
|
||||
gdbm.h: gdbm.proto gdbmerrno.h gdbm.proto2
|
||||
rm -f gdbm.h
|
||||
@@ -172,10 +160,10 @@ gdbm.h: gdbm.proto gdbmerrno.h gdbm.prot
|
||||
chmod -w gdbm.h
|
||||
|
||||
testgdbm: testgdbm.o libgdbm.la @LIBOBJS@
|
||||
- $(LIBTOOL) $(CC) $(LDFLAGS) -o testgdbm testgdbm.o libgdbm.la @LIBOBJS@
|
||||
+ $(LIBTOOL) link $(CC) $(LDFLAGS) -o testgdbm testgdbm.o libgdbm.la @LIBOBJS@
|
||||
|
||||
testdbm: testdbm.o libgdbm.la libgdbm_compat.la
|
||||
- $(LIBTOOL) $(CC) $(LDFLAGS) -o testdbm testdbm.o libgdbm.la libgdbm_compat.la
|
||||
+ $(LIBTOOL) link $(CC) $(LDFLAGS) -o testdbm testdbm.o $(LIBS) libgdbm_compat.la
|
||||
|
||||
tdbm: testdbm.o
|
||||
$(CC) $(LDFLAGS) -o tdbm testdbm.o $(LIBS)
|
||||
@@ -184,7 +172,7 @@ testndbm.o: testndbm.c
|
||||
$(CC) -c -I. -I$(srcdir) $(CFLAGS) $(DEFS) -DGNU $(srcdir)/testndbm.c
|
||||
|
||||
testndbm: testndbm.o libgdbm.la libgdbm_compat.la
|
||||
- $(LIBTOOL) $(CC) $(LDFLAGS) -o testndbm testndbm.o libgdbm.la libgdbm_compat.la
|
||||
+ $(LIBTOOL) link $(CC) $(LDFLAGS) -o testndbm testndbm.o libgdbm_compat.la
|
||||
|
||||
tndbm.o: testndbm.c
|
||||
cp $(srcdir)/testndbm.c ./tndbm.c
|
||||
@@ -195,7 +183,7 @@ tndbm: tndbm.o
|
||||
$(CC) $(LDFLAGS) -o tndbm tndbm.o $(LIBS)
|
||||
|
||||
conv2gdbm: conv2gdbm.o libgdbm.la @LIBOBJS@
|
||||
- $(LIBTOOL) $(CC) $(LDFLAGS) -o conv2gdbm conv2gdbm.o $(LIBS) libgdbm.la @LIBOBJS@
|
||||
+ $(LIBTOOL) link $(CC) $(LDFLAGS) -o conv2gdbm conv2gdbm.o $(LIBS) libgdbm_compat.la @LIBOBJS@
|
||||
|
||||
lintgdbm:
|
||||
lint $(DEFS) $(LFLAGS) $(DBM_CF) $(NDBM_CF) $(GDBM_CF) testgdbm.c
|
113
gdbm-1.8.3-shortread.patch
Normal file
113
gdbm-1.8.3-shortread.patch
Normal file
@ -0,0 +1,113 @@
|
||||
05_handle-short-read.patch
|
||||
|
||||
diff -urNad a/bucket.c b/bucket.c
|
||||
--- a/bucket.c 1999-05-19 01:16:05.000000000 +0100
|
||||
+++ b/bucket.c 2006-04-24 03:18:01.000000000 +0100
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "autoconf.h"
|
||||
|
||||
#include "gdbmdefs.h"
|
||||
-
|
||||
+#include <errno.h>
|
||||
|
||||
/* Initializing a new hash buckets sets all bucket entries to -1 hash value. */
|
||||
void
|
||||
@@ -68,7 +68,8 @@
|
||||
int dir_index;
|
||||
{
|
||||
off_t bucket_adr; /* The address of the correct hash bucket. */
|
||||
- int num_bytes; /* The number of bytes read. */
|
||||
+ int num_bytes = 0; /* The total number of bytes read. */
|
||||
+ int bytes_read; /* Number of bytes read in this syscall */
|
||||
off_t file_pos; /* The return address for lseek. */
|
||||
register int index; /* Loop index. */
|
||||
|
||||
@@ -111,7 +112,12 @@
|
||||
if (file_pos != bucket_adr)
|
||||
_gdbm_fatal (dbf, "lseek error");
|
||||
|
||||
- num_bytes = read (dbf->desc, dbf->bucket, dbf->header->bucket_size);
|
||||
+ do
|
||||
+ {
|
||||
+ bytes_read = read (dbf->desc, dbf->bucket+num_bytes, dbf->header->bucket_size-num_bytes);
|
||||
+ if (bytes_read > 0) num_bytes += bytes_read;
|
||||
+ }
|
||||
+ while ((bytes_read > 0 || (bytes_read == -1 && errno == EINTR)) && num_bytes < dbf->header->bucket_size);
|
||||
if (num_bytes != dbf->header->bucket_size)
|
||||
_gdbm_fatal (dbf, "read error");
|
||||
}
|
||||
diff -urNad a/falloc.c b/falloc.c
|
||||
--- a/falloc.c 2006-04-24 03:17:54.000000000 +0100
|
||||
+++ b/falloc.c 2006-04-24 03:18:01.000000000 +0100
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "autoconf.h"
|
||||
|
||||
#include "gdbmdefs.h"
|
||||
-
|
||||
+#include <errno.h>
|
||||
|
||||
/* The forward definitions for this file. See the functions for
|
||||
the definition of the function. */
|
||||
@@ -174,7 +174,8 @@
|
||||
pop_avail_block (dbf)
|
||||
gdbm_file_info *dbf;
|
||||
{
|
||||
- int num_bytes; /* For use with the read system call. */
|
||||
+ int num_bytes = 0; /* For use with the read system call. */
|
||||
+ int bytes_read; /* For use with the read system call. */
|
||||
off_t file_pos; /* For use with the lseek system call. */
|
||||
avail_elem new_el;
|
||||
avail_block *new_blk;
|
||||
@@ -199,7 +200,12 @@
|
||||
/* Read the block. */
|
||||
file_pos = lseek (dbf->desc, new_el.av_adr, L_SET);
|
||||
if (file_pos != new_el.av_adr) _gdbm_fatal (dbf, "lseek error");
|
||||
- num_bytes = read (dbf->desc, new_blk, new_el.av_size);
|
||||
+ do
|
||||
+ {
|
||||
+ bytes_read = read (dbf->desc, new_blk+num_bytes, new_el.av_size-num_bytes);
|
||||
+ if (bytes_read > 0) num_bytes += bytes_read;
|
||||
+ }
|
||||
+ while ((bytes_read > 0 || (bytes_read == -1 && errno == EINTR)) && num_bytes < new_el.av_size);
|
||||
if (num_bytes != new_el.av_size) _gdbm_fatal (dbf, "read error");
|
||||
|
||||
/* Add the elements from the new block to the header. */
|
||||
diff -urNad a/findkey.c b/findkey.c
|
||||
--- a/findkey.c 1999-05-19 01:16:06.000000000 +0100
|
||||
+++ b/findkey.c 2006-04-24 03:18:01.000000000 +0100
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "autoconf.h"
|
||||
|
||||
#include "gdbmdefs.h"
|
||||
+#include <errno.h>
|
||||
|
||||
|
||||
/* Read the data found in bucket entry ELEM_LOC in file DBF and
|
||||
@@ -41,11 +42,12 @@
|
||||
gdbm_file_info *dbf;
|
||||
int elem_loc;
|
||||
{
|
||||
- int num_bytes; /* For seeking and reading. */
|
||||
+ int num_bytes = 0; /* For seeking and reading. */
|
||||
int key_size;
|
||||
int data_size;
|
||||
off_t file_pos;
|
||||
data_cache_elem *data_ca;
|
||||
+ int bytes_read;
|
||||
|
||||
/* Is it already in the cache? */
|
||||
if (dbf->cache_entry->ca_data.elem_loc == elem_loc)
|
||||
@@ -74,7 +76,12 @@
|
||||
dbf->bucket->h_table[elem_loc].data_pointer, L_SET);
|
||||
if (file_pos != dbf->bucket->h_table[elem_loc].data_pointer)
|
||||
_gdbm_fatal (dbf, "lseek error");
|
||||
- num_bytes = read (dbf->desc, data_ca->dptr, key_size+data_size);
|
||||
+ do
|
||||
+ {
|
||||
+ bytes_read = read (dbf->desc, data_ca->dptr+num_bytes, key_size+data_size-num_bytes);
|
||||
+ if (bytes_read > 0) num_bytes += bytes_read;
|
||||
+ }
|
||||
+ while ((bytes_read > 0 || (bytes_read == -1 && errno == EINTR)) && num_bytes < key_size+data_size);
|
||||
if (num_bytes != key_size+data_size) _gdbm_fatal (dbf, "read error");
|
||||
|
||||
return data_ca->dptr;
|
44
gdbm-1.8.3-zeroheaders.patch
Normal file
44
gdbm-1.8.3-zeroheaders.patch
Normal file
@ -0,0 +1,44 @@
|
||||
02_zero-headers.patch by Jeff Johnson <jbj@redhat.com> and Colin Watson <cjwatson@debian.org>
|
||||
|
||||
diff -urNad a/falloc.c b/falloc.c
|
||||
--- a/falloc.c 2001-02-28 06:52:33.000000000 +0000
|
||||
+++ b/falloc.c 2003-09-08 23:58:43.000000000 +0100
|
||||
@@ -272,7 +272,7 @@
|
||||
|
||||
|
||||
/* Split the header block. */
|
||||
- temp = (avail_block *) malloc (av_size);
|
||||
+ temp = (avail_block *) calloc (1, av_size);
|
||||
if (temp == NULL) _gdbm_fatal (dbf, "malloc error");
|
||||
/* Set the size to be correct AFTER the pop_avail_block. */
|
||||
temp->size = dbf->header->avail.size;
|
||||
diff -urNad a/gdbmopen.c b/gdbmopen.c
|
||||
--- a/gdbmopen.c 2003-09-08 23:58:01.000000000 +0100
|
||||
+++ b/gdbmopen.c 2003-09-08 23:58:43.000000000 +0100
|
||||
@@ -212,7 +212,7 @@
|
||||
file_block_size = block_size;
|
||||
|
||||
/* Get space for the file header. */
|
||||
- dbf->header = (gdbm_file_header *) malloc (file_block_size);
|
||||
+ dbf->header = (gdbm_file_header *) calloc (1, file_block_size);
|
||||
if (dbf->header == NULL)
|
||||
{
|
||||
gdbm_close (dbf);
|
||||
@@ -256,7 +256,7 @@
|
||||
(dbf->header->block_size - sizeof (hash_bucket))
|
||||
/ sizeof (bucket_element) + 1;
|
||||
dbf->header->bucket_size = dbf->header->block_size;
|
||||
- dbf->bucket = (hash_bucket *) malloc (dbf->header->bucket_size);
|
||||
+ dbf->bucket = (hash_bucket *) calloc (1, dbf->header->bucket_size);
|
||||
if (dbf->bucket == NULL)
|
||||
{
|
||||
gdbm_close (dbf);
|
||||
@@ -420,7 +420,7 @@
|
||||
for(index = 0; index < size; index++)
|
||||
{
|
||||
(dbf->bucket_cache[index]).ca_bucket
|
||||
- = (hash_bucket *) malloc (dbf->header->bucket_size);
|
||||
+ = (hash_bucket *) calloc (1, dbf->header->bucket_size);
|
||||
if ((dbf->bucket_cache[index]).ca_bucket == NULL)
|
||||
{
|
||||
gdbm_errno = GDBM_MALLOC_ERROR;
|
47
gdbm.spec
47
gdbm.spec
@ -1,15 +1,26 @@
|
||||
Summary: A GNU set of database routines which use extensible hashing
|
||||
Name: gdbm
|
||||
Version: 1.8.0
|
||||
Release: 33%{?dist}
|
||||
Version: 1.8.3
|
||||
Release: 1%{?dist}
|
||||
Source: http://ftp.gnu.org/gnu/gdbm/gdbm-%{version}.tar.gz
|
||||
Patch0: gdbm-1.8.0-jbj.patch
|
||||
Patch1: gdbm-1.8.0-fhs.patch
|
||||
Patch3: gdbm-1.8.0-64offset.patch
|
||||
# Prevent gdbm from storing uninitialized memory content
|
||||
# to database files.
|
||||
# The change allows Valgrind users to debug their packages without
|
||||
# dealing with gdbm-related noise. It also improves security, as
|
||||
# the uninitialized memory might contain sensitive informations
|
||||
# from other applications. The patch is taken from Debian.
|
||||
# See https://bugzilla.redhat.com/show_bug.cgi?id=4457
|
||||
# See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=208927
|
||||
Patch0: gdbm-1.8.3-zeroheaders.patch
|
||||
# Make gdbm buildable.
|
||||
Patch1: gdbm-1.8.3-fhs.patch
|
||||
# Make gdbm handle read(2) returning less data than it was asked for.
|
||||
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=274417
|
||||
Patch2: gdbm-1.8.3-shortread.patch
|
||||
License: GPLv2+
|
||||
URL: http://www.gnu.org/software/gdbm/
|
||||
Group: System Environment/Libraries
|
||||
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
||||
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
||||
BuildRequires: libtool
|
||||
|
||||
%description
|
||||
@ -40,17 +51,11 @@ gdbm database library. You'll also need to install the gdbm package.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1 -b .jbj
|
||||
%patch0 -p1 -b .zeroheaders
|
||||
%patch1 -p1 -b .fhs
|
||||
%patch3 -p1 -b .offset
|
||||
%patch2 -p1 -b .shortread
|
||||
|
||||
%build
|
||||
# refresh config.sub, the original one does not recognize "redhat"
|
||||
# as vendorname:
|
||||
for f in /usr/share/automake-1.1?/config.sub; do
|
||||
:
|
||||
done
|
||||
cp -p $f .
|
||||
libtoolize --force --copy
|
||||
aclocal
|
||||
autoconf
|
||||
@ -59,13 +64,10 @@ make
|
||||
|
||||
%install
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
%makeinstall install-compat
|
||||
|
||||
ln -sf gdbm/gdbm.h $RPM_BUILD_ROOT/%{_includedir}/gdbm.h
|
||||
ln -sf libgdbm.so.2.0.0 $RPM_BUILD_ROOT/%{_libdir}/libgdbm.so
|
||||
|
||||
rm -f $RPM_BUILD_ROOT/%{_libdir}/libgdbm.la
|
||||
rm -f $RPM_BUILD_ROOT/%{_libdir}/libgdbm_compat.la
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
@ -85,11 +87,14 @@ fi
|
||||
%defattr(-,root,root,-)
|
||||
%doc COPYING NEWS README
|
||||
%{_libdir}/libgdbm.so.*
|
||||
%{_libdir}/libgdbm_compat.so.*
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/libgdbm.so
|
||||
%{_libdir}/libgdbm.a
|
||||
%{_libdir}/libgdbm_compat.so
|
||||
%{_libdir}/libgdbm_compat.a
|
||||
%{_includedir}/gdbm*
|
||||
%{_infodir}/*.info*
|
||||
%{_mandir}/man3/*
|
||||
@ -98,6 +103,12 @@ fi
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
%changelog
|
||||
* Tue Mar 09 2010 Karel Klic <kklic@redhat.com> - 1.8.3-1
|
||||
- Newer upstream release
|
||||
- Removed gdbm-1.8.0-64offset.patch, because it was merged by the upstream
|
||||
- `jbj' patch extended and renamed to `zeroheaders'
|
||||
- Added shortread patch from Debian
|
||||
|
||||
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.0-33
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user