platform specific code to deal with sete{u,g}id. closes #17

This commit is contained in:
Antonio SJ Musumeci 2014-06-17 19:12:09 -04:00
parent 716453596a
commit 0e12d79659
39 changed files with 323 additions and 131 deletions

View file

@ -22,8 +22,11 @@
THE SOFTWARE.
*/
#include <fuse.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <string>
#include <vector>
@ -31,7 +34,6 @@
#include "ugid.hpp"
#include "fs.hpp"
#include "config.hpp"
#include "assert.hpp"
using std::string;
using std::vector;
@ -73,8 +75,9 @@ namespace mergerfs
utimens(const char *fusepath,
const struct timespec ts[2])
{
ugid::SetResetGuard ugid;
const config::Config &config = config::get();
const struct fuse_context *fc = fuse_get_context();
const config::Config &config = config::get();
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
if(fusepath == config.controlfile)
return -EPERM;