... |
... |
@@ -47,6 +47,7 @@ const my $NOT_EQUAL => q{!=}; |
47
|
47
|
const my $BAD_MAINTAINER_COMMAND_FIELDS => 5;
|
48
|
48
|
const my $UNVERSIONED_INTERPRETER_FIELDS => 2;
|
49
|
49
|
const my $VERSIONED_INTERPRETER_FIELDS => 5;
|
|
50
|
+const my $USR_PREFIX_LENGTH => 4;
|
50
|
51
|
|
51
|
52
|
use Moo;
|
52
|
53
|
use namespace::clean;
|
... |
... |
@@ -692,10 +693,17 @@ sub visit_control_files { |
692
|
693
|
'incorrect-path-for-interpreter'
|
693
|
694
|
: 'wrong-path-for-interpreter';
|
694
|
695
|
|
|
696
|
+# Debian is now mandatory usr-merged, so /bin/sh and /usr/bin/sh are both acceptable
|
|
697
|
+ if ($expected =~ '^(/bin/|/sbin/)') {
|
|
698
|
+ $expected = '(?:/usr)?' . $expected;
|
|
699
|
+ } elsif ($expected =~ '^/usr(/bin/|/sbin/)') {
|
|
700
|
+ $expected = '(?:/usr)?' . substr($expected, $USR_PREFIX_LENGTH);
|
|
701
|
+ }
|
|
702
|
+
|
695
|
703
|
$self->pointed_hint(
|
696
|
704
|
$tag_name, $item->pointer, $interpreter,
|
697
|
705
|
$NOT_EQUAL, $expected
|
698
|
|
- )unless $interpreter eq $expected;
|
|
706
|
+ )unless $interpreter =~ $expected;
|
699
|
707
|
|
700
|
708
|
} elsif ($item->name eq 'config') {
|
701
|
709
|
$self->pointed_hint('forbidden-config-interpreter',
|
... |
... |
@@ -716,10 +724,17 @@ sub visit_control_files { |
716
|
724
|
'incorrect-path-for-interpreter'
|
717
|
725
|
: 'wrong-path-for-interpreter';
|
718
|
726
|
|
|
727
|
+# Debian is now mandatory usr-merged, so /bin/sh and /usr/bin/sh are both acceptable
|
|
728
|
+ if ($expected =~ '^(/bin/|/sbin/)') {
|
|
729
|
+ $expected = '(?:/usr)?' . $expected;
|
|
730
|
+ } elsif ($expected =~ '^/usr(/bin/|/sbin/)') {
|
|
731
|
+ $expected = '(?:/usr)?' . substr($expected, $USR_PREFIX_LENGTH);
|
|
732
|
+ }
|
|
733
|
+
|
719
|
734
|
$self->pointed_hint(
|
720
|
735
|
$tag_name, $item->pointer, $interpreter,
|
721
|
736
|
$NOT_EQUAL, $expected
|
722
|
|
- )unless $interpreter eq $expected;
|
|
737
|
+ )unless $interpreter =~ $expected;
|
723
|
738
|
|
724
|
739
|
$self->pointed_hint('unusual-control-interpreter', $item->pointer,
|
725
|
740
|
$interpreter);
|