[Exim] Re: Re: pipe transport

Top Page
Delete this message
Reply to this message
Author: Derrick 'dman' Hudson
Date:  
To: exim-users
Subject: [Exim] Re: Re: pipe transport
--
On Wed, Jul 03, 2002 at 10:12:12AM +0200, Torsten Curdt wrote:

| Do you thing a bash script could do that? Or do I need to code it by
| myself?


Yes.

Sample C program to crash on-demand <g>.


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int
main( int argc , char** argv )
{
    char* null = NULL ;


    if ( argc >= 2  &&  strcmp( argv[1] , "-segv" ) == 0 )
    {
        printf( "null %d\n" , null ) ;
        fflush( stdout ) ;
        printf( "*null %d\n" , *null ) ;
        fflush( stdout ) ;
        printf( "*null %s\n" , *null ) ;
        fflush( stdout ) ;
        *null ;
    }
    return 0 ;
}



(the printf()s are there to prevent gcc from optimizing out the
pointer dereferencing and eliminating the crash)

Sample shell script to show what can be done :


$ ./a.out -segv && echo "success" || echo "failure" $?
null 0
failure 139


That exit code of 139 is very consistent on my system. You might even
be able to simply list that as a temporary error in your exim config.

-D

--

The truly righteous man attains life,
but he who pursues evil goes to his death.
        Proverbs 11:19


http://dman.ddts.net/~dman/

--
[ Content of type application/pgp-signature deleted ]
--