/usr/bin/prelude-lml-rules-check is in prelude-lml-rules 4.1.0-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | #!/usr/bin/env perl
#####
#
# Copyright (C) 2013-2017 CS-SI. All Rights Reserved.
#
# This file is part of the Prelude-LML program.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#####
if ($#ARGV < 0) {
print "Displays rules id and check for duplicates\n";
print "Usage : $0 <rules files>\n";
print "Example : $0 /etc/prelude-lml/ruleset/*.rules\n";
}
%ID = ();
$rules = 0;
$files = 0;
foreach $f (@ARGV) {
@ids = ();
open(IN, $f) || die ("Cannot open $f\n");
while(<IN>) {
if (/^\s*id\s*=\s*(\d+)/) {
if (defined $ID{$1}) {
print STDERR "WARNING $f line $. : Id $1 allready defined in " . $ID{$1}[0] . ' line ' . $ID{$1}[1] . "\n";
} else {
$ID{$1} = [$f, $.];
push(@ids, $1);
}
$rules++;
}
}
close(IN);
$files++;
print "$f: " . join(', ', sort { $a <=> $b } @ids) . "\n";
}
print "$rules rules in $files files\n";
|