From nobody Mon May 30 22:10:58 2022 X-Original-To: standards@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4E7C21B56AD8 for ; Mon, 30 May 2022 22:10:58 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LBqNx7261z4Vy9 for ; Mon, 30 May 2022 22:10:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0F311F906 for ; Mon, 30 May 2022 22:10:57 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 24UMAvNv017354 for ; Mon, 30 May 2022 22:10:57 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 24UMAv7i017353 for standards@FreeBSD.org; Mon, 30 May 2022 22:10:57 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: standards@FreeBSD.org Subject: [Bug 46441] sh(1): Does not support PS1, PS2, PS4 parameter expansion Date: Mon, 30 May 2022 22:10:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: feature, needs-patch, needs-qa, standards X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jilles@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? maintainer-feedback? mfc-stable13? mfc-stable12? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Standards compliance List-Archive: https://lists.freebsd.org/archives/freebsd-standards List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-standards@freebsd.org X-BeenThere: freebsd-standards@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653948658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rbbmci7FeePFv7fiAkEZjDiSX2P4YkCDAVxW4jszSZ8=; b=UiEdm2r3G9N+7qXit18QdsvG6ztYHXi5DsYI0lMBSbCqJXP4Bf3vt6WaIdl2nJUkZd0mHY NOgofjAC3RVC1dQWkXU96vtpULlfUWKFehQYiNGhfD9sryGSYOKAzXWFcTSGb3O3E4HQko WTfx7Wkecl+etpCeO1y6oMOuHQW9/bEAPT6tiA6Xd2Y+PsEUKYeWjC5Bf8gjZ0s+m+bCr1 oX+TsCB8piBglgy91m56G0qhmzb+aLp9e76T8Li/QqW32yFdriX7iptutBgnKekBNmZT8o pcpN+XrlEARYcw7RuXICegdPPDiCDljLyLOFe0PQzxNFyhWcQHzATeDrNVyPGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653948658; a=rsa-sha256; cv=none; b=N9g/ZPT+SnnhjZUuT1GPa0M+mFJc3bRIL5l/U4g2/ZqX+/WgrlCsSPRQywuyLxl0QJNGGG IKGBSaecDCI8Teoop83Si2yqrsjxLgPsSveeu9XnkgvH6Ioz9qXLTvH2jqgyRrDjPsdOaY 52hsqi1QQJ3kkzfsDrh3hTJT4pJ0vqGXLSpUHqunPephrvdHoRi0qxGAXRbsJWrvO35BO2 ILFQbS7dz6wbVFxdQ5U5rnGNG+qNv4SCNDJjsWuylxL4EM7tlZ0KxOmqonNt/T2u7uFmgd lWAToUI+5+Jn16Ozmfd52SZrB+nomhwfud5GZivm2iDq8DTEMG9CCAfbD+cMVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D46441 --- Comment #15 from Jilles Tjoelker --- (In reply to Piotr Pawel Stefaniak from comment #13) If you're creating a parser state struct, it may be better to pass a pointe= r to it to most functions in parser.c. The struct would be allocated on the stac= k in parsecmd(), parsewordexp() and expandstr(). This eliminates uncertainty abo= ut "which" parser state needs to be used. Due to pointers in the parser state that need to be freed, parsecmd() and parsewordexp() would need to use setjmp(). An alternative might be to keep = the parser state for those statically allocated; I don't think they are re-ente= red (eval and . are not among the builtins that can execute in a subshell witho= ut a fork). To avoid unlimited recursion via PS4 while still allowing command substitut= ion in expandstr(), it might work better to ignore xflag during an expandstr() invocation. --=20 You are receiving this mail because: You are on the CC list for the bug.=