[vchkpw] Bug in vconvert?

2003-06-08 Thread Jonas Thomsen
Hi all!

I've just migrated from vpopmail 5.2.1 using CDB to vpopmail 5.3.20
using MySql. During this migration I discovered a small bug in vconvert.
When running 'vconvert -c -m', vconvert reads the
/var/qmail/users/assign file, which on my system ends with a line
containing a ".\n" When vconvert reaches this line, the check for
tmpbuf[1] != '\n' in line 120 fails, but this does not stop the next
line (conv_domain( &tmpbuf[1] )) from being executed. Of course this
does not work - it tries to convert a domain called "\n". My fix is the
following code:

if ( tmpbuf[1] != '\n' ) {
  printf("converting %s ...", &tmpbuf[1] );
if ( conv_domain( &tmpbuf[1] ) != 0 ) {
printf("domain conversion failed\n");
} else {
printf("done\n");
}
}

Is there a problem with this fix?



Kind regards

Jonas Thomsen,
JT-COM
Eugen Warmings Vej 37, 1. th. - DK-8000 Aarhus C.
Tlf. +45 87 30 16 10 - Fax: +45 87 30 16 11
http://www.jt-com.dk 





Re: [vchkpw] Bug in vconvert?

2003-06-08 Thread Remo Mattei
Looks fine to me :0


-- Remo Mattei   --cell 801-209-8554
   http://www.italy1.com
   Freelance Networking-Security/Consultant
   MCSE, MCP, MCP+I, MCT
   Linux Trainer & Firewall Development
   [EMAIL PROTECTED]


> From: "Jonas Thomsen" <[EMAIL PROTECTED]>
> Organization: JT-COM
> Date: Sun, 8 Jun 2003 18:16:17 +0200
> To: <[EMAIL PROTECTED]>
> Subject: [vchkpw] Bug in vconvert?
> 
> Hi all!
> 
> I've just migrated from vpopmail 5.2.1 using CDB to vpopmail 5.3.20
> using MySql. During this migration I discovered a small bug in vconvert.
> When running 'vconvert -c -m', vconvert reads the
> /var/qmail/users/assign file, which on my system ends with a line
> containing a ".\n" When vconvert reaches this line, the check for
> tmpbuf[1] != '\n' in line 120 fails, but this does not stop the next
> line (conv_domain( &tmpbuf[1] )) from being executed. Of course this
> does not work - it tries to convert a domain called "\n". My fix is the
> following code:
> 
> if ( tmpbuf[1] != '\n' ) {
>  printf("converting %s ...", &tmpbuf[1] );
>   if ( conv_domain( &tmpbuf[1] ) != 0 ) {
>   printf("domain conversion failed\n");
>   } else {
>   printf("done\n");
>   }
> }
> 
> Is there a problem with this fix?
> 
> 
> 
> Kind regards
> 
> Jonas Thomsen,
> JT-COM
> Eugen Warmings Vej 37, 1. th. - DK-8000 Aarhus C.
> Tlf. +45 87 30 16 10 - Fax: +45 87 30 16 11
> http://www.jt-com.dk
> 
> 
> 
>