bug-gnulib
[Top][All Lists]
Advanced

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

Re: findutils-git: 1 test may fail


From: Eric Blake
Subject: Re: findutils-git: 1 test may fail
Date: Mon, 3 Aug 2009 18:47:27 +0000 (UTC)

> one test -- test-dup2 -- recently added to the findutils test suite
> is
> inherently broken and may fail.

Thanks for the report.

> 
> The test (from gnulib) assumes that after (test-dup2.c line 68)
>       int fd = open (file, O_CREAT | O_RDWR, 0600);
> fd is an open file (correct), and that fd+1, fd+2 are not (wrong, that
> may
> or may not be true).
> 
> E.g., when running the testsuite under Midnight Commander (mc),
> originally the open
> files are 0, 1, 2, 4, 6, 8, and 255. Thus fd=3, and fd+1 is open.

Good catch.

> PLEASE: remove that test and report the problem to the gnulib
> maintainers.

Rather than removing the test, let's fix it by closing the next
two fd's.  It should be an easy enough fix, but I don't have
commit access right now or I would do it.  And you can report
this directly to the gnulib maintainers yourself (as I just did
by adding a cc).  The ASSERT on line 72 was designed to catch
testsuite portability problems as much as platform bugs.

Meanwhile, consider writing a bug report against mc for letting
so many fd's leak into child processes, whether or not those fd's
have any bearing on the children.  In some regards, leaking fd's
can form security weaknesses.

-- 
Eric Blake




reply via email to

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