3 --- src/loggedfs.cpp 2007/02/21 21:49:53 1.1
4 +++ src/loggedfs.cpp 2007/02/21 21:51:15
9 +#ifdef HAVE_SYS_STATVFS_H
10 +#include <sys/statvfs.h>
12 #include <sys/statfs.h>
15 #include <sys/xattr.h>
19 static char* getAbsolutePath(const char *path)
21 - char *realPath=new char[strlen(path)+strlen(loggedfsArgs->mountPoint)+1];
22 + char *realPath=new char[strlen(path)+strlen(loggedfsArgs->mountPoint)+2];
24 + (void) snprintf(realPath, strlen(path)+strlen(loggedfsArgs->mountPoint)+2,
26 + loggedfsArgs->mountPoint,
27 + (path[0] == '/') ? "" : "/",
30 - strcpy(realPath,loggedfsArgs->mountPoint);
31 - if (realPath[strlen(realPath)-1]=='/')
32 - realPath[strlen(realPath)-1]='\0';
33 - strcat(realPath,path);
39 char *aPath=getAbsolutePath(path);
40 path=getRelativePath(path);
41 - res = lstat(path, stbuf);
42 + res = lstat(aPath, stbuf);
43 loggedfs_log(aPath,"getattr",res,"getattr %s",aPath);
47 path=getRelativePath(path);
51 + dp = opendir(aPath);
54 loggedfs_log(aPath,"readdir",-1,"readdir %s",aPath);
59 -#if (FUSE_USE_VERSION==25)
60 +#if (FUSE_USE_VERSION >= 25)
61 static int loggedFS_utime(const char *path, struct utimbuf *buf)
65 // logging the ~/.kde/share/config directory, in which hard links for lock
66 // files are verified by their inode equivalency.
69 +#define COMMON_OPTS ""
71 #define COMMON_OPTS "nonempty,use_ino"
74 while ((res = getopt (argc, argv, "hpfec:l:")) != -1)
77 loggedFS_oper.chmod = loggedFS_chmod;
78 loggedFS_oper.chown = loggedFS_chown;
79 loggedFS_oper.truncate = loggedFS_truncate;
80 -#if (FUSE_USE_VERSION==25)
81 +#if (FUSE_USE_VERSION >= 25)
82 loggedFS_oper.utime = loggedFS_utime;
84 loggedFS_oper.utimens = loggedFS_utimens;