Control: tag -1 = jessie confirmed

On Sat, Jul 30, 2016 at 16:55:28 +0200, Joel Rosdahl wrote:

> On 29 July 2016 at 14:18, Julien Cristau <jcris...@debian.org> wrote:
> > It doesn't look like you're doing any error checking from lstat; is there no
> > way it'll fail here?
> 
> Hm, right, not checking the error code is a mistake I made when backporting 
> the
> fix. However, I don't think it will cause any problem in practice.
> 
> The code looks like this about 30 lines above:
> 
>     if (stat(argv[i], &st) != 0 || !S_ISREG(st.st_mode)) {
>         // ...
>         continue;
>     }
> 
> So if argv[i] doesn't exist or is not a file (or a symlink to an existing
> file), we won't reach the lstat call. However, lstat will fail if the file or
> symlink happens to be removed between the stat and lstat calls. It looks like
> lstat doesn't touch the stat buffer on failure, so st's content will remain
> from the stat call and S_ISLNK(st.st_mode) will then be false. The false 
> branch
> will call make_relative_path which handles non-existing files correctly.
> 
> Do you think that this is serious enough to require an updated
> package? If so, I'll do it.
> 
Thanks for looking into it.  Given the above, feel free to upload with
your original patch.

Cheers,
Julien

Reply via email to