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

Bug#831426: jessie-pu: package ccache/3.1.12-1



On 29 July 2016 at 14:18, Julien Cristau <jcristau@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.

-- Joel


Reply to: