Date: Sat, 4 Aug 2007 13:17:10 -0500 From: Don Hinton <don.hinton@vanderbilt.edu> To: freebsd-questions@freebsd.org Cc: RW <fbsd06@mlists.homeunix.com>, questions@freebsd.org Subject: Re: How does Sendmail know how it was invoked? Message-ID: <200708041317.10675.don.hinton@vanderbilt.edu> 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
On Saturday 04 August 2007 13:06:34 RW wrote: > 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. It checks argv[0], i.e., the name used to invoke it. Here's a simple program demostrating it: #include <iostream> int main (int argc, char* argv[]) { std::cout << "my name is: " << argv[0] << std::endl; return 0; } Save it to a file and do the following: $ c++ -o foo file.cxx $ ./foo my name is: ./foo $ mv foo bar $ ./bar my name is: ./bar hth... don > > I'm just curious. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" -- Don Hinton <don.hinton at vanderbilt.edu> or <hintonda at gmail.com> Institute for Software Integrated Systems (ISIS), Vanderbilt University tel: 615.480.5667 or 615.870.9728
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708041317.10675.don.hinton>