Here's how to stop shell escapes from vi

Jonathan I. Kamens jik at athena.mit.edu
Tue Oct 2 05:01:41 AEST 1990


In article <1990Sep30.174404.6132 at gorgon.uucp>, dag at gorgon.uucp (Daniel A. Glasser) writes:
|> My suggestion is to write a wrapping routine which checks the users gid or
|> uid (or whatever) and based on that either leaves the users PATH and SHELL
|> alone (for those who should be allowed to shell out of vi) or changes both
|> PATH and SHELL environment variables to something safe, (SHELL will point
|> to something like 'main(){write(0,"No shell for you!\n");exit(1);}'
|> and PATH to something which just has what vi might legitimately have to
|> get at.  This program will then exec the real vi.

  As someone else has already pointed out, it is possible to set the SHELL
environment variable from inside vi, using a vi command.

\begin{soapbox}
  Read the net before you post.  RTFM before you post.
\end{soapbox}

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710



More information about the Comp.unix.sysv386 mailing list