🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.mail.misc
Article #1792

Shell scripts from smail/sendmail - strange behavior

#1792
From: Clay Luther
Date: Wed, 10 Oct 1990 20:08
61 lines
2822 bytes
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@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@supernet.haus.com 
  postmaster@supernet.haus.com   clay.luther@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.
Technical Details
Message-ID: <1990Oct10.200803.27014@supernet.haus.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!evax!utacfd!letni!mic!supernet!cluther

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!evax!utacfd!letni!mic!supernet!cluther
From: cluther@supernet.haus.com (Clay Luther)
Newsgroups: comp.mail.misc,comp.unix.shell
Subject: Shell scripts from smail/sendmail - strange behavior
Message-ID: <1990Oct10.200803.27014@supernet.haus.com>
Date: 10 Oct 90 20:08:03 GMT
Organization: Harris Adacom Corporation
Lines: 61