mirror of
https://github.com/vgough/encfs.git
synced 2024-11-21 23:43:26 +01: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 oldgid = -1;
|
||||
if(uid != 0)
|
||||
{
|
||||
olduid = setfsuid( uid );
|
||||
if(olduid == -1)
|
||||
{
|
||||
rInfo("setfsuid error: %s", strerror(errno));
|
||||
return -EPERM;
|
||||
}
|
||||
}
|
||||
if(gid != 0)
|
||||
{
|
||||
oldgid = setfsgid( gid );
|
||||
if(oldgid == -1)
|
||||
{
|
||||
rInfo("setfsgid error: %s", strerror(errno));
|
||||
return -EPERM;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* cf. xmp_mknod() in fusexmp.c
|
||||
|
Loading…
Reference in New Issue
Block a user