Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 75846 - maildrop-1.7.0.20040907 segfaults when use=mysql and maildropmysql.cf is unreadable
Summary: maildrop-1.7.0.20040907 segfaults when use=mysql and maildropmysql.cf is unre...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-27 14:29 UTC by Ivo Bitter
Modified: 2004-12-28 04:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivo Bitter 2004-12-27 14:29:44 UTC
when using maildrop in delivery (-d) mode, it fails with a signal 11 if it can't read the maildropmysql.cf file.

In a setup with both virtual and local users, only the virtual mailbox user(s) should be able to read the configfile, the local users should not be able to read it, as it contains mysql username/password information.

Reproducible: Always
Steps to Reproduce:
1. USE=mysql emerge maildrop
2. chgrp virtual_group /etc/maildrop/maildropmysql.cf
3. chmod 640 /etc/maildrop/maildropmysql.cf
4. (as a local user) maildrop -d $USER

Actual Results:  
maildrop: signal 0x0B

Expected Results:  
it should wait for input on stdin, and deliver the message on EOF.

this patch seems to fix it:

diff -ru maildrop-1.7.0.20040907/maildrop/main.C
maildrop-1.7.0.20040907-ivo/maildrop/main.C
--- maildrop-1.7.0.20040907/maildrop/main.C     2004-06-26 17:20:14.000000000 +0200
+++ maildrop-1.7.0.20040907-ivo/maildrop/main.C 2004-12-27 23:12:57.187589776 +0100
@@ -326,7 +326,9 @@

        // Read the config
        mysqlcfg = (mdmysqlconfig*)get_mysql_config(MAILDROPMYSQLCONFIG);
-       if ( mysqlcfg )
+       if ( !mysqlcfg )
+         return 0;
+       else
          if ( !(mysqlcfg->hostname && mysqlcfg->database && mysqlcfg->dbtable) )
              return 0;
Comment 1 Andrej Kacian (RETIRED) gentoo-dev 2004-12-27 16:07:58 UTC
Thanks Ivo, your patch gets applied in -r1 ebuild, which should hit portage mirrors in few hours, along with the patch itself.

I've also reported this upstream on courier-maildrop mailinglist, since I couldn't find any bug tracker. Let's see how will upstream developers react.
Comment 2 Ivo Bitter 2004-12-28 04:49:04 UTC
Thanks. I decided not to send it to the maildrop people myself, since it seems that mysql/ldap support was removed from the 1.8 dev branch in favor of the courier authentication library.