Skip to content

Commit

Permalink
Better error message for forbidden symbolic links
Browse files Browse the repository at this point in the history
The error message is not great, but at least it is not actively
misleading anymore.

Will fix QubesOS/qubes-issues#8581 once this is used by qfile-unpacker
and qfile-agent.

(cherry picked from commit 34172df)
  • Loading branch information
DemiMarie authored and marmarek committed Jun 22, 2024
1 parent be7940c commit ae8c2ce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions qrexec-lib/pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ void wait_for_result(void)
case EINVAL:
call_error_handler("File copy: Corrupted data from packer%s\"%s\"", last_filename_prefix, last_filename);
break;
case EILSEQ:
call_error_handler("Forbidden character in file or link target. Name might look somewhat like \"%s\"", last_filename);
break;
case ENOLINK:
// FIXME: the protocol only provides the name of the file, not what it points to.
// FIXME: This assumes that a symlink target was rejected, not a path. However,
// this code should only produces valid paths, so if an invalid path gets sent,
// that's a bug.
call_error_handler("Cannot verify that link at \"%s\" would not be broken by copy", last_filename);
break;
case EDQUOT:
if (ignore_quota_error) {
/* skip also CRC check as sender and receiver might be
Expand Down

0 comments on commit ae8c2ce

Please sign in to comment.