🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #12690

Re: any way to show mode in sun vi

#12690
From: Mike Raffety
Date: Tue, 09 May 1989 08:42
17 lines
1496 bytes
It turns out that the "modeline" option is very interesting indeed.  If
you have this option set (normally it's off) through your environment or
your .exrc file (e.g., "set modeline"), ex and vi will check the first
five lines and the last five lines of the file that you are editing for
text within a line of the form: first character is a tab or space,
followed by the letters "ex" or "vi", followed by a colon, followed by a
string, terminated by another colon.  And THEN, ex/vi will EXECUTE the
string when you begin editing that file.  For example, add a line like "/*
vi:set number: */" to the beginning or end of a file, do a "setenv EXINIT
'set modeline'", and vi the file.  Voila!  You now have line numbering set
BY THE FILE YOU'RE EDITING!

The other undocumented vi "set" option is "sourceany", which, when set,
permits ex/vi to execute ~/.exrc and/or ./.exrc even when you DON'T own
it.

Both sound like potential security problems when enabled ...
Technical Details
Message-ID: <8904271559.AA03107@porsche>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request
From: sunloop!oconnor!porsche!miker@central.sun.com (Mike Raffety)
Newsgroups: comp.sys.sun
Subject: Re: any way to show mode in sun vi
Keywords: Software
Message-ID: <8904271559.AA03107@porsche>
Date: 9 May 89 08:42:19 GMT
Sender: usenet@rice.edu
Organization: Sun-Spots
Lines: 17
Approved: Sun-Spots@rice.edu
Original-Date: Thu, 27 Apr 89 10:59:49 CDT
X-Sun-Spots-Digest: Volume 7, Issue 278, message 9 of 24