Browse Source

cifs config parameter added

pull/371/head
Rüdiger Gubler 8 years ago
parent
commit
8ccda3efef
  1. 6
      src/chown.cpp
  2. 1
      src/config.cpp
  3. 1
      src/config.hpp
  4. 13
      src/fs_clonepath.cpp
  5. 4
      src/option_parser.cpp

6
src/chown.cpp

@ -96,20 +96,20 @@ namespace mergerfs
uid_t uid,
gid_t gid)
{
/*
const fuse_context *fc = fuse_get_context();
const Config &config = Config::get(fc);
const ugid::Set ugid(fc->uid,fc->gid);
const rwlock::ReadGuard readlock(&config.srcmountslock);
if(config.cifs)
return 0;
return _chown(config.chown,
config.srcmounts,
config.minfreespace,
fusepath,
uid,
gid);
*/
return 0;
}
}
}

1
src/config.cpp

@ -40,6 +40,7 @@ namespace mergerfs
minfreespace(MINFREESPACE_DEFAULT),
moveonenospc(false),
direct_io(false),
cifs(false),
POLICYINIT(access),
POLICYINIT(chmod),
POLICYINIT(chown),

1
src/config.hpp

@ -48,6 +48,7 @@ namespace mergerfs
uint64_t minfreespace;
bool moveonenospc;
bool direct_io;
bool cifs;
public:
const Policy *policies[FuseFunc::Enum::END];

13
src/fs_clonepath.cpp

@ -26,8 +26,10 @@
#include "fs_clonepath.hpp"
#include "fs_path.hpp"
#include "fs_xattr.hpp"
#include "config.hpp"
using std::string;
using mergerfs::Config;
static
bool
@ -59,6 +61,9 @@ namespace fs
string frompath;
string dirname;
const fuse_context *fc = fuse_get_context();
const Config &config = Config::get(fc);
dirname = relative;
fs::path::dirname(dirname);
if(!dirname.empty())
@ -96,9 +101,11 @@ namespace fs
if((rv == -1) && !ignorable_error(errno))
return -1;
rv = fs::chown(topath,st);
//if(rv == -1)
// return -1;
if(!config.cifs) {
rv = fs::chown(topath,st);
if(rv == -1)
return -1;
}
rv = fs::utime(topath,st);
if(rv == -1)

4
src/option_parser.cpp

@ -143,6 +143,8 @@ parse_and_process_arg(Config &config,
return (set_default_options(*outargs),0);
else if(arg == "direct_io")
return (config.direct_io=true,1);
else if(arg == "cifs")
return (config.cifs=true,0);
return 1;
}
@ -260,6 +262,8 @@ usage(void)
" on write: default false\n"
" -o func.<f>=<p> set function <f> to policy <p>\n"
" -o category.<c>=<p> set functions in category <c> to <p>\n"
" -o cifs disable chown command execution as CIFS\n"
" don't support it\n"
<< std::endl;
}

Loading…
Cancel
Save