From nobody Mon Apr 29 15:07:27 2024 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 4VSmsF1kmyz5JVmK for ; Mon, 29 Apr 2024 15:07:29 +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 4VSmsD700cz4Pdj for ; Mon, 29 Apr 2024 15:07:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714403249; a=rsa-sha256; cv=none; b=c7Ab8Qskq3as8hUFdmwxu4WqGLkItodXcNLdemXoxVEguxs0SL2MH9rXX3ubJI70dYl2Sn 8oF4i85QHFksqulUGwOr4cjom94pCZSKMRHVLR8ov1GqAl4bjAvbgxuor9KtEYHYV3Nagv 3m+Qr1SOTlEe1pI1Pzgy6Tr8qgqQOcqyseHdIuYTj3x2EpO3RjrzfhWVrd59V3f19eQ7RX hBbk6KGNpG2+/wK3LFoH5zrm8gaJxKdmsBK3w1aNkOPiNg6o6o8yZurXuO5JMLeCB1bG2D mgJReGXnkrdaFZQTx1aYhhsRy7+z1ua8Crwx42o8LBiqhIjCF9mVrQV8hcR98g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714403249; 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; bh=syjaF9iPFVOkv7VdxtzSJTbo04AU9azawgw4CSWCkRU=; b=H/vOchRlejpaswLsoIjB/Gd7vBS7NodFYDM9lLebol7pa8pDNs6Q+tIpJ2F34uwz1Mk9nQ 4N3QNiy08Gs6qDAbtjur7rYbCAIwe+hzDehtoii2uzlXSee78lh7GS3QOAAQozp37Hv8t+ WvOmJOwN4JTRUdIavv4FG47dv79QxkcMcTbqRRqTqf9O1CvBRNmZTtAcwgUflsP327cf2Z v/h3J/oxzPie0vrqIIinGjX98i+HmgyXCtwzMdK1Ha9JEFPwVnEbz5Xt1QjHxrxnTmtHUt KhHghT29gHjTE112NHEtvqSKi8qMa95vUSYxl61Tyr+jFO5uaAiwHglnXJABtw== 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 4VSmsD6bhYz1CcL for ; Mon, 29 Apr 2024 15:07:28 +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 43TF7SxW099878 for ; Mon, 29 Apr 2024 15:07:28 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 43TF7SAf099860 for standards@FreeBSD.org; Mon, 29 Apr 2024 15:07:28 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 278653] sh: fix sh -c -e cmd as per POSIX Date: Mon, 29 Apr 2024 15:07:27 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: standards X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: naddy@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: standards@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: 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: X-BeenThere: freebsd-standards@freebsd.org Sender: owner-freebsd-standards@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278653 Bug ID: 278653 Summary: sh: fix sh -c -e cmd as per POSIX Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: standards Assignee: standards@FreeBSD.org Reporter: naddy@FreeBSD.org Created attachment 250294 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D250294&action= =3Dedit fix sh -c -e cmd as per POSIX POSIX requires sh(1) to handle -c like an option that does not take an argument. We already handle the special case of attached options after -c... $ sh -ce 'echo hello world' hello world ... but these fail: $ sh -c -e 'echo hello world' echo hello world: -e: not found $ sh -c -- 'echo hello world' echo hello world: --: not found NetBSD fixed this 21 years ago. With their fix: $ sh -c -e 'echo hello world' hello world $ sh -c -- 'echo hello world' hello world $ sh -c -e 'echo hello; false; echo world' hello Patch attached. I also added a minimal regression test. I have only tested this on 14-STABLE, but there are no relevant changes bet= ween 14-STABLE and 15-CURRENT in sh. --=20 You are receiving this mail because: You are the assignee for the bug.=