Subject: safe pine

From: Hans Klunder <[email-masked]>
Date: Tue, 11 Apr 1995 09:05:42 GMT

Hello,

I'd like to setup a postoffice in which my users get pine as their default 
shell. However, I want to disable shell escapes and printing.

Is this possible with 3.91 or do I need to hack the code myself ?

Thanks in advance,

Hans

---

From: Ian Russell Ollmann <[email-masked]>
Date: Wed, 12 Apr 1995 02:25:27 -0700

> Is this possible with 3.91 or do I need to hack the code myself ?

Usually, you can re-alias whatever command it is which brings up an empty
shell to something which includes an automatic first command to be
executed within that shell. This command can be /usr/bin/pine or perhaps a
shell script to set a few environment variables first and then starts up
pine. The actual implementation of this is somewhat system specific as how
different OS's deal with windows/menus/etc is different.  However, if you
can find the default file is for defining the format and function of 
whatever tool the user uses to call forth his shell, you can modify it to 
do whatever you deem necessary. For example, in IRIX 4.0.5 on a silicon 
graphics machine, /usr/lib/X11/system.chestrc defines the contents and 
function of the main set of pulldown menus, from which the user gets 
new shells. From the pulldown menu, Tools, the user can select "Shell" to 
get a new shell. You can change /usr/lib/X11/system.chestrc from:

...
Menu Tools
{
    "Shell"  		f.checkexec 	"/usr/sbin/winterm"
    "Manual Pages"  	f.checkexec 	"/usr/bin/X11/xman" 
    "Release Notes"  	f.checkexec 	"/usr/sbin/grelnotes" 
    (more stuff...)
}
...

to something which looks like this:

...
Menu Tools
{
    "Shell"  		f.checkexec 	"/usr/sbin/winterm -c /bin/csh -c /usr/bin/pine"
    "Manual Pages"  	f.checkexec 	"/usr/bin/X11/xman" 
    "Release Notes"  	f.checkexec 	"/usr/sbin/grelnotes" 
    (more stuff...)
} 
...

The -c option for winterm, rsh or csh is common for use to feed the rest
of the line in as the first command to be executed by the new cshell or in
the winterm. You will find that pine doesn't work very well without
environment variables such as MAIL set, so you may wish to replace
"/usr/bin/pine", above, with the path to a small shell script which
defines the necessary environment variables. The last command in this
shell script can be /usr/bin/pine (or equivalent). In have no idea how to
deal with the problem of handling user login. Perhaps it can be dealt with
within the confines of the shell script. You probably don't want users to
be able to read each other's mail, do you? When using a setup like this,
when I exit pine, the window closes itself automatically. (I didn't have
to do anything or include any special commands for this to happen). So,
shell escapes may not be a problem for you. As to how to disable printing,
I'm not sure whether it is best to make a small hack to pine or just set
up pine with an incorrect printing command and hope that users aren't
savvy enough to figure out how to edit their own .pinerc to fix the
problem.  Good luck. 

				Ian Ollmann