/usr/lib/debbugs/processall is in debbugs 2.4.1.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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | #!/usr/bin/perl
# $Id: processall.in,v 1.9 2002/11/17 22:45:16 cjwatson Exp $
#
# Usage: processall
#
# Uses up: incoming/I<code><bugnum>.nn
# Temps: incoming/[GP].nn
# Creates: incoming/E.nn
# Stop; process/stop
$config_path = '/etc/debbugs';
$lib_path = '/usr/lib/debbugs';
require "$config_path/config";
require "$lib_path/errorlib";
$ENV{'PATH'} = $lib_path.':'.$ENV{'PATH'};
use File::Path;
chdir( "$gSpoolDir" ) || die 'chdir spool: $!\n';
push( @INC, "$lib_path" );
#open(DEBUG,">&4");
umask(002);
$|=1;
undef %fudged;
&filelock('incoming-cleaner');
for (;;) {
if (-f 'stop') {
print(STDERR "stop file created\n") || die $!;
last;
}
if (!@ids) {
opendir(DIR,"incoming") || die $!;
while ( defined( $_= readdir(DIR) )) { push(@ids,$_) if s/^I//; }
last unless @ids;
@ids= sort(@ids);
}
stat("$gMaintainerFile") || die "stat $gMaintainerFile: $!\n";
$nf= @ids;
$id= shift(@ids);
unless (rename("incoming/I$id","incoming/G$id")) {
if ($fudged{$id}) {
die "$id already fudged once! $!\n";
}
$fudged{$id}= 1;
next;
}
if ($id =~ m/^[RC]/) {
print(STDOUT "[$nf] $id service ...") || die $!;
defined($c=fork) || die $!;
if (!$c) { exec("$lib_path/service",$id); die $!; }
} elsif ($id =~ m/^[BMQFDU]/) {
print(STDOUT "[$nf] $id process ...") || die $!;
defined($c=fork) || die $!;
if (!$c) { exec("$lib_path/process",$id); die $!; }
} else {
die "bad name $id";
}
$cc=waitpid($c,0); $cc == $c || die "$cc $c $!";
$status=$?;
if ($status) {
print(STDERR "$id: process failed ($status $!) - now in [PG]$id\n") || die $!;
}
print(STDOUT " done\n") || die $!;
rmtree("$gSpoolDir/mime.tmp",0,1);
$ndone++;
}
&unfilelock;
exit(0);
|