Package: pax
Version: 1:20161104-2
pax is incorrectly using utimes() to attempt to set the timestamps of
symbolic links, rather than utimensat() with AT_SYMLINK_NOFOLLOW.
$ install -d -m 0755 a b
$ ln -s /etc/motd a/c
$ cd a
$ pax -r -w * ../b/
pax: Access/modification time set failed on: ../b/c: Operation not permitted
$ strace -e utimes pax -r -w * ../b/
utimes("../b/c", [{tv_sec=1519020077, tv_usec=0}, {tv_sec=1519020077,
tv_usec=0}]) = -1 EPERM (Operation not permitted)
pax: Access/modification time set failed on: ../b/c: Operation not permitted
+++ exited with 1 +++
$
Run this as an unprivileged user. As a privileged user, pax ends up
quietly stomping over the timestamps of whatever is being symbolically
linked to, which can have all sorts of unintended side-effects depending
from what files end up having their timestamps adjusted.
This is a regression from version 1:20140703-2 .
$ pax -r -w * ../b/
$ strace -e utimes pax -r -w * ../b/
+++ exited with 0 +++
$