[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#724930: [lintian] Detect infamous nvidia licence problem



Package: lintian
Version: 2.5.17
Severity: important
Tags: patch

Detect this infamous license. Important because it is even not distribuable.

>From 17ae672b0ebf78163ab97da70889beaa46ea06f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sun, 29 Sep 2013 19:54:59 +0200
Subject: [PATCH] Detect nvidia non distribuable license

Nvidia use for opencv example a non free/non distribuable license.
Detect it using lintian.
---
 checks/cruft.desc                                  | 14 ++++++++++-
 checks/cruft.pm                                    | 27 +++++++++++++++++++---
 .../cruft-nvidia-intellectual/debian/src/badcv.c   | 12 ++++++++++
 .../cruft-nvidia-intellectual/debian/src/badcv2.c  | 10 ++++++++
 .../debian/src/falsepositive/allmankind.c          | 12 ++++++++++
 t/tests/cruft-nvidia-intellectual/desc             |  5 ++++
 t/tests/cruft-nvidia-intellectual/tags             |  2 ++
 7 files changed, 78 insertions(+), 4 deletions(-)
 create mode 100644 t/tests/cruft-nvidia-intellectual/debian/src/badcv.c
 create mode 100644 t/tests/cruft-nvidia-intellectual/debian/src/badcv2.c
 create mode 100644 t/tests/cruft-nvidia-intellectual/debian/src/falsepositive/allmankind.c
 create mode 100644 t/tests/cruft-nvidia-intellectual/desc
 create mode 100644 t/tests/cruft-nvidia-intellectual/tags

diff --git a/checks/cruft.desc b/checks/cruft.desc
index c0e4e32..9fd7277 100644
--- a/checks/cruft.desc
+++ b/checks/cruft.desc
@@ -326,7 +326,7 @@ Info: The Debian diff or native package contains a file ending in
 Tag: diff-contains-substvars
 Severity: normal
 Certainty: certain
-Info: Lintian found a substvars file in the Debian diff for this source 
+Info: Lintian found a substvars file in the Debian diff for this source
  package. The debian/substvars (or debian/<tt>package</tt>.substvars) file
  is usually generated and modified dynamically by debian/rules targets, in
  which case it must be removed by the clean target.
@@ -514,6 +514,18 @@ Info: The given source file is licensed under GFDL, but without any
 Ref: http://wiki.debian.org/qa.debian.org/gfdlinvariant,
  http://www.debian.org/vote/2006/vote_001
 
+Tag: license-problem-nvidia-intellectual
+Severity: serious
+Certainty: possible
+Info: The given source file include part license under a
+ non-free and non-distribuable license from NVIDIA.
+ .
+ Please file a bug against the package and another bug against
+ snapshot.debian.org and ftp.debian.org asking to removal.
+ .
+ Should this be a false-positive, please report a bug
+ against lintian.
+
 Tag: source-contains-unsafe-symlink
 Severity: serious
 Certainty: possible
diff --git a/checks/cruft.pm b/checks/cruft.pm
index cbb2919..02f96fe 100644
--- a/checks/cruft.pm
+++ b/checks/cruft.pm
@@ -437,9 +437,6 @@ sub find_cruft {
             close($fd);
         }
 
-        # license issues do not apply to non-free
-        next ENTRY
-          if $info->is_non_free;
         # license string in debian/changelog are probably just changes
         next ENTRY
           if $name eq 'debian/changelog';
@@ -479,6 +476,30 @@ sub find_cruft {
                 $block =~ s{ \\ \* \( [LR] \" }{\"}gxsm;
             }
 
+            if (   index($block, 'intellectual') > -1
+                && index($block, 'property') > -1
+                && index($block, 'all') > -1) {
+
+                # nvdia opencv infamous license
+                # non distribuable
+                if (!exists $licenseproblemhash{'nvidia-intellectual'}) {
+                    my $cleanedblock = _clean_block($block);
+                    if (
+                        $cleanedblock =~ m/retain \s+ all \s+ intellectual \s+
+                          property \s+ and \s+ proprietary \s+ rights \s+ in \s+
+                          and \s+ to \s+ this \s+ software \s+ and \s+
+                          related \s+ documentation/xism
+                      ) {
+                        tag 'license-problem-nvidia-intellectual', $name;
+                        $licenseproblemhash{'nvidia-intellectual'} = 1;
+                    }
+                }
+            }
+
+            # some license issues do not apply to non-free
+            # because these file are distribuable
+            if($info->is_non_free) { continue ; }
+
             if (
                 index($block, 'evil') > -1
                 && $block =~ m/software \s++ shall \s++
diff --git a/t/tests/cruft-nvidia-intellectual/debian/src/badcv.c b/t/tests/cruft-nvidia-intellectual/debian/src/badcv.c
new file mode 100644
index 0000000..2014f17
--- /dev/null
+++ b/t/tests/cruft-nvidia-intellectual/debian/src/badcv.c
@@ -0,0 +1,12 @@
+/*
+ * Acme Corporation and its licensors retain all intellectual property and
+ * proprietary rights in and to this software and related documentation.
+ * Any use, reproduction, disclosure, or distribution of this software
+ * and related documentation without an express license agreement from
+ * Acme Corporation is strictly prohibited.
+ *
+ * Please refer to the applicable Acme end user license agreement (EULA)
+ * associated with this source code for terms and conditions that govern
+ * your use of this Acme software.
+ *
+ */
diff --git a/t/tests/cruft-nvidia-intellectual/debian/src/badcv2.c b/t/tests/cruft-nvidia-intellectual/debian/src/badcv2.c
new file mode 100644
index 0000000..cbabced
--- /dev/null
+++ b/t/tests/cruft-nvidia-intellectual/debian/src/badcv2.c
@@ -0,0 +1,10 @@
+/*
+ * Copyright 1993-2010 NVIDIA Corporation.  All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual
+ * property and proprietary rights in and to this software and
+ * related documentation and any modifications thereto.
+ * Any use, reproduction, disclosure, or distribution of this
+ * software and related documentation without an express license
+ * agreement from NVIDIA Corporation is strictly prohibited.
+ */
diff --git a/t/tests/cruft-nvidia-intellectual/debian/src/falsepositive/allmankind.c b/t/tests/cruft-nvidia-intellectual/debian/src/falsepositive/allmankind.c
new file mode 100644
index 0000000..a2873ef
--- /dev/null
+++ b/t/tests/cruft-nvidia-intellectual/debian/src/falsepositive/allmankind.c
@@ -0,0 +1,12 @@
+/*
+ *  The technologies, software, hardware, designs, drawings, scheumatics, board
+ *  layouts and/or artwork, concepts, methodologies (including the use of all
+ *  of these, and that which is derived from the use of all of these), all other
+ *  intellectual properties contained herein, and all intellectual property
+ *  rights have been and shall continue to be expressly for the benefit of all
+ *  mankind, and are perpetually placed in the public domain, and may be used,
+ *  copied, and/or modified by anyone, in any manner, for any legal purpose,
+ *  without restriction.
+ *
+ *   This module written by Stephen Underwood.
+ */
diff --git a/t/tests/cruft-nvidia-intellectual/desc b/t/tests/cruft-nvidia-intellectual/desc
new file mode 100644
index 0000000..18a4bc1
--- /dev/null
+++ b/t/tests/cruft-nvidia-intellectual/desc
@@ -0,0 +1,5 @@
+Testname: cruft-nvidia-intellectual
+Sequence: 6000
+Version: 1.0
+Description: Check for the Nvidia intellectual license
+Test-For: license-problem-nvidia-intellectual
diff --git a/t/tests/cruft-nvidia-intellectual/tags b/t/tests/cruft-nvidia-intellectual/tags
new file mode 100644
index 0000000..d982995
--- /dev/null
+++ b/t/tests/cruft-nvidia-intellectual/tags
@@ -0,0 +1,2 @@
+E: cruft-nvidia-intellectual source: license-problem-nvidia-intellectual src/badcv.c
+E: cruft-nvidia-intellectual source: license-problem-nvidia-intellectual src/badcv2.c
-- 
1.8.4.rc3


Reply to: