I posted this to the qmailadmin mailing list a few hours ago.

qmailadmin-0.42 crashes (apparent segfault) on adding a redirect for a user
(non-postmaster) account.  I tracked the problem down to the doredirect()
function in alias.c. 

This is very strange.  If I slow down execution at the right spot, the crash
doesn't happen.  A one second delay at the location noted below stops the
crash, but putting it earlier, or after the line below the second comment,
has no effect.  A shorter for-loop delay has no effect unless I put it
between the calls to scopy and scat, as noted in the code segment below. 
The rest of qmailadmin appears to work properly.  The code here is pretty
simple, and I have no idea what's happening.  The machine I'm running it on
is running Debian GNU/Linux 2.2r2 and is generally rock-solid.

Maybe there's a lib problem or a problem with the safestring functions in
vpopmail.  I dunno :(  I could maybe induce a core dump and send it to you if
it would help.

Here's my configure for qmailadmin:

./configure \
--enable-cgibindir=/usr/lib/cgi-bin \
--enable-htmldir=/var/www \
--enable-vpopuser=vpopmail

Here's my configure for vpopomail (4.9.8):

./configure \
[EMAIL PROTECTED] \
--enable-default-domain=fmp.com \
--enable-sqwebmail-pass=y \
--enable-log-name=/tmp/vpopmail


doredirect(char *user, char *dom, time_t mytime)
{         
 FILE *fs;
 int i,l;
 char *dot_file;
 struct passwd *pw;

 
        if (!check_email_addr(Newu)) {
                pw = vauth_getpw( user, dom );          
                if ( pw == NULL ) {
                        fprintf(actout,"<h2>%s %d</h2>\n", get_html_text("145"), 2);
                        show_redirect();
                        return(0);
                }
/* -- sleep(1) OK here, crash if higher -- */ 
                l = slen(pw->pw_dir) + 9;
                dot_file = malloc(l);
                scopy(dot_file, pw->pw_dir, l);
for (i = 0; i <= 100000; i++);
/* -- OK here, crash lower -- */
                scat(dot_file, "/.qmail");
                if ( (fs=fopen(dot_file,"w"))==NULL) {
                        fprintf(actout, "%s\n", get_html_text("146"));
                }

-- 
Lindsay Haisley       | "Everything works    |     PGP public key
FMP Computer Services |       if you let it" |      available at
512-259-1190          |    (The Roadie)      | <http://www.fmp.com/pubkeys>
http://www.fmp.com    |                      |

Reply via email to