[PATCH] vfs_fruit: mmap under FreeBSD needs PROT_READ
Volker Lendecke
Volker.Lendecke at SerNet.DE
Thu Jan 8 09:18:34 MST 2015
Hi!
Review&push appreciated!
This together with the base_name fixes
make test TESTS=vfs.fruit
under FreeBSD 10.1.
Thanks,
Volker
--
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From af322be641f90183f26be92e43027d85b4321062 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 8 Jan 2015 17:14:37 +0100
Subject: [PATCH] vfs_fruit: mmap under FreeBSD needs PROT_READ
We memmove, which does read
Signed-off-by: Volker Lendecke <vl at samba.org>
---
source3/modules/vfs_fruit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index af51dcd..cbc5c06 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -652,7 +652,7 @@ static int ad_convert(struct adouble *ad, int fd)
ad_getentrylen(ad, ADEID_RFORK);
/* FIXME: direct use of mmap(), vfs_aio_fork does it too */
- map = mmap(NULL, origlen, PROT_WRITE, MAP_SHARED, fd, 0);
+ map = mmap(NULL, origlen, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
if (map == MAP_FAILED) {
DEBUG(2, ("mmap AppleDouble: %s\n", strerror(errno)));
rc = -1;
--
1.9.1
More information about the samba-technical
mailing list