Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site iclbra.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!mcvax!ukc!stc!iclbra!wja From: wja@iclbra.UUCP (Wayne Alston) Newsgroups: net.bugs.usg Subject: fun bug in vi Message-ID: <124@iclbra.UUCP> Date: Thu, 23-May-85 02:52:04 EDT Article-I.D.: iclbra.124 Posted: Thu May 23 02:52:04 1985 Date-Received: Fri, 24-May-85 22:26:34 EDT Distribution: net Organization: I.C.L., Lovelace Road, Bracknell, Berkshire. Lines: 23 Xpath: stc stc-a 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 code reads:- if (beg[-2] != 'e' && beg[-2] != 'v') return; if (beg[-1] != 'x' && beg[-1] != 'i') return; in routine checkmodeline(). The bug was discovered by trying to install a user with the initials 'jei' into /etc/passwd. Note that the above structure need not be at the beginning of the file. Try vi'ing a file containing ei:x: . Wayne Alston ..!reading!iclbra!wja