bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tar doesn't handle short reads


From: Dominique Martinet
Subject: Re: Tar doesn't handle short reads
Date: Wed, 5 Aug 2020 23:58:04 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Paul Eggert wrote on Wed, Aug 05, 2020:
> On 8/5/20 11:47 AM, Nikos Tsipinakis wrote:
> >Can you elaborate? I can't find a code path that loses the errno.
> 
> full_read reads a partial block and then tries to read again. The
> second read fails with errno == EIO. full_read then returns the
> number of bytes successfully read, and the caller ignores errno.

Hm, no?

if the second read fails with EIO then at that point in the loop ret < 0
and full_read returns -1.
There is a risk that errno get overwritten by dbgfprintf though, it
should reassign errno = saved_errno before returning, but at the very
least some error will bubble up as Nikos said.

-- 
Dominique



reply via email to

[Prev in Thread] Current Thread [Next in Thread]