Skip to content

Commit

Permalink
also escape single & double quotes, parenthesis and angle brackets
Browse files Browse the repository at this point in the history
This fixes...

incrond[1714]: cannot exec process: Resource temporarily unavailable

... with bad file name due to messing escaping.
  • Loading branch information
eworm-de committed Apr 29, 2022
1 parent 47263e6 commit 35f4298
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions incrontab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ std::string IncronTabEntry::GetSafePath(const std::string& rPath)
SIZE len = rPath.length();
for (SIZE i = 0; i < len; i++) {
if (rPath[i] == ' ' ||
rPath[i] == '\'' ||
rPath[i] == '"' ||
rPath[i] == '(' ||
rPath[i] == ')' ||
rPath[i] == '<' ||
rPath[i] == '>' ||
rPath[i] == '\\') {
stream << "\\";
}
Expand Down

0 comments on commit 35f4298

Please sign in to comment.