From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, zippel@linux-m68k.org,
mingo@elte.hu, akpm@linux-foundation.org, geert@linux-m68k.org,
elendil@planet.nl, cloos@jhcloos.com
Subject: Re: [PATCH] kconfig: place git SHA1 in .config output if in SCM
Date: Tue, 2 Mar 2010 18:16:24 -0800 [thread overview]
Message-ID: <20100303021624.GE6786@linux.vnet.ibm.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1003021725170.3616@localhost.localdomain>
On Tue, Mar 02, 2010 at 05:29:50PM -0800, Linus Torvalds wrote:
>
>
> On Tue, 2 Mar 2010, Paul E. McKenney wrote:
> > + env = getenv(SRCTREE);
> > + if (env) {
> > + sprintf(cmdline,
> > + "%s/scripts/setlocalversion %s 2> /dev/null",
> > + env, env);
> > + slv = popen(cmdline, "r");
>
> I suspect this does various bad things if there are spaces or special
> characters in $SRCTREE.
>
> It would be a lot safer to uses fork/execve rather than something
> that interprets a shell command line.
>
> Of course, I didn't check that all our old users of SRCTREE are safe
> either, but at least docproc.c (the one I _did_ check) uses 'execvp()' and
> 'fopen()' that both take real filenames, not a shell string.
Well, we certainly don't want or need bash's "$", "``", and other
interpretations in this case. I will update and send out a new patch.
Hmmm... It has been one good long time since I have used pipe(), dup2(),
exec*(), and friends. In happy contrast to last time, some of the man
pages now seem to have nice examples. ;-)
Thanx, Paul
next prev parent reply other threads:[~2010-03-03 2:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-03 1:18 [PATCH] kconfig: place git SHA1 in .config output if in SCM Paul E. McKenney
2010-03-03 1:29 ` Linus Torvalds
2010-03-03 2:16 ` Paul E. McKenney [this message]
2010-03-03 17:28 ` James Cloos
2010-03-03 19:58 ` Paul E. McKenney
2010-03-03 20:41 ` James Cloos
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=20100303021624.GE6786@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=cloos@jhcloos.com \
--cc=elendil@planet.nl \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=torvalds@linux-foundation.org \
--cc=zippel@linux-m68k.org \
/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