mirror of
https://github.com/vgough/encfs.git
synced 2025-06-20 03:37:50 +02:00
add error checking to setfsuid/setfsgid calls
git-svn-id: http://encfs.googlecode.com/svn/trunk@13 db9cf616-1c43-0410-9cb8-a902689de0d6
This commit is contained in:
parent
931dcdd2af
commit
9ce4a03887
@ -176,9 +176,23 @@ int FileNode::mknod(mode_t mode, dev_t rdev, uid_t uid, gid_t gid)
|
|||||||
int olduid = -1;
|
int olduid = -1;
|
||||||
int oldgid = -1;
|
int oldgid = -1;
|
||||||
if(uid != 0)
|
if(uid != 0)
|
||||||
|
{
|
||||||
olduid = setfsuid( uid );
|
olduid = setfsuid( uid );
|
||||||
|
if(olduid == -1)
|
||||||
|
{
|
||||||
|
rInfo("setfsuid error: %s", strerror(errno));
|
||||||
|
return -EPERM;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(gid != 0)
|
if(gid != 0)
|
||||||
|
{
|
||||||
oldgid = setfsgid( gid );
|
oldgid = setfsgid( gid );
|
||||||
|
if(oldgid == -1)
|
||||||
|
{
|
||||||
|
rInfo("setfsgid error: %s", strerror(errno));
|
||||||
|
return -EPERM;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* cf. xmp_mknod() in fusexmp.c
|
* cf. xmp_mknod() in fusexmp.c
|
||||||
|
Loading…
x
Reference in New Issue
Block a user