Truncate strings in tarCreateHeader() with strlcpy(), not sprintf().

Noah Misch <noah@leadboat.com>

Commit: d1c1e48832f31c1a4d01201a31a60c751ed4895c
Author: Noah Misch <noah@leadboat.com>
Date: 2015-06-22T00:04:53Z
Releases: 9.4.5
Truncate strings in tarCreateHeader() with strlcpy(), not sprintf().

This supplements the GNU libc bug #6530 workarounds introduced in commit
54cd4f04576833abc394e131288bf3dd7dcf4806.  On affected systems, a
tar-format pg_basebackup failed when some filename beneath the data
directory was not valid character data in the postmaster/walsender
locale.  Back-patch to 9.1, where pg_basebackup was introduced.  Extant,
bug-prone conversion specifications receive only ASCII bytes or involve
low-importance messages.

Files

PathChange+/−
src/bin/pg_basebackup/t/010_pg_basebackup.pl modified +8 −0
src/port/tar.c modified +4 −4