Skip to content

Commit

Permalink
Correct a small issue with encfsctl cat --reverse (#489)
Browse files Browse the repository at this point in the history
If user provides a path with a leading slash, in reverse mode, it will be converted to '+' by plainpath, and will fail to decode.
  • Loading branch information
Ben RUBSON committed Mar 19, 2018
1 parent 4f3e0ba commit 154839d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions encfs/encfsctl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,11 @@ static int cmd_cat(int argc, char **argv) {
if (!rootInfo) return EXIT_FAILURE;

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);
int errCode = processContents(rootInfo, path, output);

Expand Down

0 comments on commit 154839d

Please sign in to comment.