nvi and modelines

N. Thomas nthomas at cise.ufl.edu
Mon Jul 12 06:06:06 PDT 2004


* Jos? de Paula <espinafre at gmail.com> [2004-07-08 23:38:22 -0300]:
> The nvi manual page says that modelines will never be implemented.
> Does anyone know the rationale behind this

Probably because it's a *huge* security risk. Modelines will cause vi to
read commands from the file. Can you imagine what it could do in the
wrong hands?

Even Vim, preeminent among vi clones, uses only a "stripped down"
modeline. From the online Vim manual:

    No other commands than "set" are supported, for security reasons
    (somebody might create a Trojan horse text file with modelines).

Is there something that you want to do with modelines that you can't do
in nvi?

Thomas

-- 
N. Thomas
nthomas at cise.ufl.edu
Etiamsi occiderit me, in ipso sperabo



More information about the freebsd-questions mailing list