DirNode.h (encfs-1.9.4) | : | DirNode.h (encfs-1.9.5) | ||
---|---|---|---|---|
skipping to change at line 52 | skipping to change at line 52 | |||
class Cipher; | class Cipher; | |||
class EncFS_Context; | class EncFS_Context; | |||
class FileNode; | class FileNode; | |||
class NameIO; | class NameIO; | |||
class RenameOp; | class RenameOp; | |||
struct RenameEl; | struct RenameEl; | |||
class DirTraverse { | class DirTraverse { | |||
public: | public: | |||
DirTraverse(std::shared_ptr<DIR> dirPtr, uint64_t iv, | DirTraverse(std::shared_ptr<DIR> dirPtr, uint64_t iv, | |||
std::shared_ptr<NameIO> naming); | std::shared_ptr<NameIO> naming, bool root); | |||
~DirTraverse(); | ~DirTraverse(); | |||
DirTraverse &operator=(const DirTraverse &src); | DirTraverse &operator=(const DirTraverse &src); | |||
// returns FALSE to indicate an invalid DirTraverse (such as when | // returns FALSE to indicate an invalid DirTraverse (such as when | |||
// an invalid directory is requested for traversal) | // an invalid directory is requested for traversal) | |||
bool valid() const; | bool valid() const; | |||
// return next plaintext filename | // return next plaintext filename | |||
// If fileType is not 0, then it is used to return the filetype (or 0 if | // If fileType is not 0, then it is used to return the filetype (or 0 if | |||
skipping to change at line 77 | skipping to change at line 77 | |||
The opposite of nextPlaintextName(), as that skips undecodable names.. | The opposite of nextPlaintextName(), as that skips undecodable names.. | |||
*/ | */ | |||
std::string nextInvalid(); | std::string nextInvalid(); | |||
private: | private: | |||
std::shared_ptr<DIR> dir; // struct DIR | std::shared_ptr<DIR> dir; // struct DIR | |||
// initialization vector to use. Not very general purpose, but makes it | // initialization vector to use. Not very general purpose, but makes it | |||
// more efficient to support filename IV chaining.. | // more efficient to support filename IV chaining.. | |||
uint64_t iv; | uint64_t iv; | |||
std::shared_ptr<NameIO> naming; | std::shared_ptr<NameIO> naming; | |||
bool root; | ||||
}; | }; | |||
inline bool DirTraverse::valid() const { return dir.get() != 0; } | inline bool DirTraverse::valid() const { return dir.get() != 0; } | |||
class DirNode { | class DirNode { | |||
public: | public: | |||
// sourceDir points to where raw files are stored | // sourceDir points to where raw files are stored | |||
DirNode(EncFS_Context *ctx, const std::string &sourceDir, | DirNode(EncFS_Context *ctx, const std::string &sourceDir, | |||
const FSConfigPtr &config); | const FSConfigPtr &config); | |||
~DirNode(); | ~DirNode(); | |||
skipping to change at line 133 | skipping to change at line 134 | |||
// traverse directory | // traverse directory | |||
DirTraverse openDir(const char *plainDirName); | DirTraverse openDir(const char *plainDirName); | |||
// uid and gid are used as the directory owner, only if not zero | // uid and gid are used as the directory owner, only if not zero | |||
int mkdir(const char *plaintextPath, mode_t mode, uid_t uid = 0, | int mkdir(const char *plaintextPath, mode_t mode, uid_t uid = 0, | |||
gid_t gid = 0); | gid_t gid = 0); | |||
int rename(const char *fromPlaintext, const char *toPlaintext); | int rename(const char *fromPlaintext, const char *toPlaintext); | |||
int link(const char *from, const char *to); | int link(const char *to, const char *from); | |||
// returns idle time of filesystem in seconds | // returns idle time of filesystem in seconds | |||
int idleSeconds(); | int idleSeconds(); | |||
protected: | protected: | |||
/* | /* | |||
notify that a file is being renamed. | notify that a file is being renamed. | |||
This renames the internal node, if any. If the file is not open, then | This renames the internal node, if any. If the file is not open, then | |||
this call has no effect. | this call has no effect. | |||
Returns the FileNode if it was found. | Returns the FileNode if it was found. | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 3 lines changed or added |