mirror of
https://github.com/vgough/encfs.git
synced 2024-11-22 07:53:31 +01:00
Correct a small issue with encfsctl cat --reverse (#489)
If user provides a path with a leading slash, in reverse mode, it will be converted to '+' by plainpath, and will fail to decode.
This commit is contained in:
parent
4f3e0bae09
commit
154839d67c
@ -429,6 +429,11 @@ static int cmd_cat(int argc, char **argv) {
|
|||||||
if (!rootInfo) return EXIT_FAILURE;
|
if (!rootInfo) return EXIT_FAILURE;
|
||||||
|
|
||||||
const char *path = argv[0];
|
const char *path = argv[0];
|
||||||
|
// If user provides a leading slash, in reverse mode, it will be converted
|
||||||
|
// to "+" by plainpath, and will fail to decode... Workaround below then...
|
||||||
|
if (path[0] == '/') {
|
||||||
|
path++;
|
||||||
|
}
|
||||||
WriteOutput output(STDOUT_FILENO);
|
WriteOutput output(STDOUT_FILENO);
|
||||||
int errCode = processContents(rootInfo, path, output);
|
int errCode = processContents(rootInfo, path, output);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user