#ifndef NETFS_DAEMON_IOHELPERS #define NETFS_DAEMON_IOHELPERS #include #include #include class ModeCheck { public: ModeCheck(const NetFS::ReqEnv & re, const boost::filesystem::path &); 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; static bool ReadableBy(const struct stat &, uid_t u, gid_t g); static bool WritableBy(const struct stat &, uid_t u, gid_t g); static bool ExecutableBy(const struct stat &, uid_t u, gid_t g); private: static struct stat lstat(const boost::filesystem::path &); }; #endif