#ifndef NETFS_DAEMON_IOHELPERS #define NETFS_DAEMON_IOHELPERS #include #include #include #include class ModeCheck { public: ModeCheck(const NetFS::ReqEnv & re, const boost::filesystem::path &, const EntCache &, const EntCache &); void AssertRead(const boost::filesystem::path &) const; void AssertWrite(const boost::filesystem::path &) const; const uid_t myu; const gid_t myg; const boost::filesystem::path & root; bool ReadableBy(const struct stat &, uid_t u, gid_t g) const; bool WritableBy(const struct stat &, uid_t u, gid_t g) const; bool ExecutableBy(const struct stat &, uid_t u, gid_t g) const; private: static struct stat lstat(const boost::filesystem::path &); const EntCache & userLookup; const EntCache & groupLookup; }; #endif