From 8a29238e025bd173723dd5624a39e2a2f6d17a65 Mon Sep 17 00:00:00 2001 From: agc Date: Mon, 11 Jun 2007 20:13:27 +0000 Subject: Initial import of loggedfs-0.4, a FUSE-based file system which logs all operations. Loggedfs is a filesystem which logs (via rlog and syslog) exactly what is happening on every vnode operation. --- filesystems/fuse-loggedfs/DESCR | 2 + filesystems/fuse-loggedfs/Makefile | 33 ++++++++++++ filesystems/fuse-loggedfs/PLIST | 3 ++ filesystems/fuse-loggedfs/distinfo | 7 +++ filesystems/fuse-loggedfs/patches/patch-aa | 84 ++++++++++++++++++++++++++++++ filesystems/fuse-loggedfs/patches/patch-ab | 11 ++++ 6 files changed, 140 insertions(+) create mode 100644 filesystems/fuse-loggedfs/DESCR create mode 100644 filesystems/fuse-loggedfs/Makefile create mode 100644 filesystems/fuse-loggedfs/PLIST create mode 100644 filesystems/fuse-loggedfs/distinfo create mode 100644 filesystems/fuse-loggedfs/patches/patch-aa create mode 100644 filesystems/fuse-loggedfs/patches/patch-ab (limited to 'filesystems') diff --git a/filesystems/fuse-loggedfs/DESCR b/filesystems/fuse-loggedfs/DESCR new file mode 100644 index 00000000000..4e2e1135d34 --- /dev/null +++ b/filesystems/fuse-loggedfs/DESCR @@ -0,0 +1,2 @@ +Loggedfs is a filesystem which logs (via rlog and syslog) exactly what +is happening on every vnode operation. diff --git a/filesystems/fuse-loggedfs/Makefile b/filesystems/fuse-loggedfs/Makefile new file mode 100644 index 00000000000..4e9e2f43302 --- /dev/null +++ b/filesystems/fuse-loggedfs/Makefile @@ -0,0 +1,33 @@ +# $NetBSD: Makefile,v 1.1.1.1 2007/06/11 20:13:27 agc Exp $ +# + +DISTNAME= loggedfs-0.4 +PKGNAME= fuse-${DISTNAME} +CATEGORIES= filesystems +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=loggedfs/} +EXTRACT_SUFX= .tar.bz2 + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= ${MASTER_SITE_SOURCEFORGE:=loggedfs/} +COMMENT= FUSE file system which logs all operations + +.if exists(/usr/include/sys/statvfs.h) +CPPFLAGS+= -DHAVE_SYS_STATVFS_H +.endif + +.if exists(/usr/include/sys/xattr.h) +CPPFLAGS+= -DHAVE_SETXATTR +.endif + +USE_LANGUAGES+= c++ + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/loggedfs ${PREFIX}/bin/loggedfs + ${INSTALL_MAN} ${WRKSRC}/loggedfs.1 ${PREFIX}/${PKGMANDIR}/man1/loggedfs.1 + +.include "../../devel/librlog/buildlink3.mk" +.include "../../devel/pcre/buildlink3.mk" +.include "../../textproc/libxml2/buildlink3.mk" + +.include "../../mk/fuse.buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/filesystems/fuse-loggedfs/PLIST b/filesystems/fuse-loggedfs/PLIST new file mode 100644 index 00000000000..33ac9cdb6d4 --- /dev/null +++ b/filesystems/fuse-loggedfs/PLIST @@ -0,0 +1,3 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2007/06/11 20:13:27 agc Exp $ +bin/loggedfs +${PKGMANDIR}/man1/loggedfs.1 diff --git a/filesystems/fuse-loggedfs/distinfo b/filesystems/fuse-loggedfs/distinfo new file mode 100644 index 00000000000..7f44fab5bb6 --- /dev/null +++ b/filesystems/fuse-loggedfs/distinfo @@ -0,0 +1,7 @@ +$NetBSD: distinfo,v 1.1.1.1 2007/06/11 20:13:27 agc Exp $ + +SHA1 (loggedfs-0.4.tar.bz2) = a20eae4c035e5eeaec066d5b5d14b42dac2b2189 +RMD160 (loggedfs-0.4.tar.bz2) = e2ad904e70fec7c9a188f2bc5d6528adfcb104f2 +Size (loggedfs-0.4.tar.bz2) = 14851 bytes +SHA1 (patch-aa) = 58eeb1ac9db64605e96fa8bc63de2f1f5c398b0c +SHA1 (patch-ab) = 864bf2488034a3217f530ed6a8171633424b9928 diff --git a/filesystems/fuse-loggedfs/patches/patch-aa b/filesystems/fuse-loggedfs/patches/patch-aa new file mode 100644 index 00000000000..b4b334f7395 --- /dev/null +++ b/filesystems/fuse-loggedfs/patches/patch-aa @@ -0,0 +1,84 @@ +$NetBSD: patch-aa,v 1.1.1.1 2007/06/11 20:13:27 agc Exp $ + +--- src/loggedfs.cpp 2007/02/21 21:49:53 1.1 ++++ src/loggedfs.cpp 2007/02/21 21:51:15 +@@ -30,7 +30,11 @@ + #include + #include + #include ++#ifdef HAVE_SYS_STATVFS_H ++#include ++#else + #include ++#endif + #ifdef HAVE_SETXATTR + #include + #endif +@@ -85,12 +89,14 @@ + + static char* getAbsolutePath(const char *path) + { +- char *realPath=new char[strlen(path)+strlen(loggedfsArgs->mountPoint)+1]; ++ char *realPath=new char[strlen(path)+strlen(loggedfsArgs->mountPoint)+2]; ++ ++ (void) snprintf(realPath, strlen(path)+strlen(loggedfsArgs->mountPoint)+2, ++ "%s%s%s", ++ loggedfsArgs->mountPoint, ++ (path[0] == '/') ? "" : "/", ++ path); + +- strcpy(realPath,loggedfsArgs->mountPoint); +- if (realPath[strlen(realPath)-1]=='/') +- realPath[strlen(realPath)-1]='\0'; +- strcat(realPath,path); + return realPath; + + } +@@ -156,7 +162,7 @@ + + char *aPath=getAbsolutePath(path); + path=getRelativePath(path); +- res = lstat(path, stbuf); ++ res = lstat(aPath, stbuf); + loggedfs_log(aPath,"getattr",res,"getattr %s",aPath); + if(res == -1) + return -errno; +@@ -210,7 +216,7 @@ + path=getRelativePath(path); + + +- dp = opendir(path); ++ dp = opendir(aPath); + if(dp == NULL) { + res = -errno; + loggedfs_log(aPath,"readdir",-1,"readdir %s",aPath); +@@ -427,7 +433,7 @@ + return 0; + } + +-#if (FUSE_USE_VERSION==25) ++#if (FUSE_USE_VERSION >= 25) + static int loggedFS_utime(const char *path, struct utimbuf *buf) + { + int res; +@@ -650,7 +656,11 @@ + // logging the ~/.kde/share/config directory, in which hard links for lock + // files are verified by their inode equivalency. + ++#ifdef __NetBSD__ ++#define COMMON_OPTS "" ++#else + #define COMMON_OPTS "nonempty,use_ino" ++#endif + + while ((res = getopt (argc, argv, "hpfec:l:")) != -1) + { +@@ -770,7 +780,7 @@ + loggedFS_oper.chmod = loggedFS_chmod; + loggedFS_oper.chown = loggedFS_chown; + loggedFS_oper.truncate = loggedFS_truncate; +-#if (FUSE_USE_VERSION==25) ++#if (FUSE_USE_VERSION >= 25) + loggedFS_oper.utime = loggedFS_utime; + #else + loggedFS_oper.utimens = loggedFS_utimens; diff --git a/filesystems/fuse-loggedfs/patches/patch-ab b/filesystems/fuse-loggedfs/patches/patch-ab new file mode 100644 index 00000000000..3ca8b6dba0d --- /dev/null +++ b/filesystems/fuse-loggedfs/patches/patch-ab @@ -0,0 +1,11 @@ +$NetBSD: patch-ab,v 1.1.1.1 2007/06/11 20:13:27 agc Exp $ + +--- Makefile 2007/06/08 15:32:49 1.1 ++++ Makefile 2007/06/08 15:34:17 +@@ -1,5 +1,5 @@ + CC=g++ +-CFLAGS=-Wall -ansi -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -DRLOG_COMPONENT="loggedfs" `xml2-config --cflags` ++CFLAGS=-Wall -ansi -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -DRLOG_COMPONENT="loggedfs" `xml2-config --cflags` ${CPPFLAGS} + LDFLAGS=-Wall -ansi -lpcre -lfuse -lrlog `xml2-config --libs` + srcdir=src + builddir=build -- cgit v1.2.3