Re: [PATCH 2/1] execve: only smart people should use vim

From: Mateusz Guzik

Date: Wed Apr 01 2026 - 15:07:27 EST


On Wed, Apr 1, 2026 at 8:58 PM Mateusz Guzik <mjguzik@xxxxxxxxx> wrote:
>
> On Wed, Apr 1, 2026 at 8:53 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> >
> > From: Steven Rostedt <rostedt@xxxxxxxxxxx>
> >
> > To keep people from getting stuck in vim and not knowing how to exit it.
> > Make running vim a bit more complex.
> >
> > They can go back and use emacs, of course that will fail too, but then
> > they have something to work on.
> >
> > Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
> > ---
> > fs/exec.c | 11 +++++++++++
> > include/uapi/asm-generic/errno.h | 1 +
> > 2 files changed, 12 insertions(+)
> >
> > diff --git a/fs/exec.c b/fs/exec.c
> > index 2e954b31e3a2..ecb425388008 100644
> > --- a/fs/exec.c
> > +++ b/fs/exec.c
> > @@ -1741,6 +1741,17 @@ static int bprm_execve(struct linux_binprm *bprm)
> > return -EMACS;
> > }
> >
> > + /*
> > + * Only really smart people should use vim. If they can't figure out
> > + * how to circumvent this, then they have no right using it!
> > + */
> > + if (strstr(bprm->filename, "vim")) {
> > + /*
> > + * Learn to code!
> > + */
> > + return -NOTEMACS;
> > + }
> > +
>
> I would consider extending this to nvim, otherwise looks good.

that's of course already covered, my bad!

>
> Reviewed-by: Mateusz Guzik <mjguzik@xxxxxxxxxxxxxxxx>
>
> > retval = prepare_bprm_creds(bprm);
> > if (retval)
> > return retval;
> > diff --git a/include/uapi/asm-generic/errno.h b/include/uapi/asm-generic/errno.h
> > index 1a8fda40cd8a..4cc4ae653cec 100644
> > --- a/include/uapi/asm-generic/errno.h
> > +++ b/include/uapi/asm-generic/errno.h
> > @@ -123,5 +123,6 @@
> > #define EHWPOISON 133 /* Memory page has hardware error */
> >
> > #define EMACS 134 /* Editor too big */
> > +#define NOTEMACS 135 /* Editor used by smart people */
> >
> > #endif
> > --
> > 2.51.0
> >