]> git.ipfire.org Git - thirdparty/tar.git/commit
Disallow modifications to the global pax extended header in update mode.
authorSergey Poznyakoff <gray@gnu.org>
Fri, 21 Dec 2018 12:18:14 +0000 (14:18 +0200)
committerSergey Poznyakoff <gray@gnu.org>
Fri, 21 Dec 2018 12:39:49 +0000 (14:39 +0200)
commit3c2a2cd94d3b062aa5bf850b82364039ec9c6029
tree3bce2a1b74cf6d89772f612c37cc86f52a0d137d
parentea3aea06f1da077dbb4092672dc7e8768ae4f84e
Disallow modifications to the global pax extended header in update mode.

Updating global headers in update mode is not possible, because:

1) If the original archive was not in PAX format, writing the
global header would overwrite first member header (and eventually
data blocks) in the archive.
2) Otherwise, using the --pax-option can make the updated header
occupy more blocks than the original one, which would lead to the
same effect as in 1.

This also fixes
  http://lists.gnu.org/archive/html/bug-tar/2018-12/msg00007.html

* src/xheader.c (xheader_forbid_global): New function.
* src/common.h (xheader_forbid_global): New prototype.
* src/update.c (update_archive): Use xheader_forbid_global, instead
of trying to write global extended header record.
src/common.h
src/update.c
src/xheader.c