]> Dogcows Code - chaz/tar/commitdiff
tar: don't assume O_NONBLOCK is benign on regular files
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 6 Jan 2012 20:38:55 +0000 (12:38 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 6 Jan 2012 20:40:47 +0000 (12:40 -0800)
On Data Migration Facility (DMF), High Peformance Storage System (HPSS),
and presumably other file systems based on hierarchical storage, opening
a regular file with O_NONBLOCK can cause later reads to fail with
errno == EAGAIN.  We need the O_NONBLOCK to avoid some security races.
Work around the problem by using fcntl to clear the O_NONBLOCK
flag if I/O fails with that errno value.
Problem reported by Vitezslav Cizek in
<http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00000.html>.
* src/common.h (blocking_read, blocking_write): New decls.
* src/misc.c (blocking_read, blocking_write): New functions.
* src/compare.c (process_rawdata):
* src/create.c (dump_regular_file):
* src/extract.c (extract_file):
* src/sparse.c (sparse_scan_file, sparse_extract_region):


No differences found
This page took 0.023128 seconds and 4 git commands to generate.