return !is_superuser(ff, ctxt);
}
-static int check_inum_access(ext2_filsys fs, ext2_ino_t ino, mode_t mask)
+static int check_inum_access(struct fuse2fs *ff, ext2_ino_t ino, int mask)
{
struct fuse_context *ctxt = fuse_get_context();
- struct fuse2fs *ff = (struct fuse2fs *)ctxt->private_data;
+ ext2_filsys fs = ff->fs;
struct ext2_inode inode;
mode_t perms;
errcode_t err;
goto out2;
}
- ret = check_inum_access(fs, parent, W_OK);
+ ret = check_inum_access(ff, parent, W_OK);
if (ret)
goto out2;
goto out2;
}
- ret = check_inum_access(fs, parent, W_OK);
+ ret = check_inum_access(ff, parent, W_OK);
if (ret)
goto out2;
base_name = filename;
}
- ret = check_inum_access(fs, dir, W_OK);
+ ret = check_inum_access(ff, dir, W_OK);
if (ret) {
free(filename);
return ret;
goto out2;
}
- ret = check_inum_access(fs, parent, W_OK);
+ ret = check_inum_access(ff, parent, W_OK);
if (ret)
goto out2;
goto out2;
}
- ret = check_inum_access(fs, from_dir_ino, W_OK);
+ ret = check_inum_access(ff, from_dir_ino, W_OK);
if (ret)
goto out2;
goto out2;
}
- ret = check_inum_access(fs, to_dir_ino, W_OK);
+ ret = check_inum_access(ff, to_dir_ino, W_OK);
if (ret)
goto out2;
goto out2;
}
- ret = check_inum_access(fs, parent, W_OK);
+ ret = check_inum_access(ff, parent, W_OK);
if (ret)
goto out2;
}
dbg_printf(ff, "%s: ino=%d len=%jd\n", __func__, ino, (intmax_t) len);
- ret = check_inum_access(fs, ino, W_OK);
+ ret = check_inum_access(ff, ino, W_OK);
if (ret)
goto out;
}
dbg_printf(ff, "%s: ino=%d\n", __func__, file->ino);
- ret = check_inum_access(fs, file->ino, check);
+ ret = check_inum_access(ff, file->ino, check);
if (ret) {
/*
* In a regular (Linux) fs driver, the kernel will open
* also employ undocumented hacks (see above).
*/
if (check == R_OK) {
- ret = check_inum_access(fs, file->ino, X_OK);
+ ret = check_inum_access(ff, file->ino, X_OK);
if (ret)
goto out;
} else
}
dbg_printf(ff, "%s: ino=%d name=%s\n", __func__, ino, key);
- ret = check_inum_access(fs, ino, R_OK);
+ ret = check_inum_access(ff, ino, R_OK);
if (ret)
goto out;
}
dbg_printf(ff, "%s: ino=%d\n", __func__, ino);
- ret = check_inum_access(fs, ino, R_OK);
+ ret = check_inum_access(ff, ino, R_OK);
if (ret)
goto out;
}
dbg_printf(ff, "%s: ino=%d name=%s\n", __func__, ino, key);
- ret = check_inum_access(fs, ino, W_OK);
+ ret = check_inum_access(ff, ino, W_OK);
if (ret == -EACCES) {
ret = -EPERM;
goto out;
}
dbg_printf(ff, "%s: ino=%d name=%s\n", __func__, ino, key);
- ret = check_inum_access(fs, ino, W_OK);
+ ret = check_inum_access(ff, ino, W_OK);
if (ret)
goto out;
goto out;
}
- ret = check_inum_access(fs, ino, mask);
+ ret = check_inum_access(ff, ino, mask);
if (ret)
goto out;
goto out2;
}
- ret = check_inum_access(fs, parent, W_OK);
+ ret = check_inum_access(ff, parent, W_OK);
if (ret)
goto out2;
(long long int)ctv[0].tv_sec, ctv[0].tv_nsec,
(long long int)ctv[1].tv_sec, ctv[1].tv_nsec);
- ret = check_inum_access(fs, ino, W_OK);
+ ret = check_inum_access(ff, ino, W_OK);
if (ret)
goto out;