[Debian-med-packaging] Bug#973070: libsis-base-java: FTBFS: Could not delete the directory targets/unit-test-wd/ch.syst

Bernd Rinn brinn at ethz.ch
Wed Oct 28 20:40:29 GMT 2020


Hi Andreas,

I can confirm that this bug is in commons-io 2.8.0 while commons-io 2.6 
workes fine.

The bug is in PathUtils.deleteFile(), line 360 and 361:
"""
         final boolean exists = Files.exists(file, 
LinkOption.NOFOLLOW_LINKS);
         final long size = exists ? Files.size(file) : 0;
"""
It determines "exists" based on not following the symlink by using 
LinkOption.NOFOLLOW_LINKS, but then in the next line uses 
Files.size(file) to determine the size which *does* follow the symlink. 
Kaboom. This will prevent PathUtils.deleteFile() to delete any dangling 
symlink (which it has to in my test case).

I have attached a patch for commons-io 2.8.0 which fixes this bug.

Cheers,
Bernd

On 10/28/20 8:29 PM, Andreas Tille wrote:
> Control: forwarded -1 Bernd Rinn <brinn at ethz.ch>
> 
> Hi,
> 
> I'd recommend reading the bug report log from here to get some hints
> about recommended changes in the code:
> 
>     https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973070#17
> 
> For the moment I've excluded the affected tests.
> 
> Kind regards
> 
>        Andreas.
>     
> 
> ----- Forwarded message from Markus Koschany <apo at debian.org> -----
> 
> Date: Wed, 28 Oct 2020 19:34:35 +0100
> From: Markus Koschany <apo at debian.org>
> To: Debian Java List <debian-java at lists.debian.org>
> Cc: 973070 at bugs.debian.org
> Subject: Bug#973070: Bug#973070: Help needed: Bug#973070: libsis-base-java: FTBFS: Could not delete the directory
> 	targets/unit-test-wd/ch.systemsx.cisd.base.unix.UnixTests because: 1 exceptions: [java.io.IOException: Unable to delete file:
> 	targets/unit-test-wd/ch.systemsx.cisd.base.unix.UnixTests/someDanglingLink]
> X-Debian-PR-Message: followup 973070
> X-Debian-PR-Package: src:libsis-base-java
> X-Debian-PR-Keywords: bullseye ftbfs help sid
> X-Debian-PR-Source: libsis-base-java
> 
> 
> 
> Am 28.10.20 um 16:01 schrieb olivier sallou:
> [...]
>> *dumb* patch would be to simply remove those tests from code...
> 
> Either this or you can keep the override for dh_auto_test-arch empty.
> 
> The test creates a broken symlink but then FileUtils.deleteDirectory
> fails to delete the file, obviously because it is not a directory but
> I'm not sure how it really handles symlinks within directories. See also
> [1]. Probably upstream should switch to the java.nio.file API (they
> still use java.io.File), test for the existence of symlinks and then try
> File.delete instead of FileUtils.deleteDirectory first. Not tested, just
> a guess.
> 
> Markus
> 
> 
> [1] https://issues.apache.org/jira/browse/IO-576
> 
> 
> 
> 
> 
> _______________________________________________
> Debian-med-packaging mailing list
> Debian-med-packaging at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-packaging
> 
> 
> ----- End forwarded message -----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bug#973070.patch
Type: text/x-patch
Size: 666 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-med-packaging/attachments/20201028/3f544b5a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://alioth-lists.debian.net/pipermail/debian-med-packaging/attachments/20201028/3f544b5a/attachment-0001.bin>


More information about the Debian-med-packaging mailing list