Bug 1350021 - licensecheck invokes find with -follow
Summary: licensecheck invokes find with -follow
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: licensecheck
Version: rawhide
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Sandro Mani
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-24 20:43 UTC by Jerry James
Modified: 2016-07-22 19:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-22 19:11:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Debian BTS 830115 0 None None None 2016-07-06 08:01:40 UTC

Description Jerry James 2016-06-24 20:43:36 UTC
Description of problem:
I just started a package review.  When licensecheck ran, it reported:

find: File system loop detected; ‘./src/giac’ is part of the same file system loop as ‘./src’.
Can't close(GLOB(0x668db0)) filehandle: '' at /usr/bin/licensecheck line 387

and fedora-review has this to say:

[ ]: License field in the package spec file matches the actual license.
     Note: Cannot run licensecheck: Command 'licensecheck -r /var/lib/mock
     /fedora-rawhide-x86_64/root/builddir/build/BUILD/giac-1.2.2' returned
     non-zero exit status 1

There are two bugs here: licensecheck tries to close a file handle on line 387 even when the handle is already closed due to find exiting with an error, and licensecheck invokes find with the -follow option.

The find man page says that -follow is deprecated and -L should be used instead, by the way.  But I can't conceive of any situation where using -follow/-L is the right thing to do.  I think it should be removed, for three reasons.  Reason 1: self loops like the one in giac make find, and therefore licensecheck, fail.  Reason 2: symlinks can point anywhere.  Do you really want to let licensecheck run over arbitrary parts of the filesystem?  Reason 3: every file in a package *should* be reachable without traversing symlinks at all.  (If fedora-review doesn't have a check for that, it probably should.)

Version-Release number of selected component (if applicable):
devscripts-minimal-2.15.10-2.fc23.x86_64

but I also see this in Rawhide, which has:

devscripts-minimal-2.16.5-1.fc25.x86_64

How reproducible:
Always

Steps to Reproduce:
1. mkdir loop
2. ln -s . loop/loop
3. licensecheck -r -v loop

Actual results:
The error messages reported above, and no license output.

Expected results:
A report on licenses.

Additional info:
The filesystem type might have something to do with this.  I do NOT see this behavior if I create the loop under /tmp (tmpfs), but I do see it if the loop is under my /home directory (ext4).

Comment 1 Sandro Mani 2016-06-24 20:59:59 UTC
Reported upstream at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=828088

Comment 2 Sandro Mani 2016-07-22 19:11:37 UTC
Fixed in licensecheck-3.0.7-1.fc25


Note You need to log in before you can comment on or make changes to this bug.