mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 16:33:02 -05:00
dll: fuse: respect the uid,gid,umask options which were being ignored
This commit is contained in:
parent
f7595e40b6
commit
804434d836
@ -463,9 +463,9 @@ static int fsp_fuse_core_opt_proc(void *opt_data0, const char *arg, int key,
|
|||||||
return 1;
|
return 1;
|
||||||
case 'U':
|
case 'U':
|
||||||
if ('U' == arg[2])
|
if ('U' == arg[2])
|
||||||
arg += sizeof "--UNC" - 1;
|
arg += sizeof "--UNC=" - 1;
|
||||||
else if ('V' == arg[2])
|
else if ('V' == arg[2])
|
||||||
arg += sizeof "--VolumePrefix" - 1;
|
arg += sizeof "--VolumePrefix=" - 1;
|
||||||
if (0 == MultiByteToWideChar(CP_UTF8, 0, arg, -1,
|
if (0 == MultiByteToWideChar(CP_UTF8, 0, arg, -1,
|
||||||
opt_data->VolumeParams.Prefix, sizeof opt_data->VolumeParams.Prefix / sizeof(WCHAR)))
|
opt_data->VolumeParams.Prefix, sizeof opt_data->VolumeParams.Prefix / sizeof(WCHAR)))
|
||||||
return -1;
|
return -1;
|
||||||
@ -507,6 +507,9 @@ FSP_FUSE_API struct fuse *fsp_fuse_new(struct fsp_fuse_env *env,
|
|||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
f->env = env;
|
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);
|
memcpy(&f->ops, ops, opsize);
|
||||||
f->data = data;
|
f->data = data;
|
||||||
f->DebugLog = opt_data.debug ? -1 : 0;
|
f->DebugLog = opt_data.debug ? -1 : 0;
|
||||||
|
@ -205,6 +205,13 @@ static NTSTATUS fsp_fuse_intf_GetFileInfoEx(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
if (0 != err)
|
if (0 != err)
|
||||||
return fsp_fuse_ntstatus_from_errno(f->env, 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;
|
*PUid = stbuf.st_uid;
|
||||||
*PGid = stbuf.st_gid;
|
*PGid = stbuf.st_gid;
|
||||||
*PMode = stbuf.st_mode;
|
*PMode = stbuf.st_mode;
|
||||||
|
@ -32,6 +32,9 @@
|
|||||||
struct fuse
|
struct fuse
|
||||||
{
|
{
|
||||||
struct fsp_fuse_env *env;
|
struct fsp_fuse_env *env;
|
||||||
|
int set_umask, umask;
|
||||||
|
int set_uid, uid;
|
||||||
|
int set_gid, gid;
|
||||||
struct fuse_operations ops;
|
struct fuse_operations ops;
|
||||||
void *data;
|
void *data;
|
||||||
UINT32 DebugLog;
|
UINT32 DebugLog;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user