only allow manipulation of runtime settings via xattrs. closes #22

This commit is contained in:
Antonio SJ Musumeci 2014-07-29 00:00:42 -04:00
parent 45cec2d301
commit 7b0d703f00
35 changed files with 50 additions and 419 deletions

View file

@ -31,27 +31,8 @@
#include <string>
#include <algorithm>
#include "config.hpp"
#include "ugid.hpp"
#include "fileinfo.hpp"
using std::string;
static
int
_read_controlfile(const string readstr,
char *buf,
const size_t count)
{
size_t n;
n = std::min(count,readstr.length());
memcpy(buf,readstr.data(),n);
return (int)n;
}
static
int
_read(const int fd,
@ -75,16 +56,9 @@ namespace mergerfs
char *buf,
size_t count,
off_t offset,
struct fuse_file_info *fi)
struct fuse_file_info *ffi)
{
const config::Config &config = config::get();
if(fusepath == config.controlfile)
return _read_controlfile(config.controlfiledata(),
buf,
count);
return _read(((FileInfo*)fi->fh)->fd,
return _read(((FileInfo*)ffi->fh)->fd,
buf,
count,
offset);