A few configuration bugs in razor-2.72

Kerin Millar <[email protected]>
Newsgroups gmane.mail.spam.razor.user
Message-ID <1119581982.10896.7.camel@localhost>
Hi folks, I've been a quietly satisfied customer for some time now
(excellent program)! However, I've joined this list in order to point
out a few gremlins that seem to have popped up with the latest release.
I use razor in the context of spamasassin, which is invoked and managed
by amavisd-new. Thus, I have an amavis user account and the "razorhome"
location is relative to the amavis home directory: "/var/amavis/.razor".
I just upgraded from razor-2.61 to razor-2.72 and discovered two issues,
one of which appears to be a regression over the prior version.

Firstly, I decided to move my old razorhome elsewhere and re-generate
it. My procedures were conducted as the root user and the following
conditions were all true prior to proceeding:

  * /var/amavis/.razor was no longer present

  * There was no razor configuration for the root user at "/root/.razor"

  * There was no default razor configuration at /etc/razor in any shape
    or form

Now, I requested to generate a new configuration as follows:

  razor-admin -d -create -home=/var/amavis/.razor

The problem is that it did not generate a configuration file under
"/var/amavis/.razor". The directory contained only the following files:

  server.folly.cloudmark.com.conf
  servers.catalogue.lst
  servers.discovery.lst
  servers.nomination.lst

Here are the most interesting lines from the debug output:

  Jun 24 02:51:13.005807 admin[18213]: [ 6] Created razorhome: /var/amavis/.razor
  Jun 24 02:51:13.005985 admin[18213]: [ 8] Computed user confpath from env: /root/.razor
  Jun 24 02:51:13.006082 admin[18213]: [ 5] No /root/.razor/razor-agent.conf found, skipping.
  Jun 24 02:51:13.006565 admin[18213]: [ 5] computed razorhome=/var/amavis/.razor, conf=/root/.razor/razor-agent.conf, ident=identity
  Jun 24 02:51:13.006683 admin[18213]: [ 2]  Razor-Agents v2.72 starting razor-admin -d -create -home=/var/amavis/.razor

However, if I perform precisely the same procedure (under the same
conditions) with razor-2.61 then the following files are generated under
"/var/amavis/.razor" ...

  razor-agent.conf
  server.joy.cloudmark.com.conf
  servers.catalogue.lst
  servers.discovery.lst
  servers.nomination.lst

... and the relevant section of the debug output reads as follows:

  Jun 24 03:06:39.534239 admin[19452]: [ 6] Created razorhome: /var/amavis/.razor
  Jun 24 03:06:39.534417 admin[19452]: [ 5] No /var/amavis/.razor/razor-agent.conf found, skipping.
  Jun 24 03:06:39.534998 admin[19452]: [ 5] wrote 16 HASH items to file: /var/amavis/.razor/razor-agent.conf
  Jun 24 03:06:39.535270 admin[19452]: [ 5] computed razorhome=/var/amavis/.razor, conf=/var/amavis/.razor/razor-agent.conf, ident=identity
  Jun 24 03:06:39.535385 admin[19452]: [ 2]  Razor-Agents v2.61 starting razor-admin -d -create -home=/var/amavis/.razor

The manpage states quite clearly that, if the location for the
configuration file is not specified, that "it is computed" and "The
default is <razorhome>/razor-agent.conf". Well, it's rather late here at
present so I'm not in the mood for any serious debugging ;) However, I
did notice that at line #202 in Agent.pm, that $self->{razorconf} is
always undefined under the circumstances I've described and will thus be
set to the contents of $self->{computed_razorconf}. But the comment for
the "compute_razorconf" sub in Config.pm states "We cannot use razorhome
here because it may be overridden by a value in razorconf." In any case,
it computes the config file location to be under the user's homedir
(which it never creates anyway, btw).

The second issue occurs when the -home and -conf arguments are used
together. For example, if I execute the following command (under exactly
the same circumstances as before):

  razor-admin -d -create -home=/var/amavis/.razor -conf=/root/razor-agent.conf

Now, this is what does and doesn't happen:

  * It does compute and write a new configuration file at
    /root/razor-agent.conf (expected)

  * It does create a new directory: /var/amavis/.razor (expected)

  * Server discovery completely fails and the /var/amavis/.razor
    directory remains completely empty (not expected ;)

Various hairy error messages are thrown up indicating the use of
uninitialised values, here's the full output:

  Razor-Log: Can't read file /root/razor-agent.conf: No such file or directory
  Razor-Log:  -create will force complete discovery
  Use of uninitialized value in numeric lt (<) at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Agent.pm line 110.
  Razor-Log: Created razorhome: /var/amavis/.razor
  Razor-Log: wrote 15 HASH items to file: /root/razor-agent.conf
  Razor-Log: computed razorhome=/var/amavis/.razor, conf=/root/razor-agent.conf, ident=/var/amavis/.razor/identity
  Razor-Log:  Razor-Agents v2.72 starting razor-admin -d -create -home=/var/amavis/.razor -conf=/root/razor-agent.conf
  Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Config.pm line 406.
  Use of uninitialized value in -e at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Config.pm line 406.
  Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Config.pm line 407.
  Razor-Log: Can't read file , looking relatve to /var/amavis/.razor
  Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Config.pm line 408.
  Razor-Log: read_file: 0 items read from /var/amavis/.razor/
  Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Agent.pm line 936.
  Razor-Log: Read 0 from server listfile:
  Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Config.pm line 406.
  Use of uninitialized value in -e at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Config.pm line 406.
  Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Config.pm line 407.
  Razor-Log: Can't read file , looking relatve to /var/amavis/.razor
  Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Config.pm line 408.
  Razor-Log: read_file: 0 items read from /var/amavis/.razor/
  Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Agent.pm line 936.
  Razor-Log: Read 0 from server listfile:
  Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Config.pm line 406.
  Use of uninitialized value in -e at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Config.pm line 406.
  Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Config.pm line 407.
  Razor-Log: " to /var/amavis/.razor
  Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Config.pm line 408.
  Razor-Log: read_file: 0 items read from /var/amavis/.razor/
  Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Agent.pm line 936.
  Razor-Log: Read 0 from server listfile:
  Razor-Log: entered nextserver
  Razor-Log: entered discover
  Use of uninitialized value in -s at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Core.pm line 240.
  Use of uninitialized value in -e at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Core.pm line 251.
  Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Core.pm line 254.
  Razor-Log: no listfile:
  Razor-Log: entered bootstrap_discovery
  Use of uninitialized value in -s at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Core.pm line 186.
  Use of uninitialized value in -e at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Core.pm line 198.
  Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Core.pm line 201.
  Razor-Log: no discovery listfile:
  Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Core.pm line 275.
  Razor-Log: Checking with Razor Discovery Server
  Razor-Log: entered connect
  Razor-Log: no server specified, not connecting
  Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Razor2/Client/Core.pm line 278.
  Razor-Log: Razor Discovery Server  is unreachable
  Razor-Log: razor-admin error: nextserver: Bootstrap discovery failed. Giving up.
  nextserver: Bootstrap discovery failed. Giving up.

Finally, I noted that there is a spelling mistake: "Can't read file ,
looking relatve" should be "Can't read file, looking relative".

Regards,

--Kerin Millar (kerframil)



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.