diff options
author | Fantix King | 2012-10-29 09:27:13 +0000 |
---|---|---|
committer | Fantix King | 2015-11-07 15:35:05 +0800 |
commit | a817c73bf73747f69e799a71a79ece5afdbefa82 (patch) | |
tree | 0ccdf3f2905c2a4f03a356ae078d1ae608d6f9f5 | |
download | aur-a817c73bf73747f69e799a71a79ece5afdbefa82.tar.gz |
1.10-1.1
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | PKGBUILD | 59 | ||||
-rw-r--r-- | gdbm-1.10-zeroheaders.patch | 33 |
3 files changed, 111 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b60e16d42d7f --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = libx32-gdbm + pkgdesc = GNU database library (x32 ABI) + pkgver = 1.10 + pkgrel = 1.1 + url = http://www.gnu.org/software/gdbm/gdbm.html + arch = x86_64 + license = GPL + makedepends = gcc-multilib-x32 + depends = libx32-glibc + depends = gdbm + options = !libtool + options = !makeflags + source = ftp://ftp.gnu.org/gnu/gdbm/gdbm-1.10.tar.gz + source = gdbm-1.10-zeroheaders.patch + md5sums = 88770493c2559dc80b561293e39d3570 + md5sums = 2a5979910c338dabda6935263b3d8af9 + +pkgname = libx32-gdbm + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..bbae516511b9 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,59 @@ +# Upstream Maintainer: josephgbr <rafael.f.f1 at gmail.com> +# Contributor: Maribu <leonidas200 at web dot de> +# Maintainer: Fantix King <fantix.king at gmail.com> + +_pkgbase=gdbm +pkgname=libx32-$_pkgbase +pkgver=1.10 +pkgrel=1.1 +pkgdesc="GNU database library (x32 ABI)" +license=('GPL') +url="http://www.gnu.org/software/gdbm/gdbm.html" +arch=('x86_64') +depends=('libx32-glibc' "$_pkgbase") +makedepends=('gcc-multilib-x32') +source=(ftp://ftp.gnu.org/gnu/gdbm/${_pkgbase}-${pkgver}.tar.gz + gdbm-1.10-zeroheaders.patch) +options=('!libtool' '!makeflags') +md5sums=('88770493c2559dc80b561293e39d3570' + '2a5979910c338dabda6935263b3d8af9') + +build() { + export CC='gcc -mx32' + + cd "${srcdir}/${_pkgbase}-${pkgver}" + + # Prevent gdbm from storing uninitialized memory content + # to database files. This patch improves security, as the + # uninitialized memory might contain sensitive informations + # from other applications. + # https://bugzilla.redhat.com/show_bug.cgi?id=4457 + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=208927 + patch -Np1 -i ../gdbm-1.10-zeroheaders.patch + + ./configure --prefix=/usr \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --enable-libgdbm-compat \ + --libdir=/usr/libx32 + + make prefix=/usr +} + +check() { + cd "${srcdir}/${_pkgbase}-${pkgver}" + make check +} + +package() { + cd "${srcdir}/${_pkgbase}-${pkgver}" + + make prefix="$pkgdir/usr" \ + manprefix="$pkgdir/usr/share/man" \ + man3dir="$pkgdir/usr/share/man/man3" \ + infodir="$pkgdir/usr/share/info" \ + libdir="$pkgdir/usr/libx32" \ + install + + rm -rf "${pkgdir}/usr"/{bin,share,include} +} diff --git a/gdbm-1.10-zeroheaders.patch b/gdbm-1.10-zeroheaders.patch new file mode 100644 index 000000000000..28f070c44a63 --- /dev/null +++ b/gdbm-1.10-zeroheaders.patch @@ -0,0 +1,33 @@ +diff -up gdbm-1.10/src/falloc.c.zeroheaders gdbm-1.10/src/falloc.c +--- gdbm-1.10/src/falloc.c.zeroheaders 2011-11-11 11:59:11.000000000 +0100 ++++ gdbm-1.10/src/falloc.c 2011-11-14 17:34:32.487604027 +0100 +@@ -255,7 +255,7 @@ push_avail_block (GDBM_FILE dbf) + + + /* 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 -up gdbm-1.10/src/gdbmopen.c.zeroheaders gdbm-1.10/src/gdbmopen.c +--- gdbm-1.10/src/gdbmopen.c.zeroheaders 2011-11-11 19:39:42.000000000 +0100 ++++ gdbm-1.10/src/gdbmopen.c 2011-11-14 17:33:24.867608650 +0100 +@@ -264,7 +264,7 @@ gdbm_open (const char *file, int block_s + (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); +@@ -456,7 +456,7 @@ _gdbm_init_cache(GDBM_FILE dbf, size_t s + 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; |