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

@ -29,21 +29,8 @@
#include <unistd.h>
#include <errno.h>
#include "config.hpp"
#include "fileinfo.hpp"
static
int
_fgetattr_controlfile(const struct stat &controlfilestat,
const std::string cfdata,
struct stat &st)
{
st = controlfilestat;
st.st_size = cfdata.size();
return 0;
}
static
int
_fgetattr(const int fd,
@ -65,13 +52,7 @@ namespace mergerfs
struct stat *st,
struct fuse_file_info *ffi)
{
const config::Config &config = config::get();
const FileInfo *fileinfo = (FileInfo*)ffi->fh;
if(fusepath == config.controlfile)
return _fgetattr_controlfile(config.controlfilestat,
config.controlfiledata(),
*st);
const FileInfo *fileinfo = (FileInfo*)ffi->fh;
return _fgetattr(fileinfo->fd,
*st);