[lintian] 01/01: Verify files triggering package-installs-java-bytecode files really are Java class files. (Closes: #879861)
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository lintian.
commit e967373e05311a0d804a3f7586e02a6714d2c810
Author: Chris Lamb <lamby@debian.org>
Date: Thu Oct 26 17:04:52 2017 +0100
Verify files triggering package-installs-java-bytecode files really are Java class files. (Closes: #879861)
---
checks/files.pm | 6 +++++-
debian/changelog | 2 ++
t/tests/files-java-classfiles/debian/debian/libfoo-java.install | 1 +
t/tests/files-java-classfiles/debian/not-a-class-file.class | 1 +
4 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/checks/files.pm b/checks/files.pm
index 9ee7f4c..9f8c18d 100644
--- a/checks/files.pm
+++ b/checks/files.pm
@@ -1165,7 +1165,11 @@ sub run {
# ---------------- .class (compiled Java files)
if ( $fname =~ m,\.class$,o
&& $fname !~ m,(?:WEB-INF|demo|doc|example|sample|test),o) {
- tag 'package-installs-java-bytecode', $file;
+ my $fd = $file->open;
+ read($fd, my $magic, 4);
+ close($fd);
+ tag 'package-installs-java-bytecode', $file
+ if $magic eq "\xCA\xFE\xBA\xBE";
}
# ---------------- /usr/lib/site-python
diff --git a/debian/changelog b/debian/changelog
index 3c902b2..d8f445d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -42,6 +42,8 @@ lintian (2.5.56) UNRELEASED; urgency=medium
"error" to "warning". (Closes: #879862)
+ [CL] Do not trigger package-installs-java-bytecode if the path
contains "WEB-INF", "demo", "doc" etc. (Closes: #879860)
+ + [CL] Verify files triggering package-installs-java-bytecode files
+ really are Java class files. (Closes: #879861)
* checks/init.d.pm:
+ [CL] Check for files that use content from the /etc/init.d/skeleton
template. Thanks to Christoph Biedl for the idea. (Closes: #879152)
diff --git a/t/tests/files-java-classfiles/debian/debian/libfoo-java.install b/t/tests/files-java-classfiles/debian/debian/libfoo-java.install
index cc0c1b3..c5226d3 100644
--- a/t/tests/files-java-classfiles/debian/debian/libfoo-java.install
+++ b/t/tests/files-java-classfiles/debian/debian/libfoo-java.install
@@ -1,2 +1,3 @@
mini.class usr/share/java/foo/
mini.class usr/share/java/WEB-INF
+not-a-class-file.class usr/share/java/foo
diff --git a/t/tests/files-java-classfiles/debian/not-a-class-file.class b/t/tests/files-java-classfiles/debian/not-a-class-file.class
new file mode 100644
index 0000000..cc63a04
--- /dev/null
+++ b/t/tests/files-java-classfiles/debian/not-a-class-file.class
@@ -0,0 +1 @@
+This is not a Java .class file.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: