public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "Alejandro Colomar (man-pages)" <alx.manpages@gmail.com>
To: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Cc: linux-man@vger.kernel.org
Subject: Re: Ping: [PATCH v4] system.3: Document bug and workaround when the command name starts with a hypen
Date: Mon, 18 Jan 2021 17:11:38 +0100	[thread overview]
Message-ID: <9c00f2b3-bd56-0f75-0053-ef17bec26085@gmail.com> (raw)
In-Reply-To: <e1a37ef8-72b7-aeb5-dd0f-36bec4597a6a@gmail.com>

On 1/18/21 4:58 PM, Michael Kerrisk (man-pages) wrote:
> Hi Alex,
> 
> On 1/18/21 4:45 PM, Alejandro Colomar (man-pages) wrote:
>> [removed some CCs]
>>
>> On 1/18/21 4:37 PM, Michael Kerrisk (man-pages) wrote:
>>> On 1/18/21 4:28 PM, Alejandro Colomar (man-pages) wrote:
>>>> Hi Michael,
>>>>
>>>> Ping!
>>>>
>>>> And now I noticed a typo in the subject:
>>>> s/hypen/hyphen/
>>>
>>> D'oh! I missed that.
>>>
>>> In cases like these, where there's already two amendments to the patch,
>>> perhaps better is a new complete patch, rather than a ping :-).
>>
>>
>> Yup, I considered that for a moment...
>> Should've listened to myself :/
>>
>> BTW, I don't understand why you ffixed to use .RS/.RE.
> 
> 
> Cause that's what we do around code blocks. See man-pages(7),
> and all of the other pages :-).
> 
> The conclusion of the mail thread on this topic was that .RS/RE don't 
> do correct relative indents, IIRC.

Ahhh, I read the diff the other way.
I thought you changed .in -> .RS.
But you did .RS -> .in.

So forget what I said :-)

Thanks,

Alex

> 
> Thanks,
> 
> Michael
> 
> 
>> See
>> https://lore.kernel.org/linux-man/eaee2c6e-cbb7-94b2-f6c4-9039d184e129@gmail.com/T/
>>
>> Thanks,
>>
>> Alex
>>
>>>
>>> Thanks,
>>>
>>> Michael
>>>
>>>
>>>> On 1/8/21 3:28 PM, Alejandro Colomar (man-pages) wrote:
>>>>>
>>>>>
>>>>> On 1/8/21 3:22 PM, Alejandro Colomar wrote:
>>>>>> man-pages bug: 211029
>>>>>>  https://bugzilla.kernel.org/show_bug.cgi?id=211029
>>>>>>
>>>>>> Complete workaround
>>>>>
>>>>> Maybe a bit more readable:
>>>>> Complete workaround example
>>>>>
>>>>>
>>>>>> (it was too long for the page, but it may be useful here):
>>>>>>
>>>>>> ......
>>>>>>
>>>>>> $ sudo ln -s -T /usr/bin/echo /usr/bin/-echo;
>>>>>> $ cc -o system_hyphen -x c - ;
>>>>>> #include <stdlib.h>
>>>>>>
>>>>>> int
>>>>>> main(void)
>>>>>> {
>>>>>>     system(" -echo Hello world!");
>>>>>>     exit(EXIT_SUCCESS);
>>>>>> }
>>>>>>
>>>>>> $ ./system_hyphen;
>>>>>> Hello world!
>>>>>>
>>>>>> Reported-by: Ciprian Dorin Craciun <ciprian.craciun@gmail.com>
>>>>>> Cc: Florian Weimer <fweimer@redhat.com>
>>>>>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
>>>>>> ---
>>>>>>
>>>>>> D'oh!
>>>>>>
>>>>>>  man3/system.3 | 20 ++++++++++++++++++++
>>>>>>  1 file changed, 20 insertions(+)
>>>>>>
>>>>>> diff --git a/man3/system.3 b/man3/system.3
>>>>>> index 753d46f7d..ead35ab30 100644
>>>>>> --- a/man3/system.3
>>>>>> +++ b/man3/system.3
>>>>>> @@ -255,6 +255,26 @@ are not executed.
>>>>>>  Such risks are especially grave when using
>>>>>>  .BR system ()
>>>>>>  from a privileged program.
>>>>>> +.SH BUGS
>>>>>> +.\" [BUG 211029](https://bugzilla.kernel.org/show_bug.cgi?id=211029)
>>>>>> +.\" [Glibc bug](https://sourceware.org/bugzilla/show_bug.cgi?id=27143)
>>>>>> +.\" [POSIX bug](https://www.austingroupbugs.net/view.php?id=1440)
>>>>>> +If the command name starts with a hyphen,
>>>>>> +.BR sh (1)
>>>>>> +interprets the command name as an option,
>>>>>> +and the behavior is undefined.
>>>>>> +(See the
>>>>>> +.B \-c
>>>>>> +option to
>>>>>> +.BR sh (1).)
>>>>>> +To work around this problem,
>>>>>> +prepend the command with a space as in the following call:
>>>>>> +.PP
>>>>>> +.RS 4
>>>>>> +.EX
>>>>>> +    system(" \-unfortunate\-command\-name");
>>>>>> +.EE
>>>>>> +.RE
>>>>>>  .SH SEE ALSO
>>>>>>  .BR sh (1),
>>>>>>  .BR execve (2),
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
> 
> 


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

  reply	other threads:[~2021-01-18 16:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 15:13 [RFC] system.3: Document bug when the command name starts with a hypen Alejandro Colomar
2021-01-04 15:54 ` Ciprian Dorin Craciun
2021-01-04 18:04   ` [PATCH] system.3: Document bug and workaround " Alejandro Colomar
2021-01-04 18:32     ` Alejandro Colomar (man-pages)
2021-01-04 20:02       ` Alejandro Colomar (man-pages)
2021-01-08 14:15     ` [PATCH v2] " Alejandro Colomar
2021-01-08 14:20     ` [PATCH v3] " Alejandro Colomar
2021-01-08 14:22     ` [PATCH v4] " Alejandro Colomar
2021-01-08 14:28       ` Alejandro Colomar (man-pages)
2021-01-18 15:28         ` Ping: " Alejandro Colomar (man-pages)
2021-01-18 15:37           ` Michael Kerrisk (man-pages)
2021-01-18 15:45             ` Alejandro Colomar (man-pages)
2021-01-18 15:58               ` Michael Kerrisk (man-pages)
2021-01-18 16:11                 ` Alejandro Colomar (man-pages) [this message]
2021-01-18 15:36         ` Michael Kerrisk (man-pages)
2021-01-18 15:35       ` Michael Kerrisk (man-pages)
2021-01-05 13:23 ` [RFC] system.3: Document bug " Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9c00f2b3-bd56-0f75-0053-ef17bec26085@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox