[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ZMailer] cfgread.c - Debian 6/Squeeze



Greetings:

After installing the newly released Debian 6 upgrade, and rebuilding
Zmailer from source, I found smtpserver failing with a message about
being unable to read the policy database:

"smtpserver policy database problem, code: 2"

I spent a good deal of time troubleshooting, and found the policy
database value used in policytest.c was wrong.  I was seeing evidence of
string replacements not being made entirely, for example, a debug
statement inserted where the policy db was opened showed this:

000- btree->open('$MLVAR/db/smsmtp-policy.db',BTREE, RDONLY) ret=2

After more digging, I found that the replacement made for function
dollarexpand in cfgread.c for the variable dbtype was the culprit.
Changing the memcpy under the "Copy down" comment to a strcpy seems to
fix the problem:


/* Copy down */
//strcpy((char*)(s0+len), str);
memcpy(s0+len, str, strlen((char*)str));


It has been a long time since I did any serious C coding: I am quite
rusty at pointers, memcpy, strcpy, etc.  This change appears to have
fixed the problem, but I would appreciate some extra eyes on this code
to confirm this was the correct fix.  Matti/Eugene/Others, can you have
a look at this and let me know if this is the right way to go?


Thanks,

Neal Morgan
--
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to majordomo@nic.funet.fi