Skip to content

Add rules for GPL-2.0 notices with the old FSF postal address - #5498

Open
Ashutosh-Panda2004 wants to merge 1 commit into
aboutcode-org:developfrom
Ashutosh-Panda2004:fix-5039-gpl2-detected-as-gpl3
Open

Ashutosh-Panda2004 wants to merge 1 commit into
aboutcode-org:developfrom
Ashutosh-Panda2004:fix-5039-gpl2-detected-as-gpl3

Conversation

@Ashutosh-Panda2004

Copy link
Copy Markdown

The GPL-2.0-only notice used by the Linux kernel ray_cs.c driver is not detected as gpl-2.0. It is reported as gpl-3.0-plus on 32.5.0 (see #5039), and on current develop it comes out as gpl-1.0-plus instead. Either way the detection is wrong.

The existing rule gpl-2.0_1226 covers this notice only with the modern ending that points to https://www.gnu.org/licenses/. The ray_cs.c variant ends with the old Free Software Foundation postal address (59 Temple Place, Boston) instead, so no rule covers it and a fuzzy 3-seq match against a full GPL license text wins.

This adds two rules for the notice variants that end with the old postal address, following the same style as gpl-2.0_1226:

  • gpl-2.0_1487 for the "version 2 only" wording, which fixes the reported case
  • gpl-2.0-plus_1156 for the "version 2 or later" wording, which was also detected as gpl-3.0-plus

Both rules have data-driven tests in tests/licensedcode/data/datadriven/lic1 (ray_cs_gpl-2.0.c and ray_cs_gpl-2.0-plus.c).

Test report:

  • I reproduced the issue first on the unfixed code: the ray_cs.c notice was detected as gpl-1.0-plus (gpl_136.RULE, 3-seq, score 96.0).
  • With the fix, the notice is detected as gpl-2.0 (gpl-2.0_1487.RULE, 1-hash, 100.0) and the "version 2 or later" variant as gpl-2.0-plus (gpl-2.0-plus_1156.RULE, 1-hash, 100.0).
  • Controls are unchanged: the GPL-3.0-or-later notice still detects as gpl-3.0-plus and the URL-ending variant still detects as gpl-2.0 through gpl-2.0_1226.
  • The full licensedcode data-driven suites (datadriven1 to 4, external, unknown) plus test_detect.py pass: 4425 passed, 4 xfailed. The rule validation, license model and index tests also pass (664 passed), and datadriven1 passes on a second run (293 passed).

Fixes #5039

The GPL-2.0-only notice used by the Linux kernel ray_cs.c driver ends with the old Free Software Foundation postal address instead of the gnu.org licenses URL covered by gpl-2.0_1226, so it is detected as another GPL variant. Add gpl-2.0_1487 for the version 2 only wording and gpl-2.0-plus_1156 for the version 2 or later wording, with data-driven tests for both.

Signed-off-by: Ashutosh Panda <ashutoshpanda.india@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gpl-2.0 detected as gpl-3.0-plus

1 participant