From owner-svn-src-all@freebsd.org Wed Mar 7 18:37:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07DA5F4860A; Wed, 7 Mar 2018 18:37:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA3CD86C71; Wed, 7 Mar 2018 18:37:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5121257DF; Wed, 7 Mar 2018 18:37:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27Ib4Sb070863; Wed, 7 Mar 2018 18:37:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27Ib40v070862; Wed, 7 Mar 2018 18:37:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803071837.w27Ib40v070862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Mar 2018 18:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330620 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2018 18:37:05 -0000 Author: kevans Date: Wed Mar 7 18:37:04 2018 New Revision: 330620 URL: https://svnweb.freebsd.org/changeset/base/330620 Log: lualoader: Use cli_execute_unparsed for commands passed in via loader.conf This applies to: - exec - [module]_before - [module]_error - [module]_after Before this commit, these used loader.perform to execute them as a pure, unsalted loader command. This means that they were not able to take advantage of any Lua-salted loader commands, like boot and autoboot, or pure Lua loader commands (functions attached to the 'cli' module). They now have access to the full arsenal, just shy of being able to execute arbitrary Lua. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Wed Mar 7 18:31:31 2018 (r330619) +++ head/stand/lua/config.lua Wed Mar 7 18:37:04 2018 (r330620) @@ -109,7 +109,7 @@ local pattern_table = { { str = "^%s*exec%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, _) - if loader.perform(k) ~= 0 then + if cli_execute_unparsed(k) ~= 0 then print(MSG_FAILEXEC:format(k)) end end, @@ -290,25 +290,25 @@ function config.loadmod(mod, silent) str = str .. k end if v.before ~= nil then - pstatus = loader.perform(v.before) == 0 + pstatus = cli_execute_unparsed(v.before) == 0 if not pstatus and not silent then print(MSG_FAILEXBEF:format(v.before, k)) end status = status and pstatus end - if loader.perform(str) ~= 0 then + if cli_execute_unparsed(str) ~= 0 then if not silent then print(MSG_FAILEXMOD:format(str)) end if v.error ~= nil then - loader.perform(v.error) + cli_execute_unparsed(v.error) end status = false end if v.after ~= nil then - pstatus = loader.perform(v.after) == 0 + pstatus = cli_execute_unparsed(v.after) == 0 if not pstatus and not silent then print(MSG_FAILEXAF:format(v.after, k)) end