summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorgroo <groo@pkgsrc.org>2001-06-01 15:17:23 +0000
committergroo <groo@pkgsrc.org>2001-06-01 15:17:23 +0000
commitba75a66f20739920656736c08e5ef161f4a932e3 (patch)
treee17c09d0e46a2070bdd0d756fe89f8afd2dadaef /net
parent4a3dd5d94108d925c12518ef560b31d9e9ef5924 (diff)
downloadpkgsrc-ba75a66f20739920656736c08e5ef161f4a932e3.tar.gz
Apply patch to tdb.c so that it works on pre-UBC systems. .tdb databases
were previously enlarged by the sequence: lseek, write, munmap, mmap and are now enlarged by: munmap, lseek, write, mmap. The Samba team is already aware of the problem. I expect this patch will be incorporated in a future release.
Diffstat (limited to 'net')
-rw-r--r--net/samba/Makefile3
-rw-r--r--net/samba/distinfo3
-rw-r--r--net/samba/patches/patch-ad43
3 files changed, 47 insertions, 2 deletions
diff --git a/net/samba/Makefile b/net/samba/Makefile
index 00e27a4f594..1f05342d28b 100644
--- a/net/samba/Makefile
+++ b/net/samba/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.52 2001/05/24 16:41:58 jlam Exp $
+# $NetBSD: Makefile,v 1.53 2001/06/01 15:21:53 groo Exp $
DISTNAME= samba-2.2.0
+PKGNAME= ${DISTNAME}nb1
WRKSRC= ${WRKDIR}/${DISTNAME}/source
CATEGORIES= net
MASTER_SITES= ftp://ftp.samba.org/pub/samba/ \
diff --git a/net/samba/distinfo b/net/samba/distinfo
index 62f539063cd..2a39d73800a 100644
--- a/net/samba/distinfo
+++ b/net/samba/distinfo
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.8 2001/05/24 21:52:14 jlam Exp $
+$NetBSD: distinfo,v 1.9 2001/06/01 15:21:53 groo Exp $
SHA1 (samba-2.2.0.tar.gz) = a7010ff4b3e99a94e8a618184e551e3e61909859
Size (samba-2.2.0.tar.gz) = 5835104 bytes
SHA1 (patch-aa) = 191875ae477167a1937a011c5b2f9baf033e41d8
SHA1 (patch-ab) = 28cfc5703a2c04b48a3e52047453c27d30aab160
SHA1 (patch-ac) = 851ad9368742f02bdfa20a640e876447f895f5f8
+SHA1 (patch-ad) = 9881d62319bd6d582c69e303f5aaa4e7c0c5e823
diff --git a/net/samba/patches/patch-ad b/net/samba/patches/patch-ad
new file mode 100644
index 00000000000..95e3b7ba7cf
--- /dev/null
+++ b/net/samba/patches/patch-ad
@@ -0,0 +1,43 @@
+$NetBSD: patch-ad,v 1.7 2001/06/01 15:17:23 groo Exp $
+
+--- tdb/tdb.c.orig Thu May 31 23:27:21 2001
++++ tdb/tdb.c Thu May 31 23:29:55 2001
+@@ -439,20 +439,24 @@
+ the database up to a multiple of TDB_PAGE_SIZE */
+ size = TDB_ALIGN(tdb->map_size + size*10, TDB_PAGE_SIZE) - tdb->map_size;
+
++ if (!(tdb->flags & TDB_INTERNAL) && tdb->map_ptr)
++ tdb->map_ptr = tdb_munmap(tdb->map_ptr, tdb->map_size);
++
+ /* expand the file itself */
+ if (!(tdb->flags & TDB_INTERNAL)) {
+- lseek(tdb->fd, tdb->map_size + size - 1, SEEK_SET);
++ if (lseek(tdb->fd, tdb->map_size + size - 1, SEEK_SET)!=tdb->map_size + size - 1)
++ goto fail;
+ if (write(tdb->fd, &b, 1) != 1) goto fail;
+ }
+
+- if (!(tdb->flags & TDB_INTERNAL) && tdb->map_ptr)
+- tdb->map_ptr = tdb_munmap(tdb->map_ptr, tdb->map_size);
+-
+ tdb->map_size += size;
+
+ if (tdb->flags & TDB_INTERNAL)
+ tdb->map_ptr = realloc(tdb->map_ptr, tdb->map_size);
+
++ if (!(tdb->flags & TDB_NOMMAP))
++ tdb->map_ptr = tdb_mmap(tdb->map_size, 0, tdb->fd);
++
+ /* form a new freelist record */
+ memset(&rec,'\0',sizeof(rec));
+ rec.rec_len = size - sizeof(rec);
+@@ -460,9 +464,6 @@
+ /* link it into the free list */
+ offset = tdb->map_size - size;
+ if (tdb_free(tdb, offset, &rec) == -1) goto fail;
+-
+- if (!(tdb->flags & TDB_NOMMAP))
+- tdb->map_ptr = tdb_mmap(tdb->map_size, 0, tdb->fd);
+
+ tdb_unlock(tdb, -1, F_WRLCK);
+ return 0;