Skip to content

gpl-2.0 detected as gpl-3.0-plus #5039

Open

Description

@chinyeungli

The following "matched_text" is clearly a gpl-2.0 notice, but SCTK detected it as 'gpl-3.0-plus`

"matched_text": " * This driver is free software; you can redistribute it and/or modify\n * it under the terms of version 2 only of the GNU General Public License as\n * published by the Free Software Foundation.\n *\n * It is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA"

            "tool_name": "scancode-toolkit",
            "tool_version": "32.5.0",
                {
                    "license_expression": "gpl-3.0-plus",
                    "license_expression_spdx": "GPL-3.0-or-later",
                    "matches": [
                        {
                            "license_expression": "gpl-3.0-plus",
                            "license_expression_spdx": "GPL-3.0-or-later",
                            "from_file": "linux-2.6/linux-2.6.30/drivers/net/wireless/ray_cs.c",
                            "start_line": 10,
                            "end_line": 21,
                            "matcher": "3-seq",
                            "score": 93.33,
                            "matched_length": 98,
                            "match_coverage": 93.33,
                            "rule_relevance": 100,
                            "rule_identifier": "gpl-3.0-plus_101.RULE",
                            "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/gpl-3.0-plus_101.RULE",
                            "matched_text": " * This driver is free software; you can redistribute it and/or modify\n * it under the terms of version 2 only of the GNU General Public License as\n * published by the Free Software Foundation.\n *\n * It is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA"
                        }
                    ],
                    "identifier": "gpl_3_0_plus-50a35d34-9a1a-73d8-8010-25c11aaad4ad"
                },

Activity

  1. armijnhemel commented on May 19, 2026

    @armijnhemel
    Collaborator

    Related: #4951

  2. Ashutosh-Panda2004 commented on Nov 17, 2026

    @Ashutosh-Panda2004

    Hi, I would like to work on this one. I will start by reproducing the detection on the ray_cs.c notice text, then look at why the gpl-3.0-plus rule fires on it.

  3. Ashutosh-Panda2004 commented on Nov 17, 2026

    @Ashutosh-Panda2004

    I opened a PR for this: #5498

    The notice text from ray_cs.c is not covered by any rule. The closest one, gpl-2.0_1226, covers the same notice only with the gnu.org licenses URL ending, while this variant ends with the old FSF postal address, so a fuzzy match against a full GPL license text won instead. I added a rule for the version 2 only wording, and one for the version 2 or later wording which had the same problem, with data-driven tests for both.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions