lib/privsep.c


Log

Author Commit Date CI Message
Stefan Sperling baef4d75 2022-05-18T07:44:49 plug memory leak in an error path of got_privsep_recv_tree()
Stefan Sperling 13fcf1bf 2022-05-18T07:44:30 make got_privsep_recv_tree() reject trees with less than zero entries
Stefan Sperling 7429ae85 2022-05-18T07:43:45 rework logic in got_privsep_recv_tree() to avoid an ugly 'goto' no functional change
Stefan Sperling fae7e038 2022-05-07T11:50:56 run the search for deltas to reuse in got-read-pack This significantly speeds up the deltification step of packing by avoiding imsg traffic. gotadmin no longer requests individual raw deltas from got-read-pack to check whether it can reuse them. Instead, got-read-pack obtains a list of objects we want to pack, and hands back the list of all deltas in its pack file which can be reused. Messages are now batched such that imsg buffers are filled as much as possible. Another advantage is that deltas we are not going to reuse will no longer be written to the delta cache file, saving disk space. Before this patch, any raw delta candidate was written to the delta cache file by got-read-pack, and the decision whether to reuse the delta happened afterwards in the gotadmin process. Code for reading individual raw deltas is now unused and could be removed at some point. ok op@
Stefan Sperling 2d9e6abf 2022-05-04T13:43:24 store deltas in compressed form while packing, both in memory and cache file This reduces memory and disk space consumption during packing. with tweaks + memleak on error fix from op@ ok op@
Stefan Sperling d7b5a0e8 2022-04-20T14:00:12 inline struct got_object_id in struct got_object_qid Saves us from doing a malloc/free call for every item on the list. ok op@
Omar Polo e9ce266e 2022-03-07T22:26:08 add `got patch' command for applying unified diffs
Omar Polo 8934ea8b 2022-02-14T13:14:36 factorize imsg_clear calls after imsg_flush failures imsg_clear frees and closes resources allocated as part of enqueueing imsgs so it's a no-op after reads. discussed with and ok stsp@
Stefan Sperling 67fd6849 2022-02-13T00:10:25 reuse existing deltas when creating pack files tested by thomas, naddy, and myself
Stefan Sperling 8264d9ee 2022-01-27T12:05:24 fix wrong imsg name in errors raised by got_privsep_send_tree_req()
Stefan Sperling 9296b03b 2022-01-26T10:33:52 remove unnecessary local variable from got_privsep_get_imsg_obj()
Stefan Sperling d1b988e3 2022-01-26T10:33:52 add missing initialization of delta list in got_privsep_get_imsg_obj()
Stefan Sperling 4a55b231 2021-12-09T16:10:25 ignore the return value of closefrom(2); patch by Anna a.k.a. CyberTailor millert@ suggests that this check is not needed, and that ideally we should be using close-on-exec instead. I will look into this, but in the meantime this change will help -portable: https://bugs.gentoo.org/828003
Christian Weisgerber abc59930 2021-09-05T19:41:03 indentation fixes
Stefan Sperling 6480c871 2021-08-30T15:51:23 provide separate send {} and fetch {} configuration blocks in got.conf Feature requested by naddy. ok naddy, who also suggested some tweaks that will arrive shortly
Stefan Sperling f8a36e22 2021-08-26T12:30:42 add 'got send' command for sending changes to remote repositories Known to work against git-daemon and github Git server implementations. Tests by abieber, naddy, jrick, and myself. Man page additions reviewed by Lucas.
Stefan Sperling c3564dfa 2021-07-15T07:48:40 don't scan pack index offsets for large values if pack file is < 2GB This saves an iteration over the entire h->offsets array when opening a pack index which should not contain large offsets in the first place. ok millert@
Stefan Sperling d5c81d44 2021-07-08T11:03:29 verify object ID checksums while loose objects are being accessed
Christian Weisgerber dbdddfee 2021-06-23T20:48:35 switch from SIMPLEQ to equivalent STAILQ macros The singly-linked tail queue macros were added to OpenBSD 6.9 and are more widely available on other systems. ok stsp
Stefan Sperling a8591711 2021-06-18T13:52:26 raw object size should not include the length of the object's header This way, the size of a raw object is the same regardless of whether the object was found in a loose object file or in a pack file.
Stefan Sperling 932dbee7 2021-05-19T13:58:22 fix wrong function name in error message; pointed out by Mikolaj Kucharski
Stefan Sperling a486b62b 2021-05-18T13:17:12 ignore SIGWINCH while polling in the main process Avoids an error where tog(1) would exit with "poll: Interrupted system call" while the terminal window was being resized. ok millert
Stefan Sperling 59d1e4a0 2021-03-10T22:49:22 implement raw object data access; this will be required for packing
Stefan Sperling 08578a35 2021-01-22T11:05:05 make close(2) failure checks consistent; check 'close() == -1' everywhere ok millert, naddy
Stefan Sperling 99495ddb 2021-01-10T23:48:51 add a 'reference' directive to remote repositories in got.conf(5) Make use of this in 'got clone' to persist -R option arguments given on the command line in the cloned repository's got.conf(5) file.
Stefan Sperling 0c8b29c5 2021-01-05T17:22:14 add a 'fetch-all-branches' configuration setting to got.conf(5) Set fetch-all-branches in the got.conf(5) file created by 'got clone -a' in order to make a future 'got fetch' act like 'got fetch -a' by default.
Stefan Sperling 16aeacf7 2020-11-26T12:54:19 use size_t for loop indices to avoid signedness warnings; from emaste@freebsd
Stefan Sperling 20b7abb3 2020-10-22T20:36:23 detect unknown repository format extensions (such as sha256 format) ok millert
Christian Weisgerber 62d463ca 2020-10-20T22:43:59 indentation fixes
Stefan Sperling b8adfa55 2020-09-25T21:35:10 add "branch" keyword to got.conf which specifies a list of branches to fetch ok tracey
Stefan Sperling 6c13dcd2 2020-09-18T18:24:09 send gitconfig imsg string values the same way as gotconfig ones are sent
Stefan Sperling 5874ea87 2020-09-18T17:58:10 follow-up to be96c417: Do not assume a \0 when receiving GOTCONFIG_STR_VAL.
Christian Weisgerber 23c57b28 2020-09-11T19:44:18 Stop including <sys/syslimits.h> directly. POSIX says the limits defined there are available from <limits.h>, which almost all affected source files already included anyway. ok millert stsp
Stefan Sperling 3168e5da 2020-09-10T00:10:55 zap trailing tabs
Stefan Sperling 257add31 2020-09-09T23:57:40 add got.conf(5) configuration file ok tracey
Christian Weisgerber 81a12da5 2020-09-09T19:35:32 do not rely on <zlib.h> to pull in <unistd.h> ok stsp
Stefan Sperling d6b7d054 2020-08-27T10:06:18 exit the loop in got_privsep_recv_tree() upon error found while looking over tracey's scan-build results
Stefan Sperling fca1f6ad 2020-08-27T10:05:38 plug a memory leak in got_privsep_recv_tree() in error case found while looking over tracey's scan-build results
Stefan Sperling 1d72a2a0 2020-03-24T14:08:03 represent packfile hash as byte array in the privsep layer, not as object ID
Stefan Sperling fd251256 2020-03-24T14:07:58 rename an argument of got_privsep_send_index_pack_req() for clarity
Stefan Sperling e70bf110 2020-03-22T17:20:18 move functions from privsep.c to the helpers which use them where possible
Stefan Sperling 0e4002ca 2020-03-21T21:49:13 add support for fetching arbitrary references to 'got clone' and 'got fetch'
Stefan Sperling 2690194b 2020-03-21T18:17:12 remove GOT_FETCH_DEBUG and toggle fetch debug output with -v option instead
Stefan Sperling 41b0de12 2020-03-21T10:18:15 add support for listing remote branches and tags to 'got clone' and 'got fetch'
Stefan Sperling 4ba14133 2020-03-20T20:23:18 add support for fetching specific branches to 'got clone' and 'got fetch'
Stefan Sperling 5146eb39 2020-03-20T20:23:18 fix allocation size in got_privsep_recv_gitconfig_remotes(); found by free(3)
Stefan Sperling fe6043b8 2020-03-20T19:03:29 transmit the 'mirror' flag correctly in got_privsep_send_gitconfig_remotes()
Stefan Sperling 659e7fbd 2020-03-20T15:55:08 fetch only HEAD branch and tags by default; add -a option to fetch everything
Stefan Sperling 58e1925a 2020-03-20T13:32:07 fix wrong sizeof in got_privsep_send_fetch_req()
Stefan Sperling 469dd726 2020-03-20T11:44:14 add support for repository mirrors to 'got clone' and 'got fetch'
Stefan Sperling b364b1c2 2020-03-20T11:22:35 fix typos in error messages
Stefan Sperling 7848a0e1 2020-03-19T16:57:27 implement 'got fetch'
Stefan Sperling 5a489642 2020-03-19T16:56:51 initialize pack file size output paramter of got_privsep_recv_fetch_progress()
Stefan Sperling ee448f5f 2020-03-18T16:13:47 apply unveil(2) to 'got clone'
Stefan Sperling f826addf 2020-03-18T16:13:45 use a dedicated imsg for sending the pack fetch output file descriptor
Stefan Sperling 73ab1060 2020-03-18T16:13:45 use a dedicated imsg for sending the pack index output file descriptor
Stefan Sperling 668a20f6 2020-03-18T16:13:41 rewritten got-index-pack; sorry about the monster commit
Stefan Sperling baa9fea0 2020-03-18T16:11:33 send indexing progress via an imsg
Stefan Sperling d2cdc636 2020-03-18T16:11:32 send pack file download progress information over imsg
Stefan Sperling ea7396b9 2020-03-18T16:11:32 rename imsg FETCH_PROGRESS to FETCH_REF
Stefan Sperling 531c3985 2020-03-18T16:11:32 add support for git protocol sidebands and display server progress
Stefan Sperling 33501562 2020-03-18T16:11:30 prepare for providing refs we already have in fetch request imsg currently we always send and expect an empty list
Stefan Sperling abe0f35f 2020-03-18T16:10:33 parse symrefs from server capabilities and transmit them over imsg
Stefan Sperling 8f2d01a6 2020-03-18T16:10:32 send fetch progress over imsg
Stefan Sperling b887aab6 2020-03-18T16:10:32 plug leaks in error path of got_privsep_recv_fetch_progress()
Stefan Sperling b9f99abf 2020-03-18T16:10:32 add imsg for fetch progress reporting; for now only contains reference info
Stefan Sperling afa77e03 2020-03-18T16:10:31 actually create a pack and an index in the right place
Stefan Sperling 279090e1 2020-03-18T16:10:31 pass an object_id * to got_privsep_send_index_pack_req()
Stefan Sperling a251e40e 2020-03-18T16:10:31 GOT_IMSG_ACK isn't needed; just fill the pipe, reading responses will block
Stefan Sperling 93658fb9 2020-03-18T16:10:30 Add initial support for network protocol. Ported from git9 by Ori Bernstein.
Stefan Sperling 54b1c5b5 2020-02-22T12:37:58 don't proceed if a bad imsg is received in recv_gitconfig_remotes()
Stefan Sperling d669b9c9 2020-02-22T12:37:12 fix uninitialized variablen recv_gitconfig_remotes; found by sthen@ with gcc8
Stefan Sperling 9a1cc63f 2020-02-03T09:18:40 read repository owner name with gitconfig parser instead of a hand-rolled one
Stefan Sperling ca6e02ac 2020-01-07T11:14:52 add support for first-parent history traversal to got-read-pack
Stefan Sperling 5aa81393 2020-01-06T19:38:23 add copyright year for files already touched in 2020
Stefan Sperling cbfaaf20 2020-01-06T12:15:54 add missing check for errors from imsg_get()
Stefan Sperling cd95becd 2019-11-29T02:46:04 parse remotes from gitconfig
Stefan Sperling 56e0773d 2019-11-28T02:32:58 convert tree entries from SIMPLEQ to an array
Stefan Sperling cd9e913a 2019-11-27T01:34:30 pre-allocate the correct amount of memory in got_privsep_send_tree()
Stefan Sperling 3b647085 2019-11-23T21:03:29 plug leaks in error paths of got_privsep_send_tree()
Stefan Sperling 7f358e3b 2019-11-23T21:03:29 eliminate redundant memcpy in got_privsep_send_tree_req()
Stefan Sperling 3022d272 2019-11-14T17:12:32 reduce the amount of memcpy() and strdup() while parsing tree entries
Stefan Sperling aa6c0b51 2019-09-22T10:35:16 remove unused variable in got_privsep_recv_obj() (patch by Steven McDonald)
Stefan Sperling aba9c984 2019-09-08T17:14:34 obtain repo format version and commit author name/email from .git/config
Stefan Sperling c39c25dd 2019-08-09T14:35:32 improve error message if helper binaries fail to unveil(2)
Stefan Sperling 638f9024 2019-05-13T12:40:57 rename got_error_prefix_errno() to got_error_from_errno()
joshua stein 656b1f76 2019-05-11T14:26:12 while (1) -> for (;;)
joshua stein 230a42bd 2019-05-11T13:04:38 got_error_from_errno -> got_error_prefix_errno also add got_error_prefix_errno2 and got_error_prefix_errno3 which should hopefully all be merged into a single function with variadic args (but can't alloc mem)
Stefan Sperling 2cb49fa8 2019-05-10T19:41:58 revert eb73a30f7effc51c1cfee2864102635e3659f87a Not waiting for children can make us blow the fork() ulimit with lingering zombies; the Ctrl-C issue will need some other fix.
Stefan Sperling eb73a30f 2019-03-07T13:00:23 do not deadlock in waitpid() when user hits Ctrl-C
Stefan Sperling 41496140 2019-02-21T15:17:36 prevent double-close(2) of file descriptors passed in imsg
Stefan Sperling 5d56da81 2019-01-13T17:15:53 happy new copyright year
Stefan Sperling ac544f8c 2019-01-13T15:58:39 pass smallish blobs directly via imsg buffer
Stefan Sperling 63219cd2 2019-01-04T17:25:09 use unveil(2) in 'got checkout'
Stefan Sperling a7403916 2018-12-24T14:33:38 wrap overlong line
Stefan Sperling aea5f015 2018-12-24T14:29:50 drop dead code from got_privsep_send_obj_req()
Stefan Sperling ebc55e2d 2018-12-24T14:18:56 eliminate got_object_open() round-trip when opening blobs
Stefan Sperling 268f7291 2018-12-24T11:18:58 eliminate got_object_open() round-trip when opening tags
Stefan Sperling 13c729f7 2018-12-24T09:35:07 eliminate got_object_open() round-trip when opening trees
Stefan Sperling 1785f84a 2018-12-23T23:15:42 eliminate got_object_open() round-trip when opening commits