znew: avoid denial-of-service issue
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 4 Oct 2013 04:12:09 +0000 (21:12 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 4 Oct 2013 04:12:37 +0000 (21:12 -0700)
commit8b112f22fa2a6e6f60370b954ba4003f730fb13f
treeb1e708880a9c3c7b2ecc160b26dd10392e43083e
parent69e0e65915762e6ce6c28a63dc88d7e9f6f4c88b
znew: avoid denial-of-service issue

Reported by Rich Burridge in <http://bugs.gnu.org/15522>.
* znew.in: Rewrite to avoid the need for a temporary file in /tmp.
That way, we avoid the need for set -C
and worrying about denial of service.
Use touch -r and chmod --reference rather than cpmod.
Assume cp -p works, as it's now universal.
Quote 'echo' args better, while we're at it.
(warn, tmp, cpmod, cpmodarg): Remove.
(GZIP): Unset, so that we needn't test for gzip extension.
(ext): Now always '.gz'.
* znew.1: Document the change of implementation assumptions.
znew.1
znew.in