[Bug 220587] /bin/sh Incorrect options handling

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 11 Mar 2025 16:39:23 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220587

Benjamin Takacs <nimaje+fbz@bureaucracy.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nimaje+fbz@bureaucracy.de

--- Comment #19 from Benjamin Takacs <nimaje+fbz@bureaucracy.de> ---
(In reply to Martijn Dekker from comment #17)
POSIX requires  system(command);  to behave *as if*  sh -c -- command  was
called, for safety, because POSIX requires sh to handle options after -c.

I think the better design would be to only allow -c as last argument to sh, as
the SYNOPSIS in our man page says too, that would eliminate all bugs where
command could potentially start with -, without requiring everyone to write -c
-- or have a bug in waiting.

-- 
You are receiving this mail because:
You are on the CC list for the bug.