git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Erik Faye-Lund <kusmabite@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH/RFC 2/2] change all unchecked calls to setenv to xsetenv
Date: Tue, 13 Dec 2011 13:19:46 -0500	[thread overview]
Message-ID: <20111213181946.GC1663@sigill.intra.peff.net> (raw)
In-Reply-To: <1323778227-1664-2-git-send-email-kusmabite@gmail.com>

On Tue, Dec 13, 2011 at 01:10:27PM +0100, Erik Faye-Lund wrote:

> While reviewing some patches for Git for Windows, I realized that
> we almost never check the return-value from setenv. This can lead
> to quite surprising errors in unusual sitations. Mostly, an error
> would probably be preferred. So here we go.
> 
> However, I'm not at all convinced myself that all of these make
> sense; in particular settings like GIT_EDITOR and GIT_PAGER could
> perhaps benefit from having a warning printed rather than a hard
> error.
> 
> Thoughts?

I wrote almost the same patch once[1], but failed to actually push it
through to acceptance. There weren't any objections, just that nobody
really cared.  I think it's a reasonable thing to do. The chances of
setenv failing are very low, but the consequences could be quite bad.

There is also a call to putenv in git.c which should be checked (or
could arguably just be converted to setenv).

-Peff

[1] http://thread.gmane.org/gmane.comp.version-control.git/134466

  reply	other threads:[~2011-12-13 18:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13 12:10 [PATCH/RFC 1/2] wrapper: supply xsetenv Erik Faye-Lund
2011-12-13 12:10 ` [PATCH/RFC 2/2] change all unchecked calls to setenv to xsetenv Erik Faye-Lund
2011-12-13 18:19   ` Jeff King [this message]
2011-12-13 18:33     ` Junio C Hamano
2011-12-13 18:55       ` Erik Faye-Lund
2011-12-13 18:16 ` [PATCH/RFC 1/2] wrapper: supply xsetenv Jeff King
2011-12-13 18:34   ` Junio C Hamano
2011-12-13 18:52     ` Erik Faye-Lund
2011-12-13 19:21       ` Andreas Schwab

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=20111213181946.GC1663@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=kusmabite@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;
as well as URLs for NNTP newsgroup(s).