dll: fuse: respect the uid,gid,umask options which were being ignored

This commit is contained in:
Bill Zissimopoulos 2016-06-30 23:47:01 -07:00
parent f7595e40b6
commit 804434d836
3 changed files with 15 additions and 2 deletions

View File

@ -463,9 +463,9 @@ static int fsp_fuse_core_opt_proc(void *opt_data0, const char *arg, int key,
return 1;
case 'U':
if ('U' == arg[2])
arg += sizeof "--UNC" - 1;
arg += sizeof "--UNC=" - 1;
else if ('V' == arg[2])
arg += sizeof "--VolumePrefix" - 1;
arg += sizeof "--VolumePrefix=" - 1;
if (0 == MultiByteToWideChar(CP_UTF8, 0, arg, -1,
opt_data->VolumeParams.Prefix, sizeof opt_data->VolumeParams.Prefix / sizeof(WCHAR)))
return -1;
@ -507,6 +507,9 @@ FSP_FUSE_API struct fuse *fsp_fuse_new(struct fsp_fuse_env *env,
goto fail;
f->env = env;
f->set_umask = opt_data.set_umask; f->umask = opt_data.umask;
f->set_uid = opt_data.set_uid; f->uid = opt_data.uid;
f->set_gid = opt_data.set_gid; f->gid = opt_data.gid;
memcpy(&f->ops, ops, opsize);
f->data = data;
f->DebugLog = opt_data.debug ? -1 : 0;

View File

@ -205,6 +205,13 @@ static NTSTATUS fsp_fuse_intf_GetFileInfoEx(FSP_FILE_SYSTEM *FileSystem,
if (0 != err)
return fsp_fuse_ntstatus_from_errno(f->env, err);
if (f->set_umask)
stbuf.st_mode = (stbuf.st_mode & 0170000) | (0777 & ~f->umask);
if (f->set_uid)
stbuf.st_uid = f->uid;
if (f->set_gid)
stbuf.st_gid = f->gid;
*PUid = stbuf.st_uid;
*PGid = stbuf.st_gid;
*PMode = stbuf.st_mode;

View File

@ -32,6 +32,9 @@
struct fuse
{
struct fsp_fuse_env *env;
int set_umask, umask;
int set_uid, uid;
int set_gid, gid;
struct fuse_operations ops;
void *data;
UINT32 DebugLog;