[comp.unix.shell] Legally overriding permissions from shell scripts

usenet@supernet.haus.com (Usenet Administrator) (10/10/90)

I have written a shell script that handles automated file transfers between
users on our network.  It works by a using issuing the command

% ship <to-user> <filelist>

The ship script then creates a "package" and sends it to a server program on
the destination machine.

The server program, recv, is invoked via a sendmail/smail alias.  Recv accepts
as its input the package file.  It then unpacks the file and leaves the
resultants in the to-user's $HOME and mails notifications to the sender and
receiver.

Or at least it should.  I have discovered that some user's have the permissions
set on their $HOME so that recv can't perform the mv.

How can I override the user's permissions so that recv can write to the 
directory?  I *thought* that scripts run from sendmail/smail aliases ran as
root, and therefore this would be a non-problem.  Obviously, I was wrong.

The current solution is to check the writability of the to-user's $HOME.  If
recv can't write to it, then he leaves the files in a spool/directory from 
which the user can copy them from.  This is not a good solution, since some
of the end users of this program are not unix literate.

I hope this was clear enough.

Thanks.

-- 
System Administrator            root@supernet.haus.com
Harris Adacom Corporation       usenet@supernet.haus.com
Dallas, Tx                      uunet!iex!supernet!root
214/386-2356                    uunet!iex!supernet!usenet