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/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/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..89ec5235e78 --- /dev/null +++ b/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md @@ -0,0 +1,67 @@ +### 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. +``` + +### Sha1 + +``` +Copyright (C) 1998, 2009 +Paul E. Jones +All Rights Reserved + +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 new file mode 100644 index 00000000000..b9f96ba4ca8 --- /dev/null +++ b/tests/licensedcode/data/datadriven/lic1/wt_ibpp_interference.md.yml @@ -0,0 +1,5 @@ +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 + - fpl + - ibpp diff --git a/tests/licensedcode/test_plugin_license_detection.py b/tests/licensedcode/test_plugin_license_detection.py index ff249bc9c58..cc4b3ae3103 100644 --- a/tests/licensedcode/test_plugin_license_detection.py +++ b/tests/licensedcode/test_plugin_license_detection.py @@ -374,3 +374,34 @@ 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(): + 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 = [ + '--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 fpl AND ibpp' + assert any( + match['rule_identifier'] in {'ibpp.LICENSE', 'ibpp_text.RULE'} + for detection in resource.license_detections + for match in detection['matches'] + )