Shell scripts from smail/sendmail - strange behavior

Clay Luther cluther at supernet.haus.com
Thu Oct 11 06:08:03 AEST 1990


I posted something earlier about a script running from a smail/sendmail alias 
(as root) being unable to move files into unwritable directories.  This is
a follow-up post.

Well, it turns out that we have some wierd behavior going on here, possibly
with smail.  I don't know and everyone here is scratching their heads.

OK...

I have a script that expects to receive formatted files from stdin.  This
script is owned by root.  The script is attached to a smail/sendmail alias
like so:

foo:"|/usr/spool/foo/foo.sh"

so that when mail receives mail for foo at bar, the program foo.sh is invoked
with the mail data as input.  OK fine.

Here's the weird part.  The foo.sh program is being invoked *not* as root,
but as cluther, my user account!!!

Aha! I said, I forgot to make foo.sh owned by root.  Uh, nope, foo.sh is owned
by root.

Aha! I said, smail must be running as cluther!  Wild quess region here.  Smail
is and always has been a root id program.

I even went so far to check all the smail config and source files for cluther.
Nothing.

Aha! I said, maybe there is some "strange" interaction between smail and the
aliases file.  Since cluther appears generously throughout it, maybe, just
maybe...Again, this is voodooville, but hey, at I get points for initiative.
Nope, it was not the alias file/smail interaction, as far as I could tell.

Some facts:

Yes, I did write the shell program as cluther, but it current owner and 
current group is root.

No, I don't think I ever compiled smail as cluther, or the alias files as 
cluther.  Although, if this is relevant, I received my original sources in
my cluther account.  Smail was compiled by root.

We are running CTIX/386, SysVr3

Other strangeness:

I create a new script, newfoo.sh, by vi'ing newfoo.sh as root, reading in the
old script, and saving the file *as root*.  Then chmod +x and switched the foo
alias to point to newfoo.sh instead of foo.sh.

Guess what...newfoo.sh was invoke as a cluther id program when smail invoked 
the foo alias.  Wonder years.

Well, that's all I can think of.  Hopefully somebody can provide some answers.
-- 
Clay Luther, Postmaster          cluther at supernet.haus.com 
  postmaster at supernet.haus.com   clay.luther at supernet.haus.com
  Harris Adacom Corporation      MS 23, PO Box 809022, Dallas, Tx 75380-9022
  214/386-2356                   Your mileage may vary.  Void where prohibited.



More information about the Comp.unix.shell mailing list