Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Jun 2017 21:08:05 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319635 - head/bin/sh
Message-ID:  <201706062108.v56L85NK004230@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Tue Jun  6 21:08:05 2017
New Revision: 319635
URL: https://svnweb.freebsd.org/changeset/base/319635

Log:
  sh: Call fc -e editor with interrupts enabled.
  
  Starting the fc -e editor can execute arbitrary script, and executing
  arbitrary script with INTOFF in effect may cause unexpected results.
  
  This change (together with other changes) serves mainly to allow asserting
  that INTOFF is not in effect when starting the evaluation of a node.

Modified:
  head/bin/sh/histedit.c

Modified: head/bin/sh/histedit.c
==============================================================================
--- head/bin/sh/histedit.c	Tue Jun  6 21:03:43 2017	(r319634)
+++ head/bin/sh/histedit.c	Tue Jun  6 21:08:05 2017	(r319635)
@@ -376,10 +376,10 @@ histcmd(int argc, char **argv __unused)
 		char *editcmd;
 
 		fclose(efp);
+		INTON;
 		editcmd = stalloc(strlen(editor) + strlen(editfile) + 2);
 		sprintf(editcmd, "%s %s", editor, editfile);
 		evalstring(editcmd, 0);	/* XXX - should use no JC command */
-		INTON;
 		readcmdfile(editfile);	/* XXX - should read back - quick tst */
 		unlink(editfile);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706062108.v56L85NK004230>