COMMAND

    sendmail

SYSTEMS AFFECTED

    Most unices

PROBLEM

    Gregory Neil Shapiro found following.  Usually, if in the  aliases
    file exists user1 as a pipe  to a program, it is executed  as user
    mail, group mail.  But, if  on the same machine user2 (real  user)
    defines a  forward (.forward  file) for  user1, the  program where
    points user1 is executed as user2, not mail.mail.

SOLUTION

    This should be fixed for 8.10.  Below patch follows:

    Index: sendmail/alias.c
    diff -u sendmail/alias.c:8.111 sendmail/alias.c:8.112
    --- sendmail/alias.c:8.111      Mon May 17 17:49:23 1999
    +++ sendmail/alias.c    Mon May 24 11:36:33 1999
    @@ -14,7 +14,7 @@
     #include <sendmail.h>

     #ifndef lint
    -static char id[] = "@(#)$Id: alias.c,v 8.111 1999/05/18 00:49:23 gshapiro Exp $";
    +static char id[] = "@(#)$Id: alias.c,v 8.112 1999/05/24 18:36:33 gshapiro Exp $";
     #endif /* ! lint */


    @@ -114,7 +114,9 @@
		    printaddr(a, FALSE);
	    }
	    a->q_state = QS_DONTSEND;
    +       a->q_flags |= QALIAS;
	    (void) sendtolist(p, a, sendq, aliaslevel + 1, e);
    +       a->q_flags &= ~QALIAS;
	    if (bitset(QSELFREF, a->q_flags) && a->q_state == QS_DONTSEND)
		    a->q_state = QS_OK;


    ------------------------------------
    Index: sendmail/recipient.c
    diff -u sendmail/recipient.c:8.188 sendmail/recipient.c:8.189
    --- sendmail/recipient.c:8.188  Sat May 22 20:25:36 1999
    +++ sendmail/recipient.c        Mon May 24 11:36:33 1999
    @@ -12,7 +12,7 @@
      */

     #ifndef lint
    -static char id[] = "@(#)$Id: recipient.c,v 8.188 1999/05/23 03:25:36 gshapiro Exp $";
    +static char id[] = "@(#)$Id: recipient.c,v 8.189 1999/05/24 18:36:33 gshapiro Exp $";
     #endif /* ! lint */

     #include <sendmail.h>
    @@ -295,6 +295,12 @@
			    a->q_rstatus = newstr("Unsafe for mailing to programs");
			    usrerr("550 Address %s is unsafe for mailing to programs",
				    a->q_alias->q_paddr);
    +               }
    +               else if (bitset(QALIAS, a->q_alias->q_flags))
    +               {
    +                       a->q_uid = DefUid;
    +                       a->q_gid = DefGid;
    +                       a->q_flags |= QGOODUID;
		    }
	    }


    ------------------------------------
    Index: sendmail/sendmail.h
    diff -u sendmail/sendmail.h:8.354 sendmail/sendmail.h:8.355
    --- sendmail/sendmail.h:8.354   Sat May 22 20:37:03 1999
    +++ sendmail/sendmail.h Mon May 24 11:36:34 1999
    @@ -10,7 +10,7 @@
      * the sendmail distribution.
      *
      *
    - *     $Id: sendmail.h,v 8.354 1999/05/23 03:37:03 gshapiro Exp $
    + *     $Id: sendmail.h,v 8.355 1999/05/24 18:36:34 gshapiro Exp $
      */

     /*
    @@ -20,7 +20,7 @@
     #ifdef _DEFINE
     # define EXTERN
     # ifndef lint
    -static char SmailId[] =        "@(#)$Id: sendmail.h,v 8.354 1999/05/23 03:37:03 gshapiro Exp $";
    +static char SmailId[] =        "@(#)$Id: sendmail.h,v 8.355 1999/05/24 18:36:34 gshapiro Exp $";
     # endif /* ! lint */
     #else /* _DEFINE */
     # define EXTERN extern
    @@ -185,8 +185,9 @@
     #define QEXPANDED      0x00000800      /* DSN: undergone list expansion */
     #define QDELIVERED     0x00001000      /* DSN: successful final delivery */
     #define QDELAYED       0x00002000      /* DSN: message delayed */
    +#define QALIAS         0x00004000      /* alias expansion in progress */
     #define QTHISPASS      0x40000000      /* temp: address set this pass */
    -#define QRCPTOK        0x80000000      /* recipient() processed address */
    +#define QRCPTOK                0x80000000      /* recipient() processed address */

     #define Q_PINGFLAGS    (QPINGONSUCCESS|QPINGONFAILURE|QPINGONDELAY)