summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* online tests: update auth for bitbucket testethomson/bitbucketEdward Thomson2018-03-201-1/+1
| | | | | Update the settings to use a specific read-only token for accessing our test repositories in Bitbucket.
* Merge pull request #4563 from libgit2/ethomson/ssh-unescapev0.27.0-rc3Edward Thomson2018-03-206-64/+163
|\ | | | | Refactor `gitno_extract_url_parts`
| * buf: add tests for percent decodingethomson/ssh-unescapeEdward Thomson2018-03-191-0/+49
| |
| * gitno_extract_url_parts: decode hostnamesEdward Thomson2018-03-191-1/+1
| | | | | | | | | | RFC 3986 says that hostnames can be percent encoded. Percent decode hostnames in our URLs.
| * Remove now unnecessary `gitno_unescape`Edward Thomson2018-03-192-20/+0
| |
| * gitno_extract_url_parts: use `git_buf`sEdward Thomson2018-03-191-42/+73
| | | | | | | | | | Now that we can decode percent-encoded strings as part of `git_buf`s, use that decoder in `gitno_extract_url_parts`.
| * ssh urls: use `git_buf_decode_percent`Edward Thomson2018-03-191-8/+6
| | | | | | | | | | Use `git_buf_decode_percent` so that we can avoid allocating a temporary buffer.
| * Introduce `git_buf_decode_percent`Edward Thomson2018-03-192-1/+34
| | | | | | | | | | Introduce a function to take a percent-encoded string (URI encoded, described by RFC 1738) and decode it into a `git_buf`.
| * Update testsSteven King Jr2018-03-191-0/+2
| |
| * Unescape repo before constructing ssh requestSteven King Jr2018-03-191-1/+5
| |
| * Rename unescape and make non-staticSteven King Jr2018-03-192-3/+5
|/
* Merge pull request #4584 from libgit2/ethomson/bitbucketEdward Thomson2018-03-191-4/+34
|\ | | | | online::clone: skip creds fallback test
| * online::clone: skip creds fallback testEdward Thomson2018-03-191-4/+34
|/ | | | | | | | | | | | At present, we have three online tests against bitbucket: one which specifies the credentials in the payload, one which specifies the correct credentials in the URL and a final one that specifies the incorrect credentials in the URL. Bitbucket has begun responding to the latter test with a 403, which causes us to fail. Break these three tests into separate tests so that we can skip the latter until this is resolved on Bitbucket's end or until we can change the test to a different provider.
* Merge pull request #4544 from josharian/docsPatrick Steinhardt2018-03-131-18/+35
|\ | | | | pathspec: improve git_pathspec_flag_t doc rendering
| * pathspec: improve git_pathspec_flag_t doc renderingJosh Bleecher Snyder2018-02-231-18/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | By placing docs per enum value rather than in a large block, the automated doc generation tool can make nicer docs, as could other automated tools, such as the mooted https://github.com/libgit2/git2go/issues/427. The current rendering is somewhat ugly: https://libgit2.github.com/libgit2/#HEAD/type/git_pathspec_flag_t No textual changes, just reorganization.
* | Merge pull request #4575 from pks-t/pks/index-secfixes-masterEdward Thomson2018-03-121-18/+27
|\ \ | | | | | | Index parsing fixes
| * | index: error out on unreasonable prefix-compressed path lengthsPatrick Steinhardt2018-03-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When computing the complete path length from the encoded prefix-compressed path, we end up just allocating the complete path without ever checking what the encoded path length actually is. This can easily lead to a denial of service by just encoding an unreasonable long path name inside of the index. Git already enforces a maximum path length of 4096 bytes. As we also have that enforcement ready in some places, just make sure that the resulting path is smaller than GIT_PATH_MAX. Reported-by: Krishna Ram Prakash R <krp@gtux.in> Reported-by: Vivek Parikh <viv0411.parikh@gmail.com>
| * | index: fix out-of-bounds read with invalid index entry prefix lengthPatrick Steinhardt2018-03-101-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The index format in version 4 has prefix-compressed entries, where every index entry can compress its path by using a path prefix of the previous entry. Since implmenting support for this index format version in commit 5625d86b9 (index: support index v4, 2016-05-17), though, we do not correctly verify that the prefix length that we want to reuse is actually smaller or equal to the amount of characters than the length of the previous index entry's path. This can lead to a an integer underflow and subsequently to an out-of-bounds read. Fix this by verifying that the prefix is actually smaller than the previous entry's path length. Reported-by: Krishna Ram Prakash R <krp@gtux.in> Reported-by: Vivek Parikh <viv0411.parikh@gmail.com>
| * | index: convert `read_entry` to return entry size via an out-paramPatrick Steinhardt2018-03-101-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function `read_entry` does not conform to our usual coding style of returning stuff via the out parameter and to use the return value for reporting errors. Due to most of our code conforming to that pattern, it has become quite natural for us to actually return `-1` in case there is any error, which has also slipped in with commit 5625d86b9 (index: support index v4, 2016-05-17). As the function returns an `size_t` only, though, the return value is wrapped around, causing the caller of `read_tree` to continue with an invalid index entry. Ultimately, this can lead to a double-free. Improve code and fix the bug by converting the function to return the index entry size via an out parameter and only using the return value to indicate errors. Reported-by: Krishna Ram Prakash R <krp@gtux.in> Reported-by: Vivek Parikh <viv0411.parikh@gmail.com>
* | | Merge pull request #4396 from libgit2/cmn/config-regex-is-normalisedEdward Thomson2018-03-121-2/+26
|\ \ \ | |/ / |/| | config: specify how we match the regular expressions
| * | config: explicitly state that subsections are case-sensitivecmn/config-regex-is-normalisedCarlos Martín Nieto2018-03-111-6/+11
| | |
| * | config: specify how we match the regular expressionsCarlos Martín Nieto2017-11-181-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | We do it the same as git does: case-sensitively on the normalized form of the variable name. While here also specify that we're case-sensitive on the values when handling the values when setting or deleting multivars.
* | | Merge pull request #4571 from jacquesg/overflowPatrick Steinhardt2018-03-082-3/+4
|\ \ \ | | | | | | | | Integer overflow
| * | | cmake: enable shift count overflow warningJacques Germishuys2018-03-081-0/+1
| | | |
| * | | diff: ensure an unsigned number is shiftedJacques Germishuys2018-03-081-3/+3
|/ / /
* | | Merge pull request #4567 from pks-t/pks/zlib-updateEdward Thomson2018-03-0715-724/+1816
|\ \ \ | | | | | | | | deps: upgrade embedded zlib to version 1.2.11
| * | | deps: upgrade embedded zlib to version 1.2.11Patrick Steinhardt2018-03-0715-724/+1816
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current version of zlib bundled with libgit2 is version 1.2.8. This version has several CVEs assigned: - CVE-2016-9843 - CVE-2016-9841 - CVE-2016-9842 - CVE-2016-9840 Upgrade the bundled version to the current release 1.2.11, which has these vulnerabilities fixes.
* | | Merge pull request #4541 from libgit2/cmn/odb-streaming-read-changelogEdward Thomson2018-03-041-0/+4
|\ \ \ | | | | | | | | CHANGELOG: mention the change to `git_odb_open_rstream`
| * | | CHANGELOG: mention the change to `git_odb_open_rstream`cmn/odb-streaming-read-changelogCarlos Martín Nieto2018-03-021-0/+4
| | |/ | |/|
* | | Merge pull request #4559 from jacquesg/worktree-constEdward Thomson2018-03-042-4/+4
|\ \ \ | | | | | | | | Worktree lock reason should be const
| * | | worktree: rename parameter creason to reasonJacques Germishuys2018-03-031-3/+3
| | | |
| * | | worktree: lock reason should be constJacques Germishuys2018-03-022-2/+2
|/ / /
* | | Merge pull request #4552 from libgit2/cmn/config-header-commonPatrick Steinhardt2018-02-281-8/+10
|\ \ \ | | | | | | | | Cast less blindly between configuration objects
| * | | config: return an error if config_refresh is called on a snapshotcmn/config-header-commonCarlos Martín Nieto2018-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Instead of treating it as a no-op, treat it as a programming error and return the same kind of error as if you called to set or delete variables on a snapshot.
| * | | config: harden our use of the backend objects a bitCarlos Martín Nieto2018-02-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we create an iterator we don't actually know that we have a live config object and we must instead only rely on the header. We fixed it to use this in a previous commit, but this makes it harder to misuse by converting to use the header object in the typecast. We also guard inside the `config_refresh` function against being given a snapshot (although callers right now do check).
| * | | config: move the level field into the headerCarlos Martín Nieto2018-02-281-5/+4
| | | | | | | | | | | | | | | | | | | | We use it in a few places where we might have a full object or a snapshot so move it to where we can actually access it.
| * | | config: move the repository to the diskfile headerCarlos Martín Nieto2018-02-281-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We pass this around and when creating a new iterator we need to read the repository pointer. Put it in a common place so we can reach it regardless of whether we got a full object or a snapshot.
* | | | Merge pull request #4554 from pks-t/pks/curl-initEdward Thomson2018-02-283-2/+23
|\ \ \ \ | | | | | | | | | | curl: initialize and cleanup global curl state
| * | | | curl: explicitly initialize and cleanup global curl statePatrick Steinhardt2018-02-283-2/+23
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our curl-based streams make use of the easy curl interface. This interface automatically initializes and de-initializes the global curl state by calling out to `curl_global_init` and `curl_global_cleanup`. Thus, all global state will be repeatedly re-initialized when creating multiple curl streams in succession. Despite being inefficient, this is not thread-safe due to `curl_global_init` being not thread-safe itself. Thus a multi-threaded programing handling multiple curl streams at the same time is inherently racy. Fix the issue by globally initializing and cleaning up curl's state.
* | | | Merge pull request #4553 from libgit2/cmn/tree-write-initialisePatrick Steinhardt2018-02-281-0/+1
|\ \ \ \ | | | | | | | | | | tree: initialize the id we use for testing submodule insertions
| * | | | tree: initialize the id we use for testing submodule insertionscmn/tree-write-initialiseCarlos Martín Nieto2018-02-281-0/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | Instead of laving it uninitialized and relying on luck for it to be non-zero, let's give it a dummy hash so we make valgrind happy (in this case the hash comes from `sha1sum </dev/null`.
* | | | Merge pull request #4555 from libgit2/ethomson/strncmp_stdcallPatrick Steinhardt2018-02-281-1/+1
|\ \ \ \ | |/ / / |/| | | win32: strncmp -> git__strncmp for win32 STDCALL
| * | | win32: strncmp -> git__strncmpethomson/strncmp_stdcallEdward Thomson2018-02-281-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | The win32 C library is compiled cdecl, however when configured with `STDCALL=ON`, our functions (and function pointers) will use the stdcall calling convention. You cannot set a `__stdcall` function pointer to a `__cdecl` function, so it's easier to just use our `git__strncmp` instead of sorting that mess out.
* | | Merge pull request #4545 from libgit2/ethomson/checkout_filemodev0.27.0-rc2Edward Thomson2018-02-278-17/+112
|\ \ \ | | | | | | | | Respect core.filemode in checkout
| * | | checkout: respect core.filemode when comparing filemodesethomson/checkout_filemodeEdward Thomson2018-02-231-13/+21
| | | | | | | | | | | | | | | | Fixes #4504
| * | | checkout test: ensure workdir mode is simplifiedEdward Thomson2018-02-231-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that when examining the working directory for checkout that the mode is correctly simplified. Git only pays attention to whether a file is executable or not. When examining a working directory, we should coalesce modes in the working directory to either `0755` (indicating that a file is executable) or `0644` (indicating that it is not). Test this by giving the file an exotic mode, and ensuring that when checkout out a branch that changes the file's contents, that we do not have a checkout conflict.
| * | | checkout test: add core.filemode checkout testsEdward Thomson2018-02-231-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add two tests for filemode. The first ensures that `core.filemode=true` is honored: if we have changed the filemode such that a file that _was_ executable (mode 0755) is now executable (mode 0644) and we go to check out a branch that has otherwise changed the contents of the file, then we should raise a checkout conflict for that file. The second ensures that `core.filemode=false` is honored: in the same situation, we set a file that was executable to be non-executable, and check out the branch that changes the contents of the file. However, since `core.filemode` is false, we do not detect the filemode change. We run these tests on both operating systems that obey `core.filemode` (eg, POSIX) and those that have no conception of filemode (eg, Win32). This ensures that `core.filemode` is always honored, as it is a cache of the underlying filesystem's settings. This ensures that we do not make assumptions based on the operating system, and honor the configuration setting even if it were misconfigured.
| * | | testrepo: add new branchEdward Thomson2018-02-236-4/+8
| |/ / | | | | | | | | | | | | | | | Add a new branch to the `testrepo` repository, where the `README` file has changed to executable. This branch enables typechange tests between the new `executable` branch and `master`.
* | | Merge pull request #4550 from libgit2/ethomson/winhttpEdward Thomson2018-02-272-4/+28
|\ \ \ | | | | | | | | winhttp: enable TLS 1.2
| * | | winhttp: enable TLS 1.2 on Windows 7 and earlierethomson/winhttpEdward Thomson2018-02-271-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Versions of Windows prior to Windows 8 do not enable TLS 1.2 by default, though support may exist. Try to enable TLS 1.2 support explicitly on connections. This request may fail if the operating system does not have TLS 1.2 support - the initial release of Vista lacks TLS 1.2 support (though it is available as a software update) and XP completely lacks TLS 1.2 support. If this request does fail, the HTTP context is still valid, and still maintains the original protocol support. So we ignore the failure from this operation.