Skip Menu |

This queue is for tickets about the Mail-ExpandAliases CPAN distribution.

Report information
The Basics
Id: 1853
Status: resolved
Worked: 1.5 hours (90 min)
Priority: 0/
Queue: Mail-ExpandAliases

People
Owner: darren [...] cpan.org
Requestors: dale [...] daledude.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: infinite loop when alias is alias for itself
If an alias points to itself expand() loops forever. On my linux 2.4.18 redhat AMD 1ghz box it eats most of the CPU. I use perl 5.6.1. /etc/aliases: admin: admin test.pl: $ma->expand("admin"); # never returns
[guest - Thu Dec 5 09:08:08 2002]: Show quoted text
> If an alias points to itself expand() loops forever. On my linux > 2.4.18 redhat AMD 1ghz box it eats most of the CPU. I use perl 5.6.1.
I'm looking at this currently; fixing it requires a bunch of changes (basically a complete rewrite) to the expand method. The next release will not only fix this but also function more like sendmail, as described in Chapter 24 of the bat book. I have included recursive expansions in the test suite, to avoid catch this. Show quoted text
> test.pl: > $ma->expand("admin"); # never returns
"Doctor, it hurts when I do this." "Then don't do that." :) As an aside, if you have this in a real aliases file (as opposed to seeing if you can break my module ;), and mean for the admin alias to really point to a local admin account, you can prevent loops using: admin: \admin You might want to do this in a case like: admin: admin@box1, admin@box2, \admin (darren)
I've uploaded version 0.44, which I believe fixes this problem. I will wait a while before closing this ticket, in case the original requestor is not satisfied with the solution.