From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14649 invoked from network); 13 Feb 2023 17:43:07 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 13 Feb 2023 17:43:07 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1676310187; b=sdP1FDul/+vCVnxbYB2fDUYULzG7j1OdDUNWEJUiI1BNNRHqwo5ZUbvnfmiP4fjglR2eMqMZoZ MBgTU98Dxc2iQUl3vfgGYv/H7+vo0uQ06ufNk47AQAXQEyMY5XU5twxUrgCBEpGQ7DXudlENpG QcLFxNVIuvz6AYPK5rrf49ytLCaueaElYaQ57d2NAO7VT24KTvn6UCN1NH0GYavfvov0YolI/M DG/KmctP3YvJyxbRcZ4kSO/uyd1fUPwJ8Wv3q9Gq7CJRxARufnzzzGhBqOkefF9Zzfja9DQubZ aK9Kh91xMFmrKvxDW2uiF/1w7uozXQ7PL/ojJToa2WiVdA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1676310187; bh=SWPWxra2t0EMnpJd5q1trJ2nXgg4TQc4xBE/w+uLg5M=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature: DKIM-Signature; b=RIrWGrCPe0PhLPS1fjRSRBuyUU11ckRNqtbGy7GQ3DeyHv8WAgjHGNT2l6im8ZLlMOBJ/X719/ zifei2lGJ9S8p6tTZGD5XwoCHRmjFyIi+NGb+IUBDjmhgJcPDFVcBIHcSnn0U6uV4CiGBPnDeV VHQkw6W25yxFqLbhHkP8+imGvu8U1ka5ISoFThVE/sxn2iw32UBUUN6fZSN/30WyPyQGZLag3o SahvHcUEsH9CG0FMvbeXp3Uu+QtHaw7BzHhoS77i5MW4VpyHuXq/6JfzXv7ka9YGpTusYHzqI6 PgqYCloLEOisSnJ2GPShb0PwBHpGrajHTxoTyoC9F9D0+A==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From: Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=EWc34yycbAaNCtifeCVGYV9SqwGSXcLBOn4emFXgFFA=; b=MVj2mnW2IIwBOtgqG3Qf3MkJ3n 9XRPJKByJHmvpJi5mTF0+Mys9t0WI80ZGyNlmG3cIKEVkX0pTR695SGOeNN8QxHYmpjRBrpwp2Gd9 LSrRhEYvfhQ+hGca6PtaGUPv20P81+MsX3a53vnhouhjCyn7GXQN5wblce37Tn3Jm4AUhrXXP78aI MSidSWTUMyzwjkW+v+o3Y56UYMlCzuPzNSDM0Lym8e3S64rtayvOOqEEVB6Dk6EA6DA2h7W6455RP UfVXJr53Hhuj5lYjKjyWRGPtjo3g++gx5RhX87H8OCNqI5eeT3V7HxJ/qqvr1hLiMJte5jOF7Tvfl sA0PhqJg==; Received: by zero.zsh.org with local id 1pRcr4-000Nws-85; Mon, 13 Feb 2023 17:43:06 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq1.tb.ukmail.iss.as9143.net ([212.54.57.96]:39414) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1pRcqn-000NdF-MM; Mon, 13 Feb 2023 17:42:50 +0000 Received: from [212.54.57.80] (helo=smtp1.tb.ukmail.iss.as9143.net) by smtpq1.tb.ukmail.iss.as9143.net with esmtp (Exim 4.90_1) (envelope-from ) id 1pRcqm-0002yJ-VI for zsh-workers@zsh.org; Mon, 13 Feb 2023 18:42:49 +0100 Received: from oxbe14.tb.ukmail.iss.as9143.net ([172.25.160.145]) by smtp1.tb.ukmail.iss.as9143.net with ESMTP id RcqmppSdE5gtoRcqmpdZ5v; Mon, 13 Feb 2023 18:42:48 +0100 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-workers@zsh.org X-SourceIP: 172.25.160.145 X-CNFS-Analysis: v=2.4 cv=cvhd0X0i c=1 sm=1 tr=0 ts=63ea7698 cx=a_exe a=DLFSjXpdtQHJ5hZ/0KPoEg==:117 a=1DWFKdCB1IcA:10 a=IkcTkHD0fZMA:10 a=ZjyAdWuDOD4A:10 a=NLZqzBF-AAAA:8 a=pGLkceISAAAA:8 a=aDzhXIvnt9bcT__tVs4A:9 a=QEXdDO2ut3YA:10 X-Authenticated-Sender: p.w.stephenson@ntlworld.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com; s=meg.feb2017; t=1676310168; bh=SWPWxra2t0EMnpJd5q1trJ2nXgg4TQc4xBE/w+uLg5M=; h=Date:From:To:In-Reply-To:References:Subject; b=Yt3+8Hzx8ysVpe5b2A3y31UHtiaSCeIdtrqrBkkTbaHN6SX/A28UsWKdcvV423K2b 4XU4MpiNrnsiqHZGTYXT1v/RcEEqRg43CIPuZDvjC07QKW5sQkOh9JbTndmJQ551Aa MHRbsMPE3N+tZj5uW9ltJuHfM4Y0XxDfspUskcRIGlD3UdSlozURSB9b7BCnqqkjkd IFTI0TmkcleYk6tHT5T9o809IPe9Fo89RHe0lgjK50pglmIxY26KngpAP4ntnG5Mcx 6h5EPax9qlR82+R+0xfEsJ4lG6j19Qrf/T/IBBWiz6GG6FVHWgowrEE4riTIM+5uiD azkdU4HFtM5EA== Date: Mon, 13 Feb 2023 17:42:48 +0000 (GMT) From: Peter Stephenson To: Zsh hackers list Message-ID: <1106715548.16569.1676310168881@mail.virginmedia.com> In-Reply-To: <1721279218.10760102.1675694027023@mail.virginmedia.com> References: <1721279218.10760102.1675694027023@mail.virginmedia.com> Subject: Re: [BUG] NO_EXEC should not exec $NULLCMD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer X-Originating-IP: 147.161.224.167 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfJH922wuqDLM6shHUJpmDfNhEdHOwIVAMWyjas7wYxcGJYbZVBlGDGkkcGUmuuc090JsmjFJbyS5gVVEh9HMpzaSgJzr4GVYkKFxnN5UT9dzGElEhiEF asaxV3T8doCGFY9D5/eFCphc6vH4wTX5jV4pb6GsFNkcStsCX0dTPdZlPhO/ffFn8tcGg2ErFKhU6XJdFkQWpAFsNCO/ugRukjQVIjKMvKz4C1ExPxCHbO9n X-Seq: 51425 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: > On 06/02/2023 14:33 Peter Stephenson wrote: > > On 06/02/2023 12:22 Marlon Richert wrote: > > Steps to reproduce: > > % PS1='%# ' zsh -f > > % zsh -nc ': $( < $1 )'; print $? > > zsh:1: no such file or directory: > > 1 > > $(<$1) is special syntax to open $1 and insert it on the command line; > it's nothing to do with $NULLCMD, nor is anything being executed. > So --- given the way NO_EXEC doesn't have a very detailed specification > in zsh --- I don't think it's actually violating any designed behaviour > (that's quite a weak statement in these parts). > > However, it is a reasonable question whether the redirection should > be taking place here at all, as it doesn't in other cases when > NO_EXEC is set, even if that's mostly a side effect of where the NO_EXEC > logic lives, so it's certainly quite confusing. If not, it shouldn't > be hard to suppress. This is probably uncontroversial. pws diff --git a/Src/exec.c b/Src/exec.c index c8eb71b34..3330bbce8 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -4678,6 +4678,9 @@ getoutput(char *cmd, int qt) if (!prog) return NULL; + if (!isset(EXECOPT)) + return newlinklist(); + if ((s = simple_redir_name(prog, REDIR_READ))) { /* $(< word) */ int stream; diff --git a/Test/E01options.ztst b/Test/E01options.ztst index d38fbed74..533e08773 100644 --- a/Test/E01options.ztst +++ b/Test/E01options.ztst @@ -416,6 +416,9 @@ 1:NO_EXEC does recognize bad substitution syntax *?* bad substitution + (setopt noexec; : $(