<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/exec_cmd.c, branch v2.3.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.0</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-12-22T20:27:01Z</updated>
<entry>
<title>Merge branch 'jc/exec-cmd-system-path-leak-fix'</title>
<updated>2014-12-22T20:27:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-22T20:27:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6bcaff1a4fe4a3088348e706c149941c74d1ad61'/>
<id>urn:sha1:6bcaff1a4fe4a3088348e706c149941c74d1ad61</id>
<content type='text'>
The function sometimes returned a non-freeable memory and some
other times returned a piece of memory that must be freed.

* jc/exec-cmd-system-path-leak-fix:
  system_path(): always return free'able memory to the caller
</content>
</entry>
<entry>
<title>system_path(): always return free'able memory to the caller</title>
<updated>2014-12-01T00:39:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-11-24T19:33:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=59362e560d3c439e77768983b00eade08be9bc3e'/>
<id>urn:sha1:59362e560d3c439e77768983b00eade08be9bc3e</id>
<content type='text'>
The function sometimes returns a newly allocated string and
sometimes returns a borrowed string, the latter of which the callers
must not free().  The existing callers all assume that the return
value belongs to the callee and most of them copy it with strdup()
when they want to keep it around.  They end up leaking the returned
copy when the callee returned a new string because they cannot tell
if they should free it.

Change the contract between the callers and system_path() to make
the returned string owned by the callers; they are responsible for
freeing it when done, but they do not have to make their own copy to
store it away.

Adjust the callers to make sure they do not leak the returned string
once they are done, but do not bother freeing it just before dying,
exiting or exec'ing other program to avoid unnecessary churn.

Reported-by: Alexander Kuleshov &lt;kuleshovmail@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use strbuf_add_absolute_path() to add absolute paths</title>
<updated>2014-08-26T18:06:06Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-07-28T18:34:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9610decf4dc6b9352b81c67e3b03e5bb47fc8427'/>
<id>urn:sha1:9610decf4dc6b9352b81c67e3b03e5bb47fc8427</id>
<content type='text'>
Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>run-command: treat inaccessible directories as ENOENT</title>
<updated>2012-04-05T23:24:13Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-03-30T07:52:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=38f865c27d1f2560afb48efd2b7b105c1278c4b5'/>
<id>urn:sha1:38f865c27d1f2560afb48efd2b7b105c1278c4b5</id>
<content type='text'>
When execvp reports EACCES, it can be one of two things:

  1. We found a file to execute, but did not have
     permissions to do so.

  2. We did not have permissions to look in some directory
     in the $PATH.

In the former case, we want to consider this a
permissions problem and report it to the user as such (since
getting this for something like "git foo" is likely a
configuration error).

In the latter case, there is a good chance that the
inaccessible directory does not contain anything of
interest. Reporting "permission denied" is confusing to the
user (and prevents our usual "did you mean...?" lookup). It
also prevents git from trying alias lookup, since we do so
only when an external command does not exist (not when it
exists but has an error).

This patch detects EACCES from execvp, checks whether we are
in case (2), and if so converts errno to ENOENT. This
behavior matches that of "bash" (but not of simpler shells
that use execvp more directly, like "dash").

Test stolen from Junio.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Name make_*_path functions more accurately</title>
<updated>2011-03-17T23:08:30Z</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@elego.de</email>
</author>
<published>2011-03-17T11:26:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e2a57aac8a8a2b786739a5a93ea9dcfd2f0fd0e2'/>
<id>urn:sha1:e2a57aac8a8a2b786739a5a93ea9dcfd2f0fd0e2</id>
<content type='text'>
Rename the make_*_path functions so it's clearer what they do, in
particlar make clear what the differnce between make_absolute_path and
make_nonrelative_path is by renaming them real_path and absolute_path
respectively. make_relative_path has an understandable name and is
renamed to relative_path to maintain the name convention.

The function calls have been replaced 1-to-1 in their usage.

Signed-off-by: Carlos Martín Nieto &lt;cmn@elego.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>exec_cmd: remove unused extern</title>
<updated>2011-01-19T16:27:22Z</updated>
<author>
<name>Erik Faye-Lund</name>
<email>kusmabite@gmail.com</email>
</author>
<published>2011-01-10T22:00:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b312b4123b053898a583aa6e8da1b26ea828105a'/>
<id>urn:sha1:b312b4123b053898a583aa6e8da1b26ea828105a</id>
<content type='text'>
This definition was added by commit 77cb17e9, but it's left unused since
commit 511707d. Remove the left-over definition.

Signed-off-by: Erik Faye-Lund &lt;kusmabite@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'cw/maint-exec-defpath'</title>
<updated>2010-05-21T11:02:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-05-21T11:02:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=455bda993cceb42921c9ff173da26651f1d66602'/>
<id>urn:sha1:455bda993cceb42921c9ff173da26651f1d66602</id>
<content type='text'>
* cw/maint-exec-defpath:
  autoconf: Check if &lt;paths.h&gt; exists and set HAVE_PATHS_H
  exec_cmd.c: replace hard-coded path list with one from &lt;paths.h&gt;
</content>
</entry>
<entry>
<title>exec_cmd.c: replace hard-coded path list with one from &lt;paths.h&gt;</title>
<updated>2010-04-15T19:07:51Z</updated>
<author>
<name>Chris Webb</name>
<email>chris@arachsys.com</email>
</author>
<published>2010-04-13T09:07:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cb6a22c0760f30ff8050b508b9fabbe13ffba1ae'/>
<id>urn:sha1:cb6a22c0760f30ff8050b508b9fabbe13ffba1ae</id>
<content type='text'>
The default executable path list used by exec_cmd.c is hard-coded to
be "/usr/local/bin:/usr/bin:/bin".  Use an appropriate value for the
system from &lt;paths.h&gt; when available.

Add HAVE_PATHS_H make variables and enable it on Linux, FreeBSD,
NetBSD, OpenBSD and GNU where it is known to exist for now. Somebody
else may want to do an autoconf support later.

Signed-off-by: Chris Webb &lt;chris@arachsys.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Print RUNTIME_PREFIX warning only when GIT_TRACE is set</title>
<updated>2010-02-23T21:20:15Z</updated>
<author>
<name>Johannes Sixt</name>
<email>j6t@kdbg.org</email>
</author>
<published>2010-02-23T11:42:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aa0945701e39cf099ca9c28f79e239359781e4f6'/>
<id>urn:sha1:aa0945701e39cf099ca9c28f79e239359781e4f6</id>
<content type='text'>
When RUNTIME_PREFIX is enabled, the installation prefix is derived by
trying a limited set of known locations where the git executable can
reside. If none of these is found, a warning is emitted.

When git is built in a directory that matches neither of these known names,
the warning would always be emitted when the uninstalled executable is run.
This is a problem on Windows, where gitk picks the uninstalled git when
invoked from the build directory and gets confused by the warning.

Print the warning only when GIT_TRACE is set.

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/maint-1.6.0-exec-path-env'</title>
<updated>2009-03-26T07:27:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-03-26T07:27:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b2aa958dc29eb836a831138f6d84ad7cfadf4355'/>
<id>urn:sha1:b2aa958dc29eb836a831138f6d84ad7cfadf4355</id>
<content type='text'>
* js/maint-1.6.0-exec-path-env:
  Propagate --exec-path setting to external commands via GIT_EXEC_PATH
</content>
</entry>
</feed>
