fun bug in vi

Guy Harris guy at sun.uucp
Sun May 26 05:27:22 AEST 1985


> An undocumented feature in vi allows a valid command in the file being 
> 'edited' of the form
> 
> 	...ex:{command}:
> or
> 	...vi:{command}:
> 
> to be actioned before interactive editing is allowed.  However, the bug
> also permits the variants ei and vx.

The feature(?) and the bug are in ex/vi 3.7 as well, which comes with 4.2BSD.

> The bug was discovered by trying to install a user with the initials 'jei'
> into /etc/passwd.

The fact that mode-line processing can't be turned off is, arguably, a bug
(the same thing may have bitten us here; "vi" acted strangely when editing
/etc/passwd, and I think there was an entry that looked like a mode line).
Somebody posted some changes to "ex" (which apply both the 4.2BSD's 3.7 and
System V Release 2's 3.9) which added a flag "modelines" which, when on,
enabled mode-line processing; the default was to disable mode-line
processing.

	Guy Harris



More information about the Net.bugs.usg mailing list