[Dovecot] Bug in keywords conversion with courier-dovecot-migrate.pl v1.1.7

John Lightsey jd at cpanel.net
Fri Sep 19 19:03:54 EEST 2008


On Sep 19, 2008, at 10:26 AM, Timo Sirainen wrote:

> On Sep 19, 2008, at 6:05 PM, John Lightsey wrote:
>
>> The problem is the file glob on line 344 in convert_subscriptions()
>>
>> # read updates from the directory
>> my %updates;
>> foreach (<$keyword_dir/*>) {
>>
>> This isn't going to pick up any files beginning with a dot, so most  
>> of the update files in the courierimapkeywords directory are going  
>> to be skipped.
>
> Any suggestions how to best fix it? My Perl knowledge isn't too good.
>

opendir/readdir/closedir...  Personally I avoid file globs in Perl  
whenever possible because of the tricks and limitations involved with  
them.  For instance, if the glob expands to more than GLOB_LIMIT files  
what is going to happen?  opendir/readdir/closedir has very  
predictable behavior.

Actually since we're talking about that, scan_maildir() is very likely  
to hit the glob limit.  It should also be switched to readdir.  The  
maildir files update loop in convert_subscriptions() as well.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: courier-dovecot-migrate.diff
Type: application/octet-stream
Size: 545 bytes
Desc: not available
Url : http://dovecot.org/pipermail/dovecot/attachments/20080919/d3a56691/attachment.obj 
-------------- next part --------------



More information about the dovecot mailing list