util.c: escape closing angle bracket in printfd

* util.c (printfd): Use print_quoted_string_ex instead of
print_quoted_string, specify ">" as escape_chars argument.
* tests/fsync-y.c (main): Update expected output.
* NEWS: Mention it.
This commit is contained in:
Eugene Syromyatnikov 2018-02-02 19:06:31 +01:00 committed by Dmitry V. Levin
parent 0b732f7e9d
commit 6d36a70868
3 changed files with 8 additions and 4 deletions

4
NEWS
View File

@ -4,6 +4,10 @@ Noteworthy changes in release ?.?? (????-??-??)
* Changes in infrastructure
* The mailing list was moved to strace-devel@lists.strace.io.
* Changes in behaviour
* Closing angle bracket is now printed as an octal number escape sequence
in the output of paths associated with file descriptors.
* Improvements
* IPv6 addresses shown in socket information in -yy mode are now printed
in brackets.

View File

@ -46,7 +46,7 @@ main(void)
} checks[] = {
{ ARG_STR("\1\0020\v\0047\f\58\t\79\n\10\0171\r\0167\218\37 \\\'\"<<0::0>>1~\177\200\377"),
"\\1\\0020\\v\\0047\\f\\58\\t\\79\\n\\10\\0171\\r\\0167"
"\\218\\37 \\\\\'\\\"<<0::0>>1~\\177\\200\\377" },
"\\218\\37 \\\\\'\\\"<<0::0\\76\\0761~\\177\\200\\377" },
};
if (!getcwd(dir, sizeof(dir)))
@ -60,7 +60,7 @@ main(void)
int rc = fsync(fd);
printf("fsync(%ld<", fd);
print_quoted_string_ex(dir, false, NULL);
print_quoted_string_ex(dir, false, ">");
printf("/%s>) = %s\n", checks[i].fdstr, sprintrc(rc));
close(fd);

4
util.c
View File

@ -434,8 +434,8 @@ printfd(struct tcb *tcp, int fd)
|| str[len - 1] != ']'
|| !(inode = strtoul(str, NULL, 10))
|| !print_sockaddr_by_inode(tcp, fd, inode)) {
print_quoted_string(path, strlen(path),
QUOTE_OMIT_LEADING_TRAILING_QUOTES);
print_quoted_string_ex(path, strlen(path),
QUOTE_OMIT_LEADING_TRAILING_QUOTES, ">");
}
tprints(">");
} else