Package: fuse-convmvfs
Version: 0.2.5-2
Severity: normal
Tags: patch
-- System Information:
Debian Release: 5.0
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: lang=de...@euro, lc_ctype=de...@euro (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash
Versions of packages fuse-convmvfs depends on:
ii fuse-utils 2.7.4-1.1 Filesystem in USErspace (utilities
ii libc6 2.7-18 GNU C Library: Shared libraries
ii libfuse2 2.7.4-1.1 Filesystem in USErspace library
ii libgcc1 1:4.3.2-1.1 GCC support library
ii libstdc++6 4.3.2-1.1 The GNU Standard C++ Library v3
fuse-convmvfs recommends no packages.
fuse-convmvfs suggests no packages.
-- no debconf information
1) The symlink creation code in convmvfs_symlink is missing a chown call.
Compare it with convmvfs_mknod and convmvfs_mkdir.
2) The xattr related calls must be non-dereferencing.
The included patch corrects this. The added code may look somewhat redundant,
but this the way how it is done in the existing code.
--- fuse-convmvfs-0.2.5/src/convmvfs.cpp 2010-05-15 18:44:57.000000000 +0200
+++ fuse-convmvfs-0.2.5-n/src/convmvfs.cpp 2010-08-21 12:48:54.000000000 +0200
@@ -490,8 +490,12 @@
if(st)
return st;
- if(symlink(out2in(oldpath).c_str(), inewpath.c_str()))
- return -errno;
+ int rt = symlink(out2in(oldpath).c_str(), inewpath.c_str());
+ if (rt) return -errno;
+
+ if(euid == 0){
+ lchown(inewpath.c_str(), cont->uid, cont->gid);
+ }
return 0;
}
@@ -662,7 +666,7 @@
if(st)
return st;
- return listxattr(ipath.c_str(), list, listsize);
+ return llistxattr(ipath.c_str(), list, listsize);
}
static int convmvfs_removexattr(const char *opath, const char *xattr){
@@ -676,7 +680,7 @@
}
if((cont->uid != stbuf.st_uid) && (cont->uid != 0))
return -EPERM;
- if(removexattr(ipath.c_str(), xattr))
+ if(lremovexattr(ipath.c_str(), xattr))
return -errno;
return 0;
}
@@ -691,7 +695,7 @@
if(st)
return st;
- int res = getxattr(ipath.c_str(), name, value, valsize);
+ int res = lgetxattr(ipath.c_str(), name, value, valsize);
if (res >= 0)
return res;
else
@@ -709,7 +713,7 @@
}
if((cont->uid != stbuf.st_uid) && (cont->uid != 0))
return -EPERM;
- if(setxattr(ipath.c_str(), name, value, valsize, flags))
+ if(lsetxattr(ipath.c_str(), name, value, valsize, flags))
return -errno;
return 0;
}