Blob


1 /*
2 * Copyright (c) 2018, 2019 Stefan Sperling <stsp@openbsd.org>
3 * Copyright (c) 2019, Ori Bernstein <ori@openbsd.org>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
18 /*
19 * All code runs under the same UID but sensitive code paths are
20 * run in a separate process with tighter pledge(2) promises.
21 * Data is communicated between processes via imsg_flush(3) and imsg_read(3).
22 * This behaviour is transparent to users of the library.
23 *
24 * We generally transmit data in imsg buffers, split across several messages
25 * if necessary. File descriptors are used in cases where this is impractical,
26 * such as when accessing pack files or when transferring large blobs.
27 *
28 * We exec(2) after a fork(2). Parts of our library functionality are
29 * accessible via separate executables in a libexec directory.
30 */
32 #define GOT_IMSG_FD_CHILD (STDERR_FILENO + 1)
34 #ifndef GOT_LIBEXECDIR
35 #define GOT_LIBEXECDIR /usr/libexec
36 #endif
38 /* Names of helper programs in libexec directory */
39 #define GOT_PROG_READ_OBJECT got-read-object
40 #define GOT_PROG_READ_TREE got-read-tree
41 #define GOT_PROG_READ_COMMIT got-read-commit
42 #define GOT_PROG_READ_BLOB got-read-blob
43 #define GOT_PROG_READ_TAG got-read-tag
44 #define GOT_PROG_READ_PACK got-read-pack
45 #define GOT_PROG_READ_GITCONFIG got-read-gitconfig
46 #define GOT_PROG_READ_GOTCONFIG got-read-gotconfig
47 #define GOT_PROG_FETCH_PACK got-fetch-pack
48 #define GOT_PROG_INDEX_PACK got-index-pack
49 #define GOT_PROG_SEND_PACK got-send-pack
51 #define GOT_STRINGIFY(x) #x
52 #define GOT_STRINGVAL(x) GOT_STRINGIFY(x)
54 /* Paths to helper programs in libexec directory */
55 #define GOT_PATH_PROG_READ_OBJECT \
56 GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_OBJECT)
57 #define GOT_PATH_PROG_READ_TREE \
58 GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_TREE)
59 #define GOT_PATH_PROG_READ_COMMIT \
60 GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_COMMIT)
61 #define GOT_PATH_PROG_READ_BLOB \
62 GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_BLOB)
63 #define GOT_PATH_PROG_READ_TAG \
64 GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_TAG)
65 #define GOT_PATH_PROG_READ_PACK \
66 GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_PACK)
67 #define GOT_PATH_PROG_READ_GITCONFIG \
68 GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_GITCONFIG)
69 #define GOT_PATH_PROG_READ_GOTCONFIG \
70 GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_GOTCONFIG)
71 #define GOT_PATH_PROG_FETCH_PACK \
72 GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_FETCH_PACK)
73 #define GOT_PATH_PROG_SEND_PACK \
74 GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_SEND_PACK)
75 #define GOT_PATH_PROG_INDEX_PACK \
76 GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_INDEX_PACK)
78 struct got_privsep_child {
79 int imsg_fd;
80 pid_t pid;
81 struct imsgbuf *ibuf;
82 };
84 enum got_imsg_type {
85 /* An error occured while processing a request. */
86 GOT_IMSG_ERROR,
88 /* Stop the child process. */
89 GOT_IMSG_STOP,
91 /*
92 * Messages concerned with read access to objects in a repository.
93 * Object and pack files are opened by the main process, where
94 * data may be read as a byte string but without any interpretation.
95 * Decompression and parsing of object and pack files occurs in a
96 * separate process which runs under pledge("stdio recvfd").
97 * This sandboxes our own repository parsing code, as well as zlib.
98 */
99 GOT_IMSG_OBJECT_REQUEST,
100 GOT_IMSG_OBJECT,
101 GOT_IMSG_COMMIT_REQUEST,
102 GOT_IMSG_COMMIT,
103 GOT_IMSG_COMMIT_LOGMSG,
104 GOT_IMSG_TREE_REQUEST,
105 GOT_IMSG_TREE,
106 GOT_IMSG_TREE_ENTRY,
107 GOT_IMSG_BLOB_REQUEST,
108 GOT_IMSG_BLOB_OUTFD,
109 GOT_IMSG_BLOB,
110 GOT_IMSG_TAG_REQUEST,
111 GOT_IMSG_TAG,
112 GOT_IMSG_TAG_TAGMSG,
114 /* Messages related to networking. */
115 GOT_IMSG_FETCH_REQUEST,
116 GOT_IMSG_FETCH_HAVE_REF,
117 GOT_IMSG_FETCH_WANTED_BRANCH,
118 GOT_IMSG_FETCH_WANTED_REF,
119 GOT_IMSG_FETCH_OUTFD,
120 GOT_IMSG_FETCH_SYMREFS,
121 GOT_IMSG_FETCH_REF,
122 GOT_IMSG_FETCH_SERVER_PROGRESS,
123 GOT_IMSG_FETCH_DOWNLOAD_PROGRESS,
124 GOT_IMSG_FETCH_DONE,
125 GOT_IMSG_IDXPACK_REQUEST,
126 GOT_IMSG_IDXPACK_OUTFD,
127 GOT_IMSG_IDXPACK_PROGRESS,
128 GOT_IMSG_IDXPACK_DONE,
130 /* Messages related to pack files. */
131 GOT_IMSG_PACKIDX,
132 GOT_IMSG_PACK,
133 GOT_IMSG_PACKED_OBJECT_REQUEST,
134 GOT_IMSG_COMMIT_TRAVERSAL_REQUEST,
135 GOT_IMSG_TRAVERSED_COMMITS,
136 GOT_IMSG_COMMIT_TRAVERSAL_DONE,
138 /* Message sending file descriptor to a temporary file. */
139 GOT_IMSG_TMPFD,
141 /* Messages related to gitconfig files. */
142 GOT_IMSG_GITCONFIG_PARSE_REQUEST,
143 GOT_IMSG_GITCONFIG_REPOSITORY_FORMAT_VERSION_REQUEST,
144 GOT_IMSG_GITCONFIG_REPOSITORY_EXTENSIONS_REQUEST,
145 GOT_IMSG_GITCONFIG_AUTHOR_NAME_REQUEST,
146 GOT_IMSG_GITCONFIG_AUTHOR_EMAIL_REQUEST,
147 GOT_IMSG_GITCONFIG_REMOTES_REQUEST,
148 GOT_IMSG_GITCONFIG_INT_VAL,
149 GOT_IMSG_GITCONFIG_STR_VAL,
150 GOT_IMSG_GITCONFIG_REMOTES,
151 GOT_IMSG_GITCONFIG_REMOTE,
152 GOT_IMSG_GITCONFIG_OWNER_REQUEST,
153 GOT_IMSG_GITCONFIG_OWNER,
155 /* Messages related to gotconfig files. */
156 GOT_IMSG_GOTCONFIG_PARSE_REQUEST,
157 GOT_IMSG_GOTCONFIG_AUTHOR_REQUEST,
158 GOT_IMSG_GOTCONFIG_REMOTES_REQUEST,
159 GOT_IMSG_GOTCONFIG_INT_VAL,
160 GOT_IMSG_GOTCONFIG_STR_VAL,
161 GOT_IMSG_GOTCONFIG_REMOTES,
162 GOT_IMSG_GOTCONFIG_REMOTE,
164 /* Raw object access. Uncompress object data but do not parse it. */
165 GOT_IMSG_RAW_OBJECT_REQUEST,
166 GOT_IMSG_RAW_OBJECT_OUTFD,
167 GOT_IMSG_PACKED_RAW_OBJECT_REQUEST,
168 GOT_IMSG_RAW_OBJECT,
169 };
171 /* Structure for GOT_IMSG_ERROR. */
172 struct got_imsg_error {
173 int code; /* an error code from got_error.h */
174 int errno_code; /* in case code equals GOT_ERR_ERRNO */
175 } __attribute__((__packed__));
177 /*
178 * Structure for GOT_IMSG_TREE_REQUEST and GOT_IMSG_OBJECT data.
179 */
180 struct got_imsg_object {
181 uint8_t id[SHA1_DIGEST_LENGTH];
183 /* These fields are the same as in struct got_object. */
184 int type;
185 int flags;
186 size_t hdrlen;
187 size_t size;
188 off_t pack_offset;
189 int pack_idx;
190 } __attribute__((__packed__));
192 /* Structure for GOT_IMSG_COMMIT data. */
193 struct got_imsg_commit_object {
194 uint8_t tree_id[SHA1_DIGEST_LENGTH];
195 size_t author_len;
196 time_t author_time;
197 time_t author_gmtoff;
198 size_t committer_len;
199 time_t committer_time;
200 time_t committer_gmtoff;
201 size_t logmsg_len;
202 int nparents;
204 /*
205 * Followed by author_len + committer_len data bytes
206 */
208 /* Followed by 'nparents' SHA1_DIGEST_LENGTH length strings */
210 /*
211 * Followed by 'logmsg_len' bytes of commit log message data in
212 * one or more GOT_IMSG_COMMIT_LOGMSG messages.
213 */
214 } __attribute__((__packed__));
217 /* Structure for GOT_IMSG_TREE_ENTRY. */
218 struct got_imsg_tree_entry {
219 char id[SHA1_DIGEST_LENGTH];
220 mode_t mode;
221 /* Followed by entry's name in remaining data of imsg buffer. */
222 } __attribute__((__packed__));
224 /* Structure for GOT_IMSG_TREE_OBJECT_REPLY data. */
225 struct got_imsg_tree_object {
226 int nentries; /* This many TREE_ENTRY messages follow. */
227 };
229 /* Structure for GOT_IMSG_BLOB. */
230 struct got_imsg_blob {
231 size_t size;
232 size_t hdrlen;
234 /*
235 * If size <= GOT_PRIVSEP_INLINE_BLOB_DATA_MAX, blob data follows
236 * in the imsg buffer. Otherwise, blob data has been written to a
237 * file descriptor passed via the GOT_IMSG_BLOB_OUTFD imsg.
238 */
239 #define GOT_PRIVSEP_INLINE_BLOB_DATA_MAX \
240 (MAX_IMSGSIZE - IMSG_HEADER_SIZE - sizeof(struct got_imsg_blob))
241 };
243 /* Structure for GOT_IMSG_RAW_OBJECT. */
244 struct got_imsg_raw_obj {
245 off_t size;
246 size_t hdrlen;
248 /*
249 * If size <= GOT_PRIVSEP_INLINE_OBJECT_DATA_MAX, object data follows
250 * in the imsg buffer. Otherwise, object data has been written to a
251 * file descriptor passed via the GOT_IMSG_RAW_OBJECT_OUTFD imsg.
252 */
253 #define GOT_PRIVSEP_INLINE_OBJECT_DATA_MAX \
254 (MAX_IMSGSIZE - IMSG_HEADER_SIZE - sizeof(struct got_imsg_raw_obj))
255 };
257 /* Structure for GOT_IMSG_TAG data. */
258 struct got_imsg_tag_object {
259 uint8_t id[SHA1_DIGEST_LENGTH];
260 int obj_type;
261 size_t tag_len;
262 size_t tagger_len;
263 time_t tagger_time;
264 time_t tagger_gmtoff;
265 size_t tagmsg_len;
267 /*
268 * Followed by tag_len + tagger_len data bytes
269 */
271 /*
272 * Followed by 'tagmsg_len' bytes of tag message data in
273 * one or more GOT_IMSG_TAG_TAGMSG messages.
274 */
275 } __attribute__((__packed__));
277 /* Structure for GOT_IMSG_FETCH_HAVE_REF data. */
278 struct got_imsg_fetch_have_ref {
279 uint8_t id[SHA1_DIGEST_LENGTH];
280 size_t name_len;
281 /* Followed by name_len data bytes. */
282 } __attribute__((__packed__));
284 /* Structure for GOT_IMSG_FETCH_WANTED_BRANCH data. */
285 struct got_imsg_fetch_wanted_branch {
286 size_t name_len;
287 /* Followed by name_len data bytes. */
288 } __attribute__((__packed__));
290 /* Structure for GOT_IMSG_FETCH_WANTED_REF data. */
291 struct got_imsg_fetch_wanted_ref {
292 size_t name_len;
293 /* Followed by name_len data bytes. */
294 } __attribute__((__packed__));
296 /* Structure for GOT_IMSG_FETCH_REQUEST data. */
297 struct got_imsg_fetch_request {
298 int fetch_all_branches;
299 int list_refs_only;
300 int verbosity;
301 size_t n_have_refs;
302 size_t n_wanted_branches;
303 size_t n_wanted_refs;
304 /* Followed by n_have_refs GOT_IMSG_FETCH_HAVE_REF messages. */
305 /* Followed by n_wanted_branches times GOT_IMSG_FETCH_WANTED_BRANCH. */
306 /* Followed by n_wanted_refs times GOT_IMSG_FETCH_WANTED_REF. */
307 } __attribute__((__packed__));
309 /* Structures for GOT_IMSG_FETCH_SYMREFS data. */
310 struct got_imsg_fetch_symref {
311 size_t name_len;
312 size_t target_len;
314 /*
315 * Followed by name_len + target_len data bytes.
316 */
317 } __attribute__((__packed__));
319 struct got_imsg_fetch_symrefs {
320 size_t nsymrefs;
322 /* Followed by nsymrefs times of got_imsg_fetch_symref data. */
323 } __attribute__((__packed__));
325 /* Structure for GOT_IMSG_FETCH_REF data. */
326 struct got_imsg_fetch_ref {
327 /* Describes a reference which will be fetched. */
328 uint8_t refid[SHA1_DIGEST_LENGTH];
329 /* Followed by reference name in remaining data of imsg buffer. */
330 };
332 /* Structure for GOT_IMSG_FETCH_DOWNLOAD_PROGRESS data. */
333 struct got_imsg_fetch_download_progress {
334 /* Number of packfile data bytes downloaded so far. */
335 off_t packfile_bytes;
336 };
338 /* Structure for GOT_IMSG_IDXPACK_REQUEST data. */
339 struct got_imsg_index_pack_request {
340 uint8_t pack_hash[SHA1_DIGEST_LENGTH];
341 } __attribute__((__packed__));
343 /* Structure for GOT_IMSG_IDXPACK_PROGRESS data. */
344 struct got_imsg_index_pack_progress {
345 /* Total number of objects in pack file. */
346 int nobj_total;
348 /* Number of objects indexed so far. */
349 int nobj_indexed;
351 /* Number of non-deltified objects in pack file. */
352 int nobj_loose;
354 /* Number of deltified objects resolved so far. */
355 int nobj_resolved;
356 };
358 /* Structure for GOT_IMSG_PACKIDX. */
359 struct got_imsg_packidx {
360 size_t len;
361 /* Additionally, a file desciptor is passed via imsg. */
362 };
364 /* Structure for GOT_IMSG_PACK. */
365 struct got_imsg_pack {
366 char path_packfile[PATH_MAX];
367 size_t filesize;
368 /* Additionally, a file desciptor is passed via imsg. */
369 } __attribute__((__packed__));
371 /*
372 * Structure for GOT_IMSG_PACKED_OBJECT_REQUEST and
373 * GOT_IMSG_PACKED_RAW_OBJECT_REQUEST data.
374 */
375 struct got_imsg_packed_object {
376 uint8_t id[SHA1_DIGEST_LENGTH];
377 int idx;
378 } __attribute__((__packed__));
380 /* Structure for GOT_IMSG_COMMIT_TRAVERSAL_REQUEST */
381 struct got_imsg_commit_traversal_request {
382 uint8_t id[SHA1_DIGEST_LENGTH];
383 int idx;
384 size_t path_len;
385 /* Followed by path_len bytes of path data */
386 } __attribute__((__packed__));
388 /* Structure for GOT_IMSG_TRAVERSED_COMMITS */
389 struct got_imsg_traversed_commits {
390 size_t ncommits;
391 /* Followed by ncommit IDs of SHA1_DIGEST_LENGTH each */
392 } __attribute__((__packed__));
394 /*
395 * Structure for GOT_IMSG_GITCONFIG_REMOTE data.
396 */
397 struct got_imsg_remote {
398 size_t name_len;
399 size_t url_len;
400 int mirror_references;
401 int fetch_all_branches;
402 int nbranches;
403 int nrefs;
405 /* Followed by name_len + url_len data bytes. */
406 /* Followed by nbranches GOT_IMSG_GITCONFIG_STR_VAL messages. */
407 /* Followed by nrefs GOT_IMSG_GITCONFIG_STR_VAL messages. */
408 } __attribute__((__packed__));
410 /*
411 * Structure for GOT_IMSG_GITCONFIG_REMOTES data.
412 */
413 struct got_imsg_remotes {
414 int nremotes; /* This many GOT_IMSG_GITCONFIG_REMOTE messages follow. */
415 };
417 struct got_remote_repo;
418 struct got_pack;
419 struct got_packidx;
420 struct got_pathlist_head;
422 const struct got_error *got_send_ack(pid_t);
423 const struct got_error *got_privsep_wait_for_child(pid_t);
424 const struct got_error *got_privsep_flush_imsg(struct imsgbuf *);
425 const struct got_error *got_privsep_send_stop(int);
426 const struct got_error *got_privsep_recv_imsg(struct imsg *, struct imsgbuf *,
427 size_t);
428 void got_privsep_send_error(struct imsgbuf *, const struct got_error *);
429 const struct got_error *got_privsep_send_ack(struct imsgbuf *);
430 const struct got_error *got_privsep_wait_ack(struct imsgbuf *);
431 const struct got_error *got_privsep_send_obj_req(struct imsgbuf *, int);
432 const struct got_error *got_privsep_send_raw_obj_req(struct imsgbuf *, int);
433 const struct got_error *got_privsep_send_raw_obj_outfd(struct imsgbuf *, int);
434 const struct got_error *got_privsep_send_commit_req(struct imsgbuf *, int,
435 struct got_object_id *, int);
436 const struct got_error *got_privsep_send_tree_req(struct imsgbuf *, int,
437 struct got_object_id *, int);
438 const struct got_error *got_privsep_send_tag_req(struct imsgbuf *, int,
439 struct got_object_id *, int);
440 const struct got_error *got_privsep_send_blob_req(struct imsgbuf *, int,
441 struct got_object_id *, int);
442 const struct got_error *got_privsep_send_blob_outfd(struct imsgbuf *, int);
443 const struct got_error *got_privsep_send_tmpfd(struct imsgbuf *, int);
444 const struct got_error *got_privsep_send_obj(struct imsgbuf *,
445 struct got_object *);
446 const struct got_error *got_privsep_send_index_pack_req(struct imsgbuf *,
447 uint8_t *, int);
448 const struct got_error *got_privsep_send_index_pack_outfd(struct imsgbuf *,
449 int);
450 const struct got_error *got_privsep_recv_index_progress(int *, int *, int *,
451 int *, int *, struct imsgbuf *ibuf);
452 const struct got_error *got_privsep_send_fetch_req(struct imsgbuf *, int,
453 struct got_pathlist_head *, int, struct got_pathlist_head *,
454 struct got_pathlist_head *, int, int);
455 const struct got_error *got_privsep_send_fetch_outfd(struct imsgbuf *, int);
456 const struct got_error *got_privsep_recv_fetch_progress(int *,
457 struct got_object_id **, char **, struct got_pathlist_head *, char **,
458 off_t *, uint8_t *, struct imsgbuf *);
459 const struct got_error *got_privsep_get_imsg_obj(struct got_object **,
460 struct imsg *, struct imsgbuf *);
461 const struct got_error *got_privsep_recv_obj(struct got_object **,
462 struct imsgbuf *);
463 const struct got_error *got_privsep_send_raw_obj(struct imsgbuf *, off_t,
464 size_t, uint8_t *);
465 const struct got_error *got_privsep_recv_raw_obj(uint8_t **, off_t *, size_t *,
466 struct imsgbuf *);
467 const struct got_error *got_privsep_send_commit(struct imsgbuf *,
468 struct got_commit_object *);
469 const struct got_error *got_privsep_recv_commit(struct got_commit_object **,
470 struct imsgbuf *);
471 const struct got_error *got_privsep_recv_tree(struct got_tree_object **,
472 struct imsgbuf *);
473 const struct got_error *got_privsep_send_tree(struct imsgbuf *,
474 struct got_pathlist_head *, int);
475 const struct got_error *got_privsep_send_blob(struct imsgbuf *, size_t, size_t,
476 const uint8_t *);
477 const struct got_error *got_privsep_recv_blob(uint8_t **, size_t *, size_t *,
478 struct imsgbuf *);
479 const struct got_error *got_privsep_send_tag(struct imsgbuf *,
480 struct got_tag_object *);
481 const struct got_error *got_privsep_recv_tag(struct got_tag_object **,
482 struct imsgbuf *);
483 const struct got_error *got_privsep_init_pack_child(struct imsgbuf *,
484 struct got_pack *, struct got_packidx *);
485 const struct got_error *got_privsep_send_packed_obj_req(struct imsgbuf *, int,
486 struct got_object_id *);
487 const struct got_error *got_privsep_send_packed_raw_obj_req(struct imsgbuf *,
488 int, struct got_object_id *);
489 const struct got_error *got_privsep_send_pack_child_ready(struct imsgbuf *);
491 const struct got_error *got_privsep_send_gitconfig_parse_req(struct imsgbuf *,
492 int);
493 const struct got_error *
494 got_privsep_send_gitconfig_repository_format_version_req(struct imsgbuf *);
495 const struct got_error *got_privsep_send_gitconfig_repository_extensions_req(
496 struct imsgbuf *);
497 const struct got_error *got_privsep_send_gitconfig_author_name_req(
498 struct imsgbuf *);
499 const struct got_error *got_privsep_send_gitconfig_author_email_req(
500 struct imsgbuf *);
501 const struct got_error *got_privsep_send_gitconfig_remotes_req(
502 struct imsgbuf *);
503 const struct got_error *got_privsep_send_gitconfig_owner_req(struct imsgbuf *);
504 const struct got_error *got_privsep_recv_gitconfig_str(char **,
505 struct imsgbuf *);
506 const struct got_error *got_privsep_recv_gitconfig_int(int *, struct imsgbuf *);
507 const struct got_error *got_privsep_recv_gitconfig_remotes(
508 struct got_remote_repo **, int *, struct imsgbuf *);
510 const struct got_error *got_privsep_send_gotconfig_parse_req(struct imsgbuf *,
511 int);
512 const struct got_error *got_privsep_send_gotconfig_author_req(struct imsgbuf *);
513 const struct got_error *got_privsep_send_gotconfig_remotes_req(
514 struct imsgbuf *);
515 const struct got_error *got_privsep_recv_gotconfig_str(char **,
516 struct imsgbuf *);
517 const struct got_error *got_privsep_recv_gotconfig_remotes(
518 struct got_remote_repo **, int *, struct imsgbuf *);
520 const struct got_error *got_privsep_send_commit_traversal_request(
521 struct imsgbuf *, struct got_object_id *, int, const char *);
522 const struct got_error *got_privsep_recv_traversed_commits(
523 struct got_commit_object **, struct got_object_id **,
524 struct got_object_id_queue *, struct imsgbuf *);
526 void got_privsep_exec_child(int[2], const char *, const char *);