From 154839d67c9b7504687bcc2301fd2782ff9f3368 Mon Sep 17 00:00:00 2001 From: Ben RUBSON Date: Mon, 19 Mar 2018 22:29:35 +0100 Subject: [PATCH] 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. --- encfs/encfsctl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/encfs/encfsctl.cpp b/encfs/encfsctl.cpp index 5602086..49369d7 100644 --- a/encfs/encfsctl.cpp +++ b/encfs/encfsctl.cpp @@ -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);