/usr/share/perl5/INN/Config.pm is in inn2 2.6.1-2.
This file is owned by root:root, with mode 0o644.
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 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | ## $Id: Config.pm.in 9567 2013-11-17 20:24:35Z iulius $
##
## Perl module which sets up any and all variables that an
## INN Perl script might need.
##
package INN::Config;
use warnings;
use Exporter;
our @ISA = qw(Exporter);
our $VERSION = '2.6.1';
## First, two necessary variables (listed below in @DIRVAR).
our $prefix = '/usr/lib/news';
our $exec_prefix = "${prefix}";
## Then, process the variables provided by innconfval.
my @INNCONFVAR = ();
my @values = `${exec_prefix}/bin/innconfval -p`;
foreach my $line (@values) {
eval 'our '.$line;
if ($line =~ /^(.*?) = /m) {
push(@INNCONFVAR, $1);
}
}
## Paths of useful directories.
my @DIRVAR = qw($prefix $exec_prefix $newshome $home $newslib
$newsbin $controlprogs $newslbin $newsetc $spooldir
$archivedir $spool $incoming $spoolnews $badnews
$batch $overviewdir $most_logs $locks $innddir $tmpdir
$spooltemp $path);
our $newshome = $pathnews;
our $home = $pathnews;
our $newslib = "/usr/lib/news";
our $newsbin = $pathbin;
our $controlprogs = $pathcontrol;
our $newslbin = "$pathnews/local";
our $newsetc = $pathetc;
our $spooldir = $pathspool;
our $archivedir = $patharchive;
our $spool = $patharticles;
our $incoming = $pathincoming;
our $spoolnews = $pathincoming;
our $badnews = "$pathincoming/bad";
our $batch = $pathoutgoing;
our $overviewdir = $pathoverview;
our $most_logs = $pathlog;
our $locks = $pathrun;
our $innddir = $pathrun;
our $tmpdir = $pathtmp;
our $spooltemp = $pathtmp;
our $path = $ENV{'PATH'} || '';
$path = "${newslbin}:${newsbin}:${path}:/bin:/usr/bin";
## Paths of useful files.
my @FILESVAR = qw($active $activetimes $newactive $oldactive
$history $newsgroups $ctlfile $ctlwatch $localgroups
$newsfeeds $path_motd_innd $path_motd_nnrpd $path_motd
$expirectl $errlog $log);
our $active = "${pathdb}/active";
our $activetimes = "${pathdb}/active.times";
our $newactive = "${pathdb}/active.tmp";
our $oldactive = "${pathdb}/active.old";
our $history = "${pathdb}/history";
our $newsgroups = "${pathdb}/newsgroups";
our $ctlfile = "${newsetc}/control.ctl";
our $ctlwatch = "${newsetc}/innwatch.ctl";
our $localgroups = "${newsetc}/localgroups";
our $newsfeeds = "${newsetc}/newsfeeds";
our $path_motd_innd = "${newsetc}/motd.innd";
our $path_motd_nnrpd = "${newsetc}/motd.nnrpd";
our $path_motd = "${path_motd_nnrpd}";
our $expirectl = "${newsetc}/expire.ctl";
our $errlog = "${most_logs}/errlog";
our $log = "${most_logs}/news";
## Paths of useful programs.
my @PROGVAR = qw($inews $innconfval $innd $inndf $innwatch
$rnews $perl_startup_innd $perl_filter_innd $perl_filter_nnrpd
$python_filter_innd $path_python_inn_module $path_tcl_startup
$path_tcl_filter);
our $inews = "${newsbin}/inews";
our $innconfval = "${newsbin}/innconfval";
our $innd = "${newsbin}/innd";
our $inndf = "${newsbin}/inndf";
our $innwatch = "${newsbin}/innwatch";
our $rnews = "${newsbin}/rnews";
our $perl_startup_innd = "$pathfilter/startup_innd.pl";
our $perl_filter_innd = "$pathfilter/filter_innd.pl";
our $perl_filter_nnrpd = "$pathfilter/filter_nnrpd.pl";
our $python_filter_innd = "$pathfilter/filter_innd.py";
our $path_python_inn_module = "$pathfilter/INN.py";
our $path_tcl_startup = "$pathfilter/startup.tcl";
our $path_tcl_filter = "$pathfilter/filter.tcl";
## Paths of lock/PID/status files.
my @LOCKVAR = qw($daily $newscontrol $nntpconnect $serverpid
$innwstatus $watchpid $tempsock $tempsockdir);
our $daily = "${locks}/LOCK.news.daily";
our $newscontrol = "${innddir}/control";
our $nntpconnect = "${innddir}/nntpin";
our $serverpid = "${innddir}/innd.pid";
our $innwstatus = "${innddir}/innwatch.status";
our $watchpid = "${innddir}/innwatch.pid";
(our $tempsock = "${innddir}/ctlinndXXXXXX") =~ s!.*/(.*)XXXXXX$!$1*!;
(our $tempsockdir = "${innddir}/ctlinndXXXXXX") =~ s!/[^/]*$!!;
## Paths of external used programs.
my @EXTPROGVAR = qw($awk $egrep $gpgv $perl $pgp $sed
$sort $getftp $uustat $uux);
our $awk = 'awk';
our $egrep = 'egrep';
our $gpgv = '/usr/bin/gpgv';
our $perl = '/usr/bin/perl';
our $pgp = '';
our $sed = 'sed';
our $sort = 'sort';
our $getftp = "wget";
our $uustat = '';
our $uux = 'uux';
## Paths of external used compressors.
my @EXTCOMPVAR = qw($bzip2 $compress $gzip $uncompress
$log_compress $z);
our $bzip2 = '/bin/bzip2';
our $compress = 'compress';
our $gzip = '/bin/gzip';
our $uncompress = '/bin/gzip -d';
our $log_compress = '/bin/gzip';
our $z = '.gz';
## Set up some useful system file information.
my @SYSVAR = qw($newsmaster $newsuser $newsgroup
$filemode $inewsmode $rnewsmode $umask $syslog_facility);
our $newsmaster = 'usenet';
our $newsuser = ${runasuser};
our $newsgroup = ${runasgroup};
our $filemode = 0664; # It is a number.
our $inewsmode = 0550;
our $rnewsmode = 07550;
our $umask = 02;
our $syslog_facility = lc('LOG_NEWS');
$syslog_facility =~ s/log_//;
## Set up some useful parameters.
my @PARAMVAR = qw($do_dbz_tagged_hash);
our $do_dbz_tagged_hash = 'DONT';
## Set up some environment values.
if ($ovmethod && $ovmethod eq "ovdb") {
$ENV{'DB_HOME'} = $pathoverview;
}
$ENV{'INNDDIR'} = $innddir;
$ENV{'LOCKS'} = $locks;
$ENV{'MOST_LOGS'} = $most_logs;
$ENV{'NEWSBIN'} = $newsbin;
$ENV{'NEWSETC'} = $newsetc;
$ENV{'NEWSHOME'} = $pathnews;
$ENV{'NEWSLBIN'} = ${newslbin};
$ENV{'NEWSLIB'} = $newslib;
$ENV{'PATH'} = $path;
$ENV{'SPOOLDIR'} = $spooldir;
$ENV{'TMPDIR'} = $pathtmp;
## Set up the locale.
$ENV{'LC_CTYPE'} = "C";
## Set up umask.
umask 02;
## This array will contain what it is possible to export.
our @EXPORT_OK = (@INNCONFVAR, @DIRVAR, @FILESVAR, @PROGVAR,
@LOCKVAR, @EXTPROGVAR, @EXTCOMPVAR, @SYSVAR, @PARAMVAR,
qw($VERSION));
## Load another script that can override or add variables.
if (-x "${pathetc}/innshellvars.pl.local") {
do "${pathetc}/innshellvars.pl.local";
}
## That's all.
1;
__END__
=head1 NAME
INN::Config - Export all the variables an INN Perl script might need
=head1 DESCRIPTION
This Perl module sets up any and all the variables that an INN Perl script
might need. More particularly, it allows to use F<inn.conf> variables:
they are all provided by B<innconfval>, as well as the version of INN
(in the variable C<$INN::Config::VERSION> for its short number form, on in
C<$INN::Config::version> for its complete form). Other useful variables
are also provided (directories, files, programs, masks, parameters).
The complete list can be obtained with the following script that prints
them out:
use lib '<pathnews>/lib/perl';
use INN::Config;
use Data::Dumper;
my ($varname, $value);
foreach my $var (@INN::Config::EXPORT_OK) {
if ($var =~ /^\$(.*)$/) {
$varname = "INN::Config::$1";
$value = Dumper($$varname);
$value =~ s/^\$VAR1 = //;
print "\$$varname = $value";
} elsif ($var =~ /^\@(.*)$/) {
$varname = "INN::Config::$1";
$value = Dumper(\@$varname);
$value =~ s/^\$VAR1 = //;
print "\@$varname = $value";
}
}
A local Perl script named F<innshellvars.pl.local> in I<pathetc> will be
loaded, if present and executable, at the end of the run of this module.
A typical use is to add or override variables.
You only have to declare the module at the beginning of them:
use lib '<pathnews>/lib/perl';
use INN::Config;
Then, you can for instance use:
print $INN::Config::localmaxartsize;
to print the value of I<localmaxartsize> as it is set in F<inn.conf>.
You can also specify a version when you import the module. If
you write:
use INN::Config 2.5.0;
only versions of INN superior to 2.5.0 will be able to run the Perl
script.
It is also possible to import the variables directly in your namespace
if you specify what you want to import:
use INN::Config qw($localmaxartsize $pathbin);
Note that a legacy F<innshellvars.pl> is also provided in I<pathnews>/lib
for compatibility reasons with old Perl scripts not shipped with INN.
It was used by versions of INN anterior to 2.5.0. The corresponding
scripts for Shell and Tcl are, however, still in use: F<innshellvars>
and F<innshellvars.tcl>. They offer the same capabilities as this
module.
=head1 HISTORY
F<innshellvars.pl> was written by James Brister <brister@vix.com>
for InterNetNews in 1996. It was converted to the INN::Config Perl
module by Julien Elie in 2007.
$Id: Config.pm.in 9567 2013-11-17 20:24:35Z iulius $
=head1 SEE ALSO
inn.conf(5), innconfval(1), perl(1).
=cut
|