summaryrefslogtreecommitdiff
path: root/filesystems
diff options
context:
space:
mode:
authorpooka <pooka@pkgsrc.org>2007-03-16 08:21:16 +0000
committerpooka <pooka@pkgsrc.org>2007-03-16 08:21:16 +0000
commitafc88851eb786245d7791c0b803f5916fdc9124e (patch)
treef0391b7d0105a38443e3996543d29b4d9b8c6795 /filesystems
parent39c49c6353b8534857699b62c40fce6710c68d3c (diff)
downloadpkgsrc-afc88851eb786245d7791c0b803f5916fdc9124e.tar.gz
use open() instead of mknod() to create regular files. avoids having
to run the file server as root for most uses.
Diffstat (limited to 'filesystems')
-rw-r--r--filesystems/fuse-lzofs/distinfo4
-rw-r--r--filesystems/fuse-lzofs/patches/patch-ab38
2 files changed, 35 insertions, 7 deletions
diff --git a/filesystems/fuse-lzofs/distinfo b/filesystems/fuse-lzofs/distinfo
index 76a06fd0188..993f706ac1d 100644
--- a/filesystems/fuse-lzofs/distinfo
+++ b/filesystems/fuse-lzofs/distinfo
@@ -1,7 +1,7 @@
-$NetBSD: distinfo,v 1.2 2007/03/08 05:14:38 pooka Exp $
+$NetBSD: distinfo,v 1.3 2007/03/16 08:21:16 pooka Exp $
SHA1 (LZOlayer_fs-20060306.tar.gz) = f069142a32d9b2325784329500689cc0dd726285
RMD160 (LZOlayer_fs-20060306.tar.gz) = a9f839950368706b3c90cc5195168f6616947e40
Size (LZOlayer_fs-20060306.tar.gz) = 17669 bytes
SHA1 (patch-aa) = 70df68443cb7b4d9eec5effea0dbb0e3fc666551
-SHA1 (patch-ab) = 34a6ca5ea0229568dc87c303a36c1c453f3f3b81
+SHA1 (patch-ab) = 7944a4f25c6f06e3208e605a28dad7f8f42acf02
diff --git a/filesystems/fuse-lzofs/patches/patch-ab b/filesystems/fuse-lzofs/patches/patch-ab
index d28a131e9da..23852742b67 100644
--- a/filesystems/fuse-lzofs/patches/patch-ab
+++ b/filesystems/fuse-lzofs/patches/patch-ab
@@ -1,7 +1,7 @@
-$NetBSD: patch-ab,v 1.2 2007/03/08 05:14:38 pooka Exp $
+$NetBSD: patch-ab,v 1.3 2007/03/16 08:21:16 pooka Exp $
---- LZOlayer_fs.c.orig 2006-05-19 04:23:35.000000000 +0900
-+++ LZOlayer_fs.c 2007-03-08 14:12:22.000000000 +0900
+--- LZOlayer_fs.c.orig 2006-05-18 22:23:35.000000000 +0300
++++ LZOlayer_fs.c 2007-03-16 09:00:48.000000000 +0200
@@ -21,6 +21,15 @@
#define __USE_UNIX98
#include <unistd.h>
@@ -96,7 +96,27 @@ $NetBSD: patch-ab,v 1.2 2007/03/08 05:14:38 pooka Exp $
chown(filePtr->path, fuse_get_context()->uid, fuse_get_context()->gid);
}
// old open/create for write
-@@ -365,7 +385,7 @@
+@@ -357,15 +377,25 @@
+ static int LZOlayer_mknod(const char *path, mode_t mode, dev_t rdev)
+ {
+ char *xPath = LZOlayer_makePath(path);
+- int res = mknod(xPath, mode, rdev);
+-
++ int res;
++
++ if (S_ISREG(mode)) {
++ res = open(xPath, owronly | O_CREAT | O_TRUNC, 0700);
++ if (res != -1) {
++ close(res);
++ res = 0;
++ }
++ } else {
++ res = mknod(xPath, mode, rdev);
++ }
++
+ if (res == -1)
+ {
+ res = -errno;
}
else
{
@@ -105,7 +125,15 @@ $NetBSD: patch-ab,v 1.2 2007/03/08 05:14:38 pooka Exp $
off_t null = 0;
write(fd, &null, sizeof(off_t));
write(fd, &null, sizeof(off_t));
-@@ -383,7 +403,7 @@
+@@ -373,6 +403,7 @@
+ close(fd);
+
+ chown(xPath, fuse_get_context()->uid, fuse_get_context()->gid);
++ chmod(xPath, mode);
+ }
+ free(xPath);
+
+@@ -383,7 +414,7 @@
{
char *xPath = LZOlayer_makePath(path);