Bug#784277: lintian: patch merging partially redundant code in checks/files.pm
Package: lintian
Version: 2.5.30+deb8u4
Severity: wishlist
Tags: patch
Dear Maintainer,
bug #226879 has been closed after addition of two tests
- avoiding a false positive (c86fbdcf227b5a6f68d1a1516c957aa0680f7067)
- reporting a new bad-permissions-for-ali-file tag
(b6d5591e5b400d1b566da227fc1069d227060142).
The attached patch merges the two redundant tests for better efficiency.
>From 42d4fce082501d19deeedc9a73fd4cbb2bbdb274 Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <nicolas.boulenguez@free.fr>
Date: Mon, 4 May 2015 21:05:26 +0200
Subject: [PATCH] Merge commits solving #226879 (bad-permissions-for-ali-file):
c86fbdcf227b5a6f68d1a1516c957aa0680f7067 and
b6d5591e5b400d1b566da227fc1069d227060142.
---
checks/files.pm | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/checks/files.pm b/checks/files.pm
index 26d93fc..891ed70 100644
--- a/checks/files.pm
+++ b/checks/files.pm
@@ -946,11 +946,6 @@ sub run {
tag 'use-of-compat-symlink', $file;
}
- # ---------------- .ali files (Ada Library Information)
- if ($fname =~ m,^usr/lib/.*\.ali$, && $operm != 0444) {
- tag 'bad-permissions-for-ali-file', $file;
- }
-
# ---------------- any files
if (not $file->is_dir) {
unless (
@@ -1529,10 +1524,10 @@ sub run {
and $owner eq 'root/games'
and $fname =~ m,^var/(lib/)?games/\S+,) {
# everything is ok
- } elsif ($operm == 0444 and $fname =~ m,^usr/lib/.*\.ali$,) {
- # Ada library information files should be read-only
- # since GNAT behaviour depends on that
- # everything is ok
+ } elsif ($fname =~ m,^usr/lib/.*\.ali$,) {
+ # GNAT compiler wants read-only Ada library information.
+ tag 'bad-permissions-for-ali-file', $file
+ if ($operm != 0444);
} elsif ($operm == 0600 and $fname =~ m,^etc/backup.d/,) {
# backupninja expects configurations files to be 0600
} elsif ($fname =~ m,^etc/sudoers.d/,) {
--
2.1.4
Reply to: