fix: unprivileged mount failed if user had rights for everything except

the fuse device
master
szaka 2008-03-08 20:42:59 +00:00
parent 4926692ea0
commit 3d65fcca1e
1 changed files with 7 additions and 1 deletions

View File

@ -588,7 +588,13 @@ static int check_perm(const char **mntp, struct stat *stbuf, int *currdir_fd,
static int try_open(const char *dev, char **devp)
{
int fd = open(dev, O_RDWR);
int fd;
if (restore_privs())
return -1;
fd = open(dev, O_RDWR);
if (drop_privs())
return -1;
if (fd != -1) {
*devp = strdup(dev);
if (*devp == NULL) {