<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>75846</bug_id>
          
          <creation_ts>2004-12-27 14:29 0000</creation_ts>
          <short_desc>maildrop-1.7.0.20040907 segfaults when use=mysql and maildropmysql.cf is unreadable</short_desc>
          <delta_ts>2004-12-28 04:49:04 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>gentoo@joeniks.nl</reporter>
          <assigned_to>net-mail@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>gentoo@joeniks.nl</who>
            <bug_when>2004-12-27 14:29:44 0000</bug_when>
            <thetext>when using maildrop in delivery (-d) mode, it fails with a signal 11 if it can&apos;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-&gt;hostname &amp;&amp; mysqlcfg-&gt;database &amp;&amp; mysqlcfg-&gt;dbtable) )
              return 0;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ticho@gentoo.org</who>
            <bug_when>2004-12-27 16:07:58 0000</bug_when>
            <thetext>Thanks Ivo, your patch gets applied in -r1 ebuild, which should hit portage mirrors in few hours, along with the patch itself.

I&apos;ve also reported this upstream on courier-maildrop mailinglist, since I couldn&apos;t find any bug tracker. Let&apos;s see how will upstream developers react.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@joeniks.nl</who>
            <bug_when>2004-12-28 04:49:04 0000</bug_when>
            <thetext>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. </thetext>
          </long_desc>
      
    </bug>

</bugzilla>