OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: After queue filter in 2.3-20060325

From: Wietse Venema (wietseporcupine.org)
Date: Mon Apr 03 2006 - 19:55:26 CDT


Victor Duchovni:
> On Mon, Apr 03, 2006 at 07:55:33PM -0400, Wietse Venema wrote:
>
> > > > > I run and compile Postfix on FreeBSD v4.11 gcc v2.95.4
> > > >
> > > > This happens when you built Postfix with GNU getopt. Perhaps
> > > > it's included by some third party library that you built Postfix with.
> > > >
> > > > This is a returning problem.
> > > >
> > > > On FreeBSD you MUST use the FreeBSD getopt routine, not the
> > > > incompatible GNU version.
> > > >
> > >
> > > I will try to get my enviroment clean....
> >
> > Good luck finding the intruder.
> >
> > By the way, this means also getting rid of non-FreeBSD include
> > files that define the getopt interface.
>
> One complication is that past problems with GNU getopt have caused
> unexpected options to be seen by pipe(8) when pipe(8) is invoked
> as:
>
> pipe [-master options] ... argv=sendmail -f ${sender} -- ${recipient}
>
> The "..." part had no "--" which suppresses the GNU getopt() options
> after non-option arguments feature. This caused pipe(8) to see "-f"
> and fail.

For the past 8 years or so there never been confusion whether -f
was a pipe(8) option. I added a workaround for GNU getopt damage
years ago.

> The error that the OP is reporting is different: pipe(8)
> does not complain about "-f", but sendmail(1) fails to set "optind"
> correctly (does not skip "--"). This looks like a new bug. One that I
> don't recall reported before. It may still be GNU getopt(), or it may be
> some other getopt() (or even a macro that redefines getopt() as some
> other function), or a compiler bug...

Likely he is using a GNU INCLUDE file and it screws up
the interface to the FreeBSD native implementation.

> The OP should build a stock Postfix sendmail with no MySQL, LDAP, ... or
> other optional features, include files, libraries, ... and see if that
> helps. Until "sendmail -f him -- him" works correctly, something is still
> wrong with the environment. If all else fails upgrade to a more recent
> stable FreeBSD with a more recent compiler.

This has never been a problem on FreeBSD up to 6.0 which is
running Postfix just fine.

I just verified again that Postfix sendmail handles -- correctly.

        Wietse