Skip to content

Commit 6a1a245

Browse files
committed
Merge remote-tracking branch 'origin/pr/108'
* origin/pr/108: qrexec-lib/pack: sanitize straight quotes in remote filenames qrexec-lib/pack: don't use curly quotes in error messages
2 parents 42e9860 + 13a0ede commit 6a1a245

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

qrexec-lib/pack.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ void notify_end_and_wait_for_result(void)
5555
static void sanitize_remote_filename(char *untrusted_filename)
5656
{
5757
for (; *untrusted_filename; ++untrusted_filename) {
58-
if (*untrusted_filename < ' ' || *untrusted_filename > '~')
58+
if (*untrusted_filename < ' ' ||
59+
*untrusted_filename > '~' ||
60+
*untrusted_filename == '"')
5961
*untrusted_filename = '_';
6062
}
6163
}
@@ -100,10 +102,10 @@ void wait_for_result(void)
100102
if (hdr.error_code != 0) {
101103
switch (hdr.error_code) {
102104
case EEXIST:
103-
call_error_handler("A file named “%s” already exists in QubesIncoming dir", last_filename);
105+
call_error_handler("A file named \"%s\" already exists in QubesIncoming dir", last_filename);
104106
break;
105107
case EINVAL:
106-
call_error_handler("File copy: Corrupted data from packer%s“%s”", last_filename_prefix, last_filename);
108+
call_error_handler("File copy: Corrupted data from packer%s\"%s\"", last_filename_prefix, last_filename);
107109
break;
108110
case EDQUOT:
109111
if (ignore_quota_error) {
@@ -113,7 +115,7 @@ void wait_for_result(void)
113115
}
114116
/* fallthrough */
115117
default:
116-
call_error_handler("File copy: %s%s%s",
118+
call_error_handler("File copy: \"%s%s%s\"",
117119
strerror(hdr.error_code), last_filename_prefix, last_filename);
118120
}
119121
}

0 commit comments

Comments
 (0)