git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] show-diff shell safety

From
PJPaul Jackson <pj@sgi.com>
Date
Apr 17, 2005, 01:00 UTC
Message-ID
<20050416180055.76cb8a25.pj@sgi.com>
In-Reply-To
<7vbr8e44u1.fsf@assigned-by-dhcp.cox.net>
Junio wrote:
> The command line for running "diff" command is built without
> taking shell metacharacters into account. 

Ack - you're right. One should avoid popen and system in all but personal hacking code. There are many ways, beyond just embedded shell redirection, to cause problems with these calls.

One should directly code execve(), execv(), or execl().
Search for "popen system IFS PATH"
-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@engr.sgi.com> 1.650.933.1373, 1.925.600.0401
Previous: Junio C Hamano
Message 2 of 2 in “show-diff shell safety”
  1. show-diff shell safetyJunio C Hamano, Apr 17, 2005
  2. Paul JacksonApr 17, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.