mirror of
https://github.com/vgough/encfs.git
synced 2024-11-22 16:03:34 +01:00
Add comments to path-handling functions in DirNode.cpp
This commit is contained in:
parent
34d15bbeaa
commit
8eea3be2db
@ -275,14 +275,32 @@ string DirNode::rootDirectory() {
|
||||
return string(rootDir, 0, rootDir.length() - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypt a plain-text file path to the ciphertext path with the
|
||||
* ciphertext root directory name prefixed.
|
||||
*
|
||||
* Example:
|
||||
* $ encfs -f -v cipher plain
|
||||
* $ cd plain
|
||||
* $ touch foobar
|
||||
* cipherPath: /foobar encoded to cipher/NKAKsn2APtmquuKPoF4QRPxS
|
||||
*/
|
||||
string DirNode::cipherPath(const char *plaintextPath) {
|
||||
return rootDir + naming->encodePath(plaintextPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as cipherPath(), but does not prefix the ciphertext root directory
|
||||
*/
|
||||
string DirNode::cipherPathWithoutRoot(const char *plaintextPath) {
|
||||
return naming->encodePath(plaintextPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the decrypted version of cipherPath
|
||||
*
|
||||
* In reverse mode, returns the encrypted version of cipherPath
|
||||
*/
|
||||
string DirNode::plainPath(const char *cipherPath_) {
|
||||
try {
|
||||
// Handle special absolute path encodings.
|
||||
|
@ -374,8 +374,8 @@ int encfs_symlink(const char *to, const char *from) {
|
||||
if (!FSRoot) return res;
|
||||
|
||||
try {
|
||||
// allow fully qualified names in symbolic links.
|
||||
string fromCName = FSRoot->cipherPath(from);
|
||||
// allow fully qualified names in symbolic links.
|
||||
string toCName = FSRoot->relativeCipherPath(to);
|
||||
|
||||
rLog(Info, "symlink %s -> %s", fromCName.c_str(), toCName.c_str());
|
||||
|
Loading…
Reference in New Issue
Block a user