From 21adf60bfb627fef74af0ec146537ed731d11d22 Mon Sep 17 00:00:00 2001 From: kumarasantosh Date: Wed, 15 Apr 2026 22:16:39 +0530 Subject: [PATCH 1/2] licenses: add IBPP License v1.1 detection [fixes #3553] Signed-off-by: kumarasantosh --- src/licensedcode/data/rules/ibpp_intro.RULE | 15 +++++++++++ src/licensedcode/data/rules/ibpp_ref.RULE | 6 +++++ .../data/datadriven/lic1/ibpp.txt | 22 +++++++++++++++ .../data/datadriven/lic1/ibpp.txt.yml | 2 ++ .../datadriven/lic1/wt_ibpp_interference.md | 26 ++++++++++++++++++ .../lic1/wt_ibpp_interference.md.yml | 5 ++++ .../test_plugin_license_detection.py | 27 +++++++++++++++++++ 7 files changed, 103 insertions(+) create mode 100644 src/licensedcode/data/rules/ibpp_intro.RULE create mode 100644 src/licensedcode/data/rules/ibpp_ref.RULE create mode 100644 tests/licensedcode/data/datadriven/lic1/ibpp.txt create mode 100644 tests/licensedcode/data/datadriven/lic1/ibpp.txt.yml create mode 100644 tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md create mode 100644 tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md.yml diff --git a/src/licensedcode/data/rules/ibpp_intro.RULE b/src/licensedcode/data/rules/ibpp_intro.RULE new file mode 100644 index 00000000000..7f393ad6b2c --- /dev/null +++ b/src/licensedcode/data/rules/ibpp_intro.RULE @@ -0,0 +1,15 @@ +--- +license_expression: ibpp +is_license_intro: yes +relevance: 85 +ignorable_copyrights: + - (c) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org) +ignorable_holders: + - T.I.P. Group S.A. and the IBPP Team +ignorable_urls: + - http://www.ibpp.org/ +--- +IBPP License v1.1 +----------------- + +(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org) diff --git a/src/licensedcode/data/rules/ibpp_ref.RULE b/src/licensedcode/data/rules/ibpp_ref.RULE new file mode 100644 index 00000000000..33b1b92c021 --- /dev/null +++ b/src/licensedcode/data/rules/ibpp_ref.RULE @@ -0,0 +1,6 @@ +--- +license_expression: ibpp +is_license_reference: yes +relevance: 90 +--- +IBPP License, see appendix diff --git a/tests/licensedcode/data/datadriven/lic1/ibpp.txt b/tests/licensedcode/data/datadriven/lic1/ibpp.txt new file mode 100644 index 00000000000..99ef9e6b258 --- /dev/null +++ b/tests/licensedcode/data/datadriven/lic1/ibpp.txt @@ -0,0 +1,22 @@ +IBPP License v1.1 +----------------- + +(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org) + +Permission is hereby granted, free of charge, to any person or organization +("You") obtaining a copy of this software and associated documentation files +covered by this license (the "Software") to use the Software as part of another +work; to modify it for that purpose; to publish or distribute it, modified or +not, for that same purpose; to permit persons to whom the other work using the +Software is furnished to do so; subject to the following conditions: the above +copyright notice and this complete and unmodified permission notice shall be +included in all copies or substantial portions of the Software; You will not +misrepresent modified versions of the Software as being the original. + +The Software is provided "as is", without warranty of any kind, express or +implied, including but not limited to the warranties of merchantability, +fitness for a particular purpose and noninfringement. In no event shall +the authors or copyright holders be liable for any claim, damages or other +liability, whether in an action of contract, tort or otherwise, arising from, +out of or in connection with the software or the use of other dealings in +the Software. diff --git a/tests/licensedcode/data/datadriven/lic1/ibpp.txt.yml b/tests/licensedcode/data/datadriven/lic1/ibpp.txt.yml new file mode 100644 index 00000000000..478f3b1a5f0 --- /dev/null +++ b/tests/licensedcode/data/datadriven/lic1/ibpp.txt.yml @@ -0,0 +1,2 @@ +license_expressions: + - ibpp diff --git a/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md b/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md new file mode 100644 index 00000000000..e2f3d9169b4 --- /dev/null +++ b/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md @@ -0,0 +1,26 @@ +passwdqc +Copyright (c) 2000-2002 by Solar Designer +Copyright (c) 2008,2009 by Dmitry V. Levin +Redistribution and use in source and binary forms, with or without +modification, are permitted. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +| IBPP | Wt::Dbo Firebird backend | IBPP License, see appendix | Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team | + +### IBPP + +IBPP License v1.1 +----------------- + +(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org) diff --git a/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md.yml b/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md.yml new file mode 100644 index 00000000000..b3f4bd6ed67 --- /dev/null +++ b/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md.yml @@ -0,0 +1,5 @@ +notes: Minimal Wt-derived regression fixture for issue #3553, keeping the passwdqc disclaimer immediately before the IBPP reference and appendix intro. +license_expressions: + - bsd-1-clause + - ibpp + - ibpp diff --git a/tests/licensedcode/test_plugin_license_detection.py b/tests/licensedcode/test_plugin_license_detection.py index ff249bc9c58..20f75d6a3c2 100644 --- a/tests/licensedcode/test_plugin_license_detection.py +++ b/tests/licensedcode/test_plugin_license_detection.py @@ -374,3 +374,30 @@ def test_match_reference_license(): must_exist=False, ) check_json_scan(expected_loc, result_file, regen=REGEN_TEST_FIXTURES) + + +def test_wt_ibpp_interference_is_detected_in_scan_output(): + test_file = test_env.get_test_loc('datadriven/lic1/wt_ibpp_interference.md') + result_file = test_env.get_temp_file('json') + args = [ + '--license', + '--license-text', + '--license-text-diagnostics', + '--license-diagnostics', + '--strip-root', + '--json', result_file, + test_file, + ] + run_scan_click(args, processes='1') + + from commoncode.resource import VirtualCodebase + + codebase = VirtualCodebase(result_file) + resource = codebase.get_resource(path='wt_ibpp_interference.md') + + assert resource.detected_license_expression == 'bsd-1-clause AND ibpp' + assert any( + match['license_expression'] == 'ibpp' + for detection in resource.license_detections + for match in detection['matches'] + ) From 9be3495741eb8a54567f4535843aa3a83f22c80d Mon Sep 17 00:00:00 2001 From: kumarasantosh Date: Wed, 15 Apr 2026 22:13:41 +0530 Subject: [PATCH 2/2] licenses: fix Wt IBPP regression coverage Signed-off-by: kumarasantosh --- src/licensedcode/data/rules/ibpp_text.RULE | 28 ++++++++++++ .../datadriven/lic1/wt_ibpp_interference.md | 45 ++++++++++++++++++- .../lic1/wt_ibpp_interference.md.yml | 4 +- .../test_plugin_license_detection.py | 8 +++- 4 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 src/licensedcode/data/rules/ibpp_text.RULE diff --git a/src/licensedcode/data/rules/ibpp_text.RULE b/src/licensedcode/data/rules/ibpp_text.RULE new file mode 100644 index 00000000000..1774819c2cc --- /dev/null +++ b/src/licensedcode/data/rules/ibpp_text.RULE @@ -0,0 +1,28 @@ +--- +license_expression: ibpp +is_license_text: yes +relevance: 100 +notes: Full IBPP text variant with the inserted copyright line seen in the Wt appendix. +--- +IBPP License v1.1 +----------------- + +(C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org) + +Permission is hereby granted, free of charge, to any person or organization +("You") obtaining a copy of this software and associated documentation files +covered by this license (the "Software") to use the Software as part of another +work; to modify it for that purpose; to publish or distribute it, modified or +not, for that same purpose; to permit persons to whom the other work using the +Software is furnished to do so; subject to the following conditions: the above +copyright notice and this complete and unmodified permission notice shall be +included in all copies or substantial portions of the Software; You will not +misrepresent modified versions of the Software as being the original. + +The Software is provided "as is", without warranty of any kind, express or +implied, including but not limited to the warranties of merchantability, +fitness for a particular purpose and noninfringement. In no event shall +the authors or copyright holders be liable for any claim, damages or other +liability, whether in an action of contract, tort or otherwise, arising from, +out of or in connection with the software or the use of other dealings in +the Software. diff --git a/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md b/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md index e2f3d9169b4..89ec5235e78 100644 --- a/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md +++ b/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md @@ -1,4 +1,6 @@ -passwdqc +### passwdqc + +``` Copyright (c) 2000-2002 by Solar Designer Copyright (c) 2008,2009 by Dmitry V. Levin Redistribution and use in source and binary forms, with or without @@ -15,12 +17,51 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +``` + +### Sha1 + +``` +Copyright (C) 1998, 2009 +Paul E. Jones +All Rights Reserved -| IBPP | Wt::Dbo Firebird backend | IBPP License, see appendix | Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team | +Freeware Public License (FPL) + +This software is licensed as "freeware." Permission to distribute +this software in source and binary forms, including incorporation +into other products, is hereby granted without a fee. THIS SOFTWARE +IS PROVIDED 'AS IS' AND WITHOUT ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHOR SHALL NOT BE HELD +LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE, EITHER +DIRECTLY OR INDIRECTLY, INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA +OR DATA BEING RENDERED INACCURATE. +``` ### IBPP +``` IBPP License v1.1 ----------------- (C) Copyright 2000-2006 T.I.P. Group S.A. and the IBPP Team (www.ibpp.org) + +Permission is hereby granted, free of charge, to any person or organization +("You") obtaining a copy of this software and associated documentation files +covered by this license (the "Software") to use the Software as part of another +work; to modify it for that purpose; to publish or distribute it, modified or +not, for that same purpose; to permit persons to whom the other work using the +Software is furnished to do so; subject to the following conditions: the above +copyright notice and this complete and unmodified permission notice shall be +included in all copies or substantial portions of the Software; You will not +misrepresent modified versions of the Software as being the original. + +The Software is provided "as is", without warranty of any kind, express or +implied, including but not limited to the warranties of merchantability, +fitness for a particular purpose and noninfringement. In no event shall +the authors or copyright holders be liable for any claim, damages or other +liability, whether in an action of contract, tort or otherwise, arising from, +out of or in connection with the software or the use of other dealings in +the Software. +``` diff --git a/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md.yml b/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md.yml index b3f4bd6ed67..b9f96ba4ca8 100644 --- a/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md.yml +++ b/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md.yml @@ -1,5 +1,5 @@ -notes: Minimal Wt-derived regression fixture for issue #3553, keeping the passwdqc disclaimer immediately before the IBPP reference and appendix intro. +notes: Wt-derived appendix excerpt for issue #3553, preserving the upstream passwdqc and Sha1 blocks immediately before the IBPP appendix text without the table-row reference shortcut. license_expressions: - bsd-1-clause - - ibpp + - fpl - ibpp diff --git a/tests/licensedcode/test_plugin_license_detection.py b/tests/licensedcode/test_plugin_license_detection.py index 20f75d6a3c2..cc4b3ae3103 100644 --- a/tests/licensedcode/test_plugin_license_detection.py +++ b/tests/licensedcode/test_plugin_license_detection.py @@ -377,6 +377,10 @@ def test_match_reference_license(): def test_wt_ibpp_interference_is_detected_in_scan_output(): + from licensedcode.cache import get_index + + get_index(force=True) + test_file = test_env.get_test_loc('datadriven/lic1/wt_ibpp_interference.md') result_file = test_env.get_temp_file('json') args = [ @@ -395,9 +399,9 @@ def test_wt_ibpp_interference_is_detected_in_scan_output(): codebase = VirtualCodebase(result_file) resource = codebase.get_resource(path='wt_ibpp_interference.md') - assert resource.detected_license_expression == 'bsd-1-clause AND ibpp' + assert resource.detected_license_expression == 'bsd-1-clause AND fpl AND ibpp' assert any( - match['license_expression'] == 'ibpp' + match['rule_identifier'] in {'ibpp.LICENSE', 'ibpp_text.RULE'} for detection in resource.license_detections for match in detection['matches'] )