git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git shell scripts flaw wrt dirty env
@ 2007-08-03 20:14 Pierre Habouzit
  2007-08-06 14:15 ` [PATCH] git-am: initialize variable $resume on startup Gerrit Pape
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Habouzit @ 2007-08-03 20:14 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1285 bytes --]


  I recently had an issue with git-rebase, and actually git-am, kind of
hard to track down. After some hassle to understand what was going on,
it happened that for an idiotic reason (me trying a fancy new login
manager for X that didn't cleansed environment before staring X) made
all my env dirty. In particular it had $resume (in small letters) set to
/dev/sda5, and git-am happens to use the very same variable, without
cleansing the environment.

  I'm maybe completely out of luck, and that's the sole unsafe use of
variables in git shell scripts, but I don't think so, and maybe some
kind of failsafe could be used. A crude way is to call:

  unset `env | cut -d= -f1 | grep -v [A-Z]`

  at the beginning of every script, so that every lowercase-only
variables are unset, hence can be safely used. But it's completely
tasteless. Though, as it can really lead to _very_ odd bugs, well, I
just wanted to share the issue. For the curious, you can read on [0]
what the issue looked like for me...


  [0] http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=38;bug=435807#38

Cheers,
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-06 23:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-03 20:14 git shell scripts flaw wrt dirty env Pierre Habouzit
2007-08-06 14:15 ` [PATCH] git-am: initialize variable $resume on startup Gerrit Pape
2007-08-06 23:16   ` Junio C Hamano

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).