🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1462

Legally overriding permissions from shell scripts

#1462
From: Usenet Administrator
Date: Wed, 10 Oct 1990 16:22
34 lines
1865 bytes
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
Technical Details
Message-ID: <1990Oct10.162221.21855@supernet.haus.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!timbuk!cs.umn.edu!uc!tut.cis.ohio-state.edu!cs.utexas.edu!evax!utacfd!letni!mic!supernet!usenet

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!timbuk!cs.umn.edu!uc!tut.cis.ohio-state.edu!cs.utexas.edu!evax!utacfd!letni!mic!supernet!usenet
From: usenet@supernet.haus.com (Usenet Administrator)
Newsgroups: comp.unix.shell
Subject: Legally overriding permissions from shell scripts
Message-ID: <1990Oct10.162221.21855@supernet.haus.com>
Date: 10 Oct 90 16:22:21 GMT
Organization: Harris Adacom Corporation
Lines: 34