<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/cache.h, branch v2.7.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.7.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.7.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-03-10T19:13:46Z</updated>
<entry>
<title>Merge branch 'jk/pack-idx-corruption-safety' into maint</title>
<updated>2016-03-10T19:13:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-03-10T19:13:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=80047fa084f994969d42338bc3fbbb89e7d957d6'/>
<id>urn:sha1:80047fa084f994969d42338bc3fbbb89e7d957d6</id>
<content type='text'>
The code to read the pack data using the offsets stored in the pack
idx file has been made more carefully check the validity of the
data in the idx.

* jk/pack-idx-corruption-safety:
  sha1_file.c: mark strings for translation
  use_pack: handle signed off_t overflow
  nth_packed_object_offset: bounds-check extended offset
  t5313: test bounds-checks of corrupted/malicious pack/idx files
</content>
</entry>
<entry>
<title>Merge branch 'jc/am-i-v-fix' into maint</title>
<updated>2016-03-10T19:13:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-03-10T19:13:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=28eec80b602559403cca96531dce2930ac362095'/>
<id>urn:sha1:28eec80b602559403cca96531dce2930ac362095</id>
<content type='text'>
The "v(iew)" subcommand of the interactive "git am -i" command was
broken in 2.6.0 timeframe when the command was rewritten in C.

* jc/am-i-v-fix:
  am -i: fix "v"iew
  pager: factor out a helper to prepare a child process to run the pager
  pager: lose a separate argv[]
</content>
</entry>
<entry>
<title>Merge branch 'ps/config-error' into maint</title>
<updated>2016-03-10T19:13:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-03-10T19:13:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2d5ff66c134681d846e5102a9a62ec99c2178fe1'/>
<id>urn:sha1:2d5ff66c134681d846e5102a9a62ec99c2178fe1</id>
<content type='text'>
Many codepaths forget to check return value from git_config_set();
the function is made to die() to make sure we do not proceed when
setting a configuration variable failed.

* ps/config-error:
  config: rename git_config_set_or_die to git_config_set
  config: rename git_config_set to git_config_set_gently
  compat: die when unable to set core.precomposeunicode
  sequencer: die on config error when saving replay opts
  init-db: die on config errors when initializing empty repo
  clone: die on config error in cmd_clone
  remote: die on config error when manipulating remotes
  remote: die on config error when setting/adding branches
  remote: die on config error when setting URL
  submodule--helper: die on config error when cloning module
  submodule: die on config error when linking modules
  branch: die on config error when editing branch description
  branch: die on config error when unsetting upstream
  branch: report errors in tracking branch setup
  config: introduce set_or_die wrappers
</content>
</entry>
<entry>
<title>nth_packed_object_offset: bounds-check extended offset</title>
<updated>2016-02-25T19:32:43Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-02-25T14:22:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=47fe3f6ef0f5a336db90d816c5fb4330ffa23668'/>
<id>urn:sha1:47fe3f6ef0f5a336db90d816c5fb4330ffa23668</id>
<content type='text'>
If a pack .idx file has a corrupted offset for an object, we
may try to access an offset in the .idx or .pack file that
is larger than the file's size.  For the .pack case, we have
use_pack() to protect us, which realizes the access is out
of bounds. But if the corrupted value asks us to look in the
.idx file's secondary 64-bit offset table, we blindly add it
to the mmap'd index data and access arbitrary memory.

We can fix this with a simple bounds-check compared to the
size we found when we opened the .idx file.

Note that there's similar code in index-pack that is
triggered only during "index-pack --verify". To support
both, we pull the bounds-check into a separate function,
which dies when it sees a corrupted file.

It would be nice if we could return an error, so that the
pack code could try to find a good copy of the object
elsewhere. Currently nth_packed_object_offset doesn't have
any way to return an error, but it could probably use "0" as
a sentinel value (since no object can start there). This is
the minimal fix, and we can improve the resilience later on
top.

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>Merge branch 'nd/ita-cleanup' into maint</title>
<updated>2016-02-22T21:10:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-22T21:10:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2bbea5c8f2242ee798e9bee525b485994a8e5911'/>
<id>urn:sha1:2bbea5c8f2242ee798e9bee525b485994a8e5911</id>
<content type='text'>
Paths that have been told the index about with "add -N" are not
quite yet in the index, but a few commands behaved as if they
already are in a harmful way.

* nd/ita-cleanup:
  grep: make it clear i-t-a entries are ignored
  add and use a convenience macro ce_intent_to_add()
  blame: remove obsolete comment
</content>
</entry>
<entry>
<title>config: rename git_config_set_or_die to git_config_set</title>
<updated>2016-02-22T18:23:55Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2016-02-22T11:23:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3d1806487af395fb33d1de92633e96571b296305'/>
<id>urn:sha1:3d1806487af395fb33d1de92633e96571b296305</id>
<content type='text'>
Rename git_config_set_or_die functions to git_config_set, leading
to the new default behavior of dying whenever a configuration
error occurs.

By now all callers that shall die on error have been transitioned
to the _or_die variants, thus making this patch a simple rename
of the functions.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>config: rename git_config_set to git_config_set_gently</title>
<updated>2016-02-22T18:23:55Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2016-02-22T11:23:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=30598ad06f2adfef1f74d6348677358865cbf373'/>
<id>urn:sha1:30598ad06f2adfef1f74d6348677358865cbf373</id>
<content type='text'>
The desired default behavior for `git_config_set` is to die
whenever an error occurs. Dying is the default for a lot of
internal functions when failures occur and is in this case the
right thing to do for most callers as otherwise we might run into
inconsistent repositories without noticing.

As some code may rely on the actual return values for
`git_config_set` we still require the ability to invoke these
functions without aborting. Rename the existing `git_config_set`
functions to `git_config_set_gently` to keep them available for
those callers.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pager: factor out a helper to prepare a child process to run the pager</title>
<updated>2016-02-17T17:19:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-16T22:34:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3e3a4a41b0dac564c0302ced4ccc423d0d39bc21'/>
<id>urn:sha1:3e3a4a41b0dac564c0302ced4ccc423d0d39bc21</id>
<content type='text'>
When running a pager, we need to run the program git_pager() gave
us, but we need to make sure we spawn it via the shell (i.e. it is
valid to say PAGER='less -S', for example) and give default values
to $LESS and $LV environment variables.  Factor out these details
to a separate helper function.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>config: introduce set_or_die wrappers</title>
<updated>2016-02-16T22:14:14Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2016-02-16T12:56:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b4c8aba659cb3264bcce3110d54bfcaab485408b'/>
<id>urn:sha1:b4c8aba659cb3264bcce3110d54bfcaab485408b</id>
<content type='text'>
A lot of call-sites for the existing family of `git_config_set`
functions do not check for errors that may occur, e.g. when the
configuration file is locked. In many cases we simply want to die
when such a situation arises.

Introduce wrappers that will cause the program to die in those
cases. These wrappers are temporary only to ease the transition
to let `git_config_set` die by default. They will be removed
later on when `git_config_set` itself has been replaced by
`git_config_set_gently`.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/ref-cache-non-repository-optim' into maint</title>
<updated>2016-02-05T22:54:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-05T22:54:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e2d7739051cadf25094c3fc7593b73b30c680696'/>
<id>urn:sha1:e2d7739051cadf25094c3fc7593b73b30c680696</id>
<content type='text'>
The underlying machinery used by "ls-files -o" and other commands
have been taught not to create empty submodule ref cache for a
directory that is not a submodule.  This removes a ton of wasted
CPU cycles.

* jk/ref-cache-non-repository-optim:
  resolve_gitlink_ref: ignore non-repository paths
  clean: make is_git_repository a public function
</content>
</entry>
</feed>
