<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/cache.h, branch v2.8.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.8.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.8.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-03-07T01:17:37Z</updated>
<entry>
<title>setup: make startup_info available everywhere</title>
<updated>2016-03-07T01:17:37Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-03-05T22:10:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=46c3cd44d7a1e8a33ad66c017ac9e3575cc88c00'/>
<id>urn:sha1:46c3cd44d7a1e8a33ad66c017ac9e3575cc88c00</id>
<content type='text'>
Commit a60645f (setup: remember whether repository was
found, 2010-08-05) introduced the startup_info structure,
which records some parts of the setup_git_directory()
process (notably, whether we actually found a repository or
not).

One of the uses of this data is for functions to behave
appropriately based on whether we are in a repo. But the
startup_info struct is just a pointer to storage provided by
the main program, and the only program that sets it up is
the git.c wrapper. Thus builtins have access to
startup_info, but externally linked programs do not.

Worse, library code which is accessible from both has to be
careful about accessing startup_info. This can be used to
trigger a die("BUG") via get_sha1():

	$ git fast-import &lt;&lt;-\EOF
	tag foo
	from HEAD:./whatever
	EOF

	fatal: BUG: startup_info struct is not initialized.

Obviously that's fairly nonsensical input to feed to
fast-import, but we should never hit a die("BUG"). And there
may be other ways to trigger it if other non-builtins
resolve sha1s.

So let's point the storage for startup_info to a static
variable in setup.c, making it available to all users of the
library code. We _could_ turn startup_info into a regular
extern struct, but doing so would mean tweaking all of the
existing use sites. So let's leave the pointer indirection
in place.  We can, however, drop any checks for NULL, as
they will always be false (and likewise, we can drop the
test covering this case, which was a rather artificial
situation using one of the test-* programs).

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 'jk/pack-idx-corruption-safety'</title>
<updated>2016-03-04T21:45:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-03-04T21:45:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=090de6b289ff2d9fc1c82ef85069bd6cba296d63'/>
<id>urn:sha1:090de6b289ff2d9fc1c82ef85069bd6cba296d63</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 'ps/config-error'</title>
<updated>2016-02-26T21:37:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-26T21:37:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=225caa73f25f8577a710f406b2670c3bcf0aef34'/>
<id>urn:sha1:225caa73f25f8577a710f406b2670c3bcf0aef34</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>Merge branch 'ls/config-origin'</title>
<updated>2016-02-26T21:37:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-26T21:37:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dd0f567f1041a3caea7856b3efe20f8fb9b487b5'/>
<id>urn:sha1:dd0f567f1041a3caea7856b3efe20f8fb9b487b5</id>
<content type='text'>
The configuration system has been taught to phrase where it found a
bad configuration variable in a better way in its error messages.
"git config" learnt a new "--show-origin" option to indicate where
the values come from.

* ls/config-origin:
  config: add '--show-origin' option to print the origin of a config value
  config: add 'origin_type' to config_source struct
  rename git_config_from_buf to git_config_from_mem
  t: do not hide Git's exit code in tests using 'nul_to_q'
</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 'jc/am-i-v-fix'</title>
<updated>2016-02-24T21:26:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-24T21:26:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c3b1e8d85133e2a19d372b7c166d5b49fcbbfef2'/>
<id>urn:sha1:c3b1e8d85133e2a19d372b7c166d5b49fcbbfef2</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>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>config: add 'origin_type' to config_source struct</title>
<updated>2016-02-22T17:36:33Z</updated>
<author>
<name>Lars Schneider</name>
<email>larsxschneider@gmail.com</email>
</author>
<published>2016-02-19T09:16:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=473166b99078a2724b4fcda11a6a5327b9af60da'/>
<id>urn:sha1:473166b99078a2724b4fcda11a6a5327b9af60da</id>
<content type='text'>
Use the config origin_type to print more detailed error messages that
inform the user about the origin of a config error (file, stdin, blob).

Helped-by: Ramsay Jones &lt;ramsay@ramsayjones.plus.com&gt;
Signed-off-by: Lars Schneider &lt;larsxschneider@gmail.com&gt;
Acked-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rename git_config_from_buf to git_config_from_mem</title>
<updated>2016-02-19T18:08:12Z</updated>
<author>
<name>Lars Schneider</name>
<email>larsxschneider@gmail.com</email>
</author>
<published>2016-02-19T09:16:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7454ee3c623a6788d91fd3c97af134de33996cfa'/>
<id>urn:sha1:7454ee3c623a6788d91fd3c97af134de33996cfa</id>
<content type='text'>
This matches the naming used in the index_{fd,mem,...} functions.

Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Lars Schneider &lt;larsxschneider@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
