From: Jacob Keller <jacob.keller@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
phillip.wood@dunelm.org.uk
Cc: Junio C Hamano <gitster@pobox.com>,
Jacob Keller <jacob.e.keller@intel.com>,
Git mailing list <git@vger.kernel.org>
Subject: Re: [PATCH] rebase: exec leaks GIT_DIR to environment
Date: Tue, 31 Oct 2017 01:13:18 -0700 [thread overview]
Message-ID: <A0F486F0-DDA3-4E99-9C0F-371387093C51@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1.1710301343000.6482@virtualbox>
On October 30, 2017 5:46:36 AM PDT, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>Hi Phillip,
>
>On Mon, 30 Oct 2017, Phillip Wood wrote:
>
>> On 30/10/17 06:26, Jacob Keller wrote:
>> > On Sun, Oct 29, 2017 at 8:36 PM, Junio C Hamano <gitster@pobox.com>
>wrote:
>> >> Jacob Keller <jacob.keller@gmail.com> writes:
>> >>
>> >>> I am pretty confident we can fix it....
>> >>
>> >> I am sure we can eventually, but 3 hours is not enough soak time.
>> >>
>> >> I am inclined to leave the fix for 2.15.1/2.16.0 instead of
>delaying
>> >> the release by 10 more days.
>> >
>> > That's fair. I'm not even sure it was introduced since the last
>> > release (I tried 2.12, but not 2.13 or 2.14 manually). Thus, it
>likely
>> > wasn't noticed for at least a release, meaning it's less important
>(to
>> > me at least) that we provide a fix immediately, since it went
>> > unnoticed this long, likely that means few people will be impacted.
>>
>> It is in 2.14.3, I haven't bisected but I suspect it was introduced
>by
>> 311af5266b sequencer (rebase -i): implement the 'exec' command
>>
>> Running
>> git rebase -x'perl -e '\''$,=$\="\n"; print grep { /^GIT_/ } sort
>keys
>> %ENV'\' @
>> Shows that the rebase--helper version also sets GIT_PREFIX as well as
>> GIT_DIR, I suspect the difference is coming from differences in the
>> setup for builtin commands vs external commands. The shell version
>and
>> the rebase--helper version set GIT_CHERRY_PICK_HELP, GIT_EDITOR,
>> GIT_INTERNAL_GETTEXT_SH_SCHEME, GIT_REFLOG_ACTION
>
>Indeed, when you look at git_dir_init in git-sh-setup, you will see
>that
>Unix shell scripts explicitly get their GIT_DIR turned into an absolute
>path.
>
>So my suggested patch is wrong, and it should be more along the lines
>of
>
> struct strbuf buf = STRBUF_INIT;
> const char *child_env[] = { NULL, NULL };
>
> strbuf_addf(&buf, "GIT_DIR=%s", absolute_path(get_git_dir()));
> child_env[0] = buf.buf;
>
> ...
>
> strbuf_release(&buf);
>
>Jake, can I still take you up on taking it from here?
>
>Ciao,
>Dscho
Yes, I will clean this up and submit something tomorrow once I get to a computer. I didn't end up having time to work on Git today.
Thanks,
Jake
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
next prev parent reply other threads:[~2017-10-31 8:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-28 0:01 [PATCH] rebase: exec leaks GIT_DIR to environment Jacob Keller
2017-10-28 16:00 ` Johannes Schindelin
2017-10-28 22:35 ` Jacob Keller
2017-10-29 18:34 ` Phillip Wood
2017-10-30 2:26 ` Junio C Hamano
2017-10-30 2:53 ` Jacob Keller
2017-10-30 3:36 ` Junio C Hamano
2017-10-30 6:26 ` Jacob Keller
2017-10-30 10:20 ` Phillip Wood
2017-10-30 12:46 ` Johannes Schindelin
2017-10-31 8:13 ` Jacob Keller [this message]
2017-10-30 2:51 ` Jacob Keller
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A0F486F0-DDA3-4E99-9C0F-371387093C51@gmail.com \
--to=jacob.keller@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jacob.e.keller@intel.com \
--cc=phillip.wood@dunelm.org.uk \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).