Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Aug 2007 13:23:07 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        RW <fbsd06@mlists.homeunix.com>
Cc:        questions@freebsd.org
Subject:   Re: How does Sendmail know how it was invoked?
Message-ID:  <20070804182307.GD77822@dan.emsphone.com>
In-Reply-To: <20070804190634.69234e1e@gumby.homeunix.com.>
References:  <20070804190634.69234e1e@gumby.homeunix.com.>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Aug 04), RW said:
> mailwrapper checks to see how it was invoked and then looks up the
> appropriate command in mailer.conf.  All of the entries in
> mailer.conf point to /usr/libexec/sendmail/sendmail, so how does that
> binary know what it's supposed to do.

The kernel passes the executable name to the running process along with
the rest of the commandline arguments.  If you run "ls -l /tmp", for
example, the ls binary gets "ls", "-l", and "/tmp" as its arguments. 
See around line 360 of src/contrib/sendmail/src/main.c.

http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/sendmail/src/main.c?annotate=HEAD

-- 
	Dan Nelson
	dnelson@allantgroup.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070804182307.GD77822>