Blame


1 7be7cc45 2018-04-02 stsp /*
2 5d56da81 2019-01-13 stsp * Copyright (c) 2018, 2019 Stefan Sperling <stsp@openbsd.org>
3 93658fb9 2020-03-18 stsp * Copyright (c) 2019, Ori Bernstein <ori@openbsd.org>
4 7be7cc45 2018-04-02 stsp *
5 7be7cc45 2018-04-02 stsp * Permission to use, copy, modify, and distribute this software for any
6 7be7cc45 2018-04-02 stsp * purpose with or without fee is hereby granted, provided that the above
7 7be7cc45 2018-04-02 stsp * copyright notice and this permission notice appear in all copies.
8 7be7cc45 2018-04-02 stsp *
9 7be7cc45 2018-04-02 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 7be7cc45 2018-04-02 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 7be7cc45 2018-04-02 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 7be7cc45 2018-04-02 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 7be7cc45 2018-04-02 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 7be7cc45 2018-04-02 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 7be7cc45 2018-04-02 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 7be7cc45 2018-04-02 stsp */
17 7be7cc45 2018-04-02 stsp
18 7be7cc45 2018-04-02 stsp /*
19 7be7cc45 2018-04-02 stsp * All code runs under the same UID but sensitive code paths are
20 7be7cc45 2018-04-02 stsp * run in a separate process with tighter pledge(2) promises.
21 2ca3a24b 2018-04-02 stsp * Data is communicated between processes via imsg_flush(3) and imsg_read(3).
22 7be7cc45 2018-04-02 stsp * This behaviour is transparent to users of the library.
23 7be7cc45 2018-04-02 stsp *
24 1e4880cb 2018-04-02 stsp * We generally transmit data in imsg buffers, split across several messages
25 ff6b18f8 2018-04-24 stsp * if necessary. File descriptors are used in cases where this is impractical,
26 ff6b18f8 2018-04-24 stsp * such as when accessing pack files or when transferring large blobs.
27 7be7cc45 2018-04-02 stsp *
28 ad242220 2018-09-08 stsp * We exec(2) after a fork(2). Parts of our library functionality are
29 ad242220 2018-09-08 stsp * accessible via separate executables in a libexec directory.
30 7be7cc45 2018-04-02 stsp */
31 7be7cc45 2018-04-02 stsp
32 ad242220 2018-09-08 stsp #define GOT_IMSG_FD_CHILD (STDERR_FILENO + 1)
33 ad242220 2018-09-08 stsp
34 ad242220 2018-09-08 stsp #ifndef GOT_LIBEXECDIR
35 ad242220 2018-09-08 stsp #define GOT_LIBEXECDIR /usr/libexec
36 ad242220 2018-09-08 stsp #endif
37 ad242220 2018-09-08 stsp
38 ad242220 2018-09-08 stsp /* Names of helper programs in libexec directory */
39 ad242220 2018-09-08 stsp #define GOT_PROG_READ_OBJECT got-read-object
40 ad242220 2018-09-08 stsp #define GOT_PROG_READ_TREE got-read-tree
41 ad242220 2018-09-08 stsp #define GOT_PROG_READ_COMMIT got-read-commit
42 ad242220 2018-09-08 stsp #define GOT_PROG_READ_BLOB got-read-blob
43 f4a881ce 2018-11-17 stsp #define GOT_PROG_READ_TAG got-read-tag
44 876c234b 2018-09-10 stsp #define GOT_PROG_READ_PACK got-read-pack
45 aba9c984 2019-09-08 stsp #define GOT_PROG_READ_GITCONFIG got-read-gitconfig
46 257add31 2020-09-09 stsp #define GOT_PROG_READ_GOTCONFIG got-read-gotconfig
47 93658fb9 2020-03-18 stsp #define GOT_PROG_FETCH_PACK got-fetch-pack
48 93658fb9 2020-03-18 stsp #define GOT_PROG_INDEX_PACK got-index-pack
49 93658fb9 2020-03-18 stsp #define GOT_PROG_SEND_PACK got-send-pack
50 ad242220 2018-09-08 stsp
51 ad242220 2018-09-08 stsp #define GOT_STRINGIFY(x) #x
52 ad242220 2018-09-08 stsp #define GOT_STRINGVAL(x) GOT_STRINGIFY(x)
53 ad242220 2018-09-08 stsp
54 ad242220 2018-09-08 stsp /* Paths to helper programs in libexec directory */
55 ad242220 2018-09-08 stsp #define GOT_PATH_PROG_READ_OBJECT \
56 ad242220 2018-09-08 stsp GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_OBJECT)
57 ad242220 2018-09-08 stsp #define GOT_PATH_PROG_READ_TREE \
58 ad242220 2018-09-08 stsp GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_TREE)
59 ad242220 2018-09-08 stsp #define GOT_PATH_PROG_READ_COMMIT \
60 ad242220 2018-09-08 stsp GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_COMMIT)
61 ad242220 2018-09-08 stsp #define GOT_PATH_PROG_READ_BLOB \
62 ad242220 2018-09-08 stsp GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_BLOB)
63 f4a881ce 2018-11-17 stsp #define GOT_PATH_PROG_READ_TAG \
64 f4a881ce 2018-11-17 stsp GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_TAG)
65 876c234b 2018-09-10 stsp #define GOT_PATH_PROG_READ_PACK \
66 876c234b 2018-09-10 stsp GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_PACK)
67 aba9c984 2019-09-08 stsp #define GOT_PATH_PROG_READ_GITCONFIG \
68 aba9c984 2019-09-08 stsp GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_GITCONFIG)
69 257add31 2020-09-09 stsp #define GOT_PATH_PROG_READ_GOTCONFIG \
70 257add31 2020-09-09 stsp GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_READ_GOTCONFIG)
71 93658fb9 2020-03-18 stsp #define GOT_PATH_PROG_FETCH_PACK \
72 93658fb9 2020-03-18 stsp GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_FETCH_PACK)
73 93658fb9 2020-03-18 stsp #define GOT_PATH_PROG_SEND_PACK \
74 93658fb9 2020-03-18 stsp GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_SEND_PACK)
75 93658fb9 2020-03-18 stsp #define GOT_PATH_PROG_INDEX_PACK \
76 93658fb9 2020-03-18 stsp GOT_STRINGVAL(GOT_LIBEXECDIR) "/" GOT_STRINGVAL(GOT_PROG_INDEX_PACK)
77 ad242220 2018-09-08 stsp
78 876c234b 2018-09-10 stsp struct got_privsep_child {
79 876c234b 2018-09-10 stsp int imsg_fd;
80 876c234b 2018-09-10 stsp pid_t pid;
81 876c234b 2018-09-10 stsp struct imsgbuf *ibuf;
82 876c234b 2018-09-10 stsp };
83 876c234b 2018-09-10 stsp
84 7be7cc45 2018-04-02 stsp enum got_imsg_type {
85 c025a41e 2018-04-02 stsp /* An error occured while processing a request. */
86 c025a41e 2018-04-02 stsp GOT_IMSG_ERROR,
87 c025a41e 2018-04-02 stsp
88 ad242220 2018-09-08 stsp /* Stop the child process. */
89 ad242220 2018-09-08 stsp GOT_IMSG_STOP,
90 1e4880cb 2018-04-02 stsp
91 7be7cc45 2018-04-02 stsp /*
92 7be7cc45 2018-04-02 stsp * Messages concerned with read access to objects in a repository.
93 7be7cc45 2018-04-02 stsp * Object and pack files are opened by the main process, where
94 7be7cc45 2018-04-02 stsp * data may be read as a byte string but without any interpretation.
95 7be7cc45 2018-04-02 stsp * Decompression and parsing of object and pack files occurs in a
96 f0b0c746 2018-09-09 stsp * separate process which runs under pledge("stdio recvfd").
97 7be7cc45 2018-04-02 stsp * This sandboxes our own repository parsing code, as well as zlib.
98 7be7cc45 2018-04-02 stsp */
99 ad242220 2018-09-08 stsp GOT_IMSG_OBJECT_REQUEST,
100 2178c42e 2018-04-22 stsp GOT_IMSG_OBJECT,
101 ad242220 2018-09-08 stsp GOT_IMSG_COMMIT_REQUEST,
102 bff6ca00 2018-04-23 stsp GOT_IMSG_COMMIT,
103 c75f7264 2018-09-11 stsp GOT_IMSG_COMMIT_LOGMSG,
104 ad242220 2018-09-08 stsp GOT_IMSG_TREE_REQUEST,
105 366d86ca 2018-04-23 stsp GOT_IMSG_TREE,
106 d80ab12b 2018-04-02 stsp GOT_IMSG_TREE_ENTRY,
107 ad242220 2018-09-08 stsp GOT_IMSG_BLOB_REQUEST,
108 ad242220 2018-09-08 stsp GOT_IMSG_BLOB_OUTFD,
109 366d86ca 2018-04-23 stsp GOT_IMSG_BLOB,
110 f4a881ce 2018-11-17 stsp GOT_IMSG_TAG_REQUEST,
111 f4a881ce 2018-11-17 stsp GOT_IMSG_TAG,
112 f4a881ce 2018-11-17 stsp GOT_IMSG_TAG_TAGMSG,
113 876c234b 2018-09-10 stsp
114 93658fb9 2020-03-18 stsp /* Messages related to networking. */
115 93658fb9 2020-03-18 stsp GOT_IMSG_FETCH_REQUEST,
116 4ba14133 2020-03-20 stsp GOT_IMSG_FETCH_HAVE_REF,
117 4ba14133 2020-03-20 stsp GOT_IMSG_FETCH_WANTED_BRANCH,
118 0e4002ca 2020-03-21 stsp GOT_IMSG_FETCH_WANTED_REF,
119 f826addf 2020-03-18 stsp GOT_IMSG_FETCH_OUTFD,
120 abe0f35f 2020-03-18 stsp GOT_IMSG_FETCH_SYMREFS,
121 ea7396b9 2020-03-18 stsp GOT_IMSG_FETCH_REF,
122 531c3985 2020-03-18 stsp GOT_IMSG_FETCH_SERVER_PROGRESS,
123 d2cdc636 2020-03-18 stsp GOT_IMSG_FETCH_DOWNLOAD_PROGRESS,
124 93658fb9 2020-03-18 stsp GOT_IMSG_FETCH_DONE,
125 93658fb9 2020-03-18 stsp GOT_IMSG_IDXPACK_REQUEST,
126 73ab1060 2020-03-18 stsp GOT_IMSG_IDXPACK_OUTFD,
127 baa9fea0 2020-03-18 stsp GOT_IMSG_IDXPACK_PROGRESS,
128 93658fb9 2020-03-18 stsp GOT_IMSG_IDXPACK_DONE,
129 f8a36e22 2021-08-26 stsp GOT_IMSG_SEND_REQUEST,
130 f8a36e22 2021-08-26 stsp GOT_IMSG_SEND_REF,
131 f8a36e22 2021-08-26 stsp GOT_IMSG_SEND_REMOTE_REF,
132 f8a36e22 2021-08-26 stsp GOT_IMSG_SEND_REF_STATUS,
133 f8a36e22 2021-08-26 stsp GOT_IMSG_SEND_PACK_REQUEST,
134 f8a36e22 2021-08-26 stsp GOT_IMSG_SEND_PACKFD,
135 f8a36e22 2021-08-26 stsp GOT_IMSG_SEND_UPLOAD_PROGRESS,
136 f8a36e22 2021-08-26 stsp GOT_IMSG_SEND_DONE,
137 93658fb9 2020-03-18 stsp
138 876c234b 2018-09-10 stsp /* Messages related to pack files. */
139 876c234b 2018-09-10 stsp GOT_IMSG_PACKIDX,
140 876c234b 2018-09-10 stsp GOT_IMSG_PACK,
141 876c234b 2018-09-10 stsp GOT_IMSG_PACKED_OBJECT_REQUEST,
142 ca6e02ac 2020-01-07 stsp GOT_IMSG_COMMIT_TRAVERSAL_REQUEST,
143 ca6e02ac 2020-01-07 stsp GOT_IMSG_TRAVERSED_COMMITS,
144 ca6e02ac 2020-01-07 stsp GOT_IMSG_COMMIT_TRAVERSAL_DONE,
145 3840f4c9 2018-09-12 stsp
146 33ad4cbe 2019-05-12 jcs /* Message sending file descriptor to a temporary file. */
147 3840f4c9 2018-09-12 stsp GOT_IMSG_TMPFD,
148 aba9c984 2019-09-08 stsp
149 aba9c984 2019-09-08 stsp /* Messages related to gitconfig files. */
150 aba9c984 2019-09-08 stsp GOT_IMSG_GITCONFIG_PARSE_REQUEST,
151 aba9c984 2019-09-08 stsp GOT_IMSG_GITCONFIG_REPOSITORY_FORMAT_VERSION_REQUEST,
152 20b7abb3 2020-10-22 stsp GOT_IMSG_GITCONFIG_REPOSITORY_EXTENSIONS_REQUEST,
153 aba9c984 2019-09-08 stsp GOT_IMSG_GITCONFIG_AUTHOR_NAME_REQUEST,
154 aba9c984 2019-09-08 stsp GOT_IMSG_GITCONFIG_AUTHOR_EMAIL_REQUEST,
155 cd95becd 2019-11-29 stsp GOT_IMSG_GITCONFIG_REMOTES_REQUEST,
156 aba9c984 2019-09-08 stsp GOT_IMSG_GITCONFIG_INT_VAL,
157 aba9c984 2019-09-08 stsp GOT_IMSG_GITCONFIG_STR_VAL,
158 cd95becd 2019-11-29 stsp GOT_IMSG_GITCONFIG_REMOTES,
159 cd95becd 2019-11-29 stsp GOT_IMSG_GITCONFIG_REMOTE,
160 9a1cc63f 2020-02-03 stsp GOT_IMSG_GITCONFIG_OWNER_REQUEST,
161 9a1cc63f 2020-02-03 stsp GOT_IMSG_GITCONFIG_OWNER,
162 257add31 2020-09-09 stsp
163 257add31 2020-09-09 stsp /* Messages related to gotconfig files. */
164 257add31 2020-09-09 stsp GOT_IMSG_GOTCONFIG_PARSE_REQUEST,
165 257add31 2020-09-09 stsp GOT_IMSG_GOTCONFIG_AUTHOR_REQUEST,
166 257add31 2020-09-09 stsp GOT_IMSG_GOTCONFIG_REMOTES_REQUEST,
167 257add31 2020-09-09 stsp GOT_IMSG_GOTCONFIG_INT_VAL,
168 257add31 2020-09-09 stsp GOT_IMSG_GOTCONFIG_STR_VAL,
169 257add31 2020-09-09 stsp GOT_IMSG_GOTCONFIG_REMOTES,
170 257add31 2020-09-09 stsp GOT_IMSG_GOTCONFIG_REMOTE,
171 59d1e4a0 2021-03-10 stsp
172 59d1e4a0 2021-03-10 stsp /* Raw object access. Uncompress object data but do not parse it. */
173 59d1e4a0 2021-03-10 stsp GOT_IMSG_RAW_OBJECT_REQUEST,
174 59d1e4a0 2021-03-10 stsp GOT_IMSG_RAW_OBJECT_OUTFD,
175 59d1e4a0 2021-03-10 stsp GOT_IMSG_PACKED_RAW_OBJECT_REQUEST,
176 59d1e4a0 2021-03-10 stsp GOT_IMSG_RAW_OBJECT,
177 67fd6849 2022-02-13 stsp
178 67fd6849 2022-02-13 stsp /* Read raw delta data from pack files. */
179 67fd6849 2022-02-13 stsp GOT_IMSG_RAW_DELTA_OUTFD,
180 67fd6849 2022-02-13 stsp GOT_IMSG_RAW_DELTA_REQUEST,
181 67fd6849 2022-02-13 stsp GOT_IMSG_RAW_DELTA,
182 7be7cc45 2018-04-02 stsp };
183 7be7cc45 2018-04-02 stsp
184 c025a41e 2018-04-02 stsp /* Structure for GOT_IMSG_ERROR. */
185 c025a41e 2018-04-02 stsp struct got_imsg_error {
186 c025a41e 2018-04-02 stsp int code; /* an error code from got_error.h */
187 2178c42e 2018-04-22 stsp int errno_code; /* in case code equals GOT_ERR_ERRNO */
188 291624d8 2018-11-07 stsp } __attribute__((__packed__));
189 c025a41e 2018-04-02 stsp
190 ad242220 2018-09-08 stsp /*
191 1785f84a 2018-12-23 stsp * Structure for GOT_IMSG_TREE_REQUEST and GOT_IMSG_OBJECT data.
192 ad242220 2018-09-08 stsp */
193 f7171542 2018-04-02 stsp struct got_imsg_object {
194 c59b3346 2018-09-11 stsp uint8_t id[SHA1_DIGEST_LENGTH];
195 c59b3346 2018-09-11 stsp
196 7be7cc45 2018-04-02 stsp /* These fields are the same as in struct got_object. */
197 7be7cc45 2018-04-02 stsp int type;
198 7be7cc45 2018-04-02 stsp int flags;
199 7be7cc45 2018-04-02 stsp size_t hdrlen;
200 7be7cc45 2018-04-02 stsp size_t size;
201 876c234b 2018-09-10 stsp off_t pack_offset;
202 c59b3346 2018-09-11 stsp int pack_idx;
203 291624d8 2018-11-07 stsp } __attribute__((__packed__));
204 7be7cc45 2018-04-02 stsp
205 366d86ca 2018-04-23 stsp /* Structure for GOT_IMSG_COMMIT data. */
206 bff6ca00 2018-04-23 stsp struct got_imsg_commit_object {
207 86acc566 2018-04-23 stsp uint8_t tree_id[SHA1_DIGEST_LENGTH];
208 bff6ca00 2018-04-23 stsp size_t author_len;
209 ccb26ccd 2018-11-05 stsp time_t author_time;
210 ccb26ccd 2018-11-05 stsp time_t author_gmtoff;
211 bff6ca00 2018-04-23 stsp size_t committer_len;
212 ccb26ccd 2018-11-05 stsp time_t committer_time;
213 ccb26ccd 2018-11-05 stsp time_t committer_gmtoff;
214 bff6ca00 2018-04-23 stsp size_t logmsg_len;
215 bff6ca00 2018-04-23 stsp int nparents;
216 bff6ca00 2018-04-23 stsp
217 6c281f94 2018-06-11 stsp /*
218 c75f7264 2018-09-11 stsp * Followed by author_len + committer_len data bytes
219 6c281f94 2018-06-11 stsp */
220 bff6ca00 2018-04-23 stsp
221 86acc566 2018-04-23 stsp /* Followed by 'nparents' SHA1_DIGEST_LENGTH length strings */
222 bff6ca00 2018-04-23 stsp
223 c75f7264 2018-09-11 stsp /*
224 c75f7264 2018-09-11 stsp * Followed by 'logmsg_len' bytes of commit log message data in
225 c75f7264 2018-09-11 stsp * one or more GOT_IMSG_COMMIT_LOGMSG messages.
226 c75f7264 2018-09-11 stsp */
227 bff6ca00 2018-04-23 stsp } __attribute__((__packed__));
228 bff6ca00 2018-04-23 stsp
229 f7171542 2018-04-02 stsp
230 48f392b2 2018-04-02 stsp /* Structure for GOT_IMSG_TREE_ENTRY. */
231 48f392b2 2018-04-02 stsp struct got_imsg_tree_entry {
232 e033d803 2018-04-23 stsp char id[SHA1_DIGEST_LENGTH];
233 48f392b2 2018-04-02 stsp mode_t mode;
234 48f392b2 2018-04-02 stsp /* Followed by entry's name in remaining data of imsg buffer. */
235 8d98bcfb 2018-04-02 stsp } __attribute__((__packed__));
236 48f392b2 2018-04-02 stsp
237 d80ab12b 2018-04-02 stsp /* Structure for GOT_IMSG_TREE_OBJECT_REPLY data. */
238 48f392b2 2018-04-02 stsp struct got_imsg_tree_object {
239 48f392b2 2018-04-02 stsp int nentries; /* This many TREE_ENTRY messages follow. */
240 48f392b2 2018-04-02 stsp };
241 48f392b2 2018-04-02 stsp
242 2967a784 2018-04-24 stsp /* Structure for GOT_IMSG_BLOB. */
243 2967a784 2018-04-24 stsp struct got_imsg_blob {
244 2967a784 2018-04-24 stsp size_t size;
245 ebc55e2d 2018-12-24 stsp size_t hdrlen;
246 ac544f8c 2019-01-13 stsp
247 ac544f8c 2019-01-13 stsp /*
248 ac544f8c 2019-01-13 stsp * If size <= GOT_PRIVSEP_INLINE_BLOB_DATA_MAX, blob data follows
249 ac544f8c 2019-01-13 stsp * in the imsg buffer. Otherwise, blob data has been written to a
250 ac544f8c 2019-01-13 stsp * file descriptor passed via the GOT_IMSG_BLOB_OUTFD imsg.
251 ac544f8c 2019-01-13 stsp */
252 ac544f8c 2019-01-13 stsp #define GOT_PRIVSEP_INLINE_BLOB_DATA_MAX \
253 ac544f8c 2019-01-13 stsp (MAX_IMSGSIZE - IMSG_HEADER_SIZE - sizeof(struct got_imsg_blob))
254 2967a784 2018-04-24 stsp };
255 2967a784 2018-04-24 stsp
256 59d1e4a0 2021-03-10 stsp /* Structure for GOT_IMSG_RAW_OBJECT. */
257 59d1e4a0 2021-03-10 stsp struct got_imsg_raw_obj {
258 59d1e4a0 2021-03-10 stsp off_t size;
259 59d1e4a0 2021-03-10 stsp size_t hdrlen;
260 59d1e4a0 2021-03-10 stsp
261 59d1e4a0 2021-03-10 stsp /*
262 59d1e4a0 2021-03-10 stsp * If size <= GOT_PRIVSEP_INLINE_OBJECT_DATA_MAX, object data follows
263 59d1e4a0 2021-03-10 stsp * in the imsg buffer. Otherwise, object data has been written to a
264 59d1e4a0 2021-03-10 stsp * file descriptor passed via the GOT_IMSG_RAW_OBJECT_OUTFD imsg.
265 59d1e4a0 2021-03-10 stsp */
266 59d1e4a0 2021-03-10 stsp #define GOT_PRIVSEP_INLINE_OBJECT_DATA_MAX \
267 59d1e4a0 2021-03-10 stsp (MAX_IMSGSIZE - IMSG_HEADER_SIZE - sizeof(struct got_imsg_raw_obj))
268 67fd6849 2022-02-13 stsp };
269 67fd6849 2022-02-13 stsp
270 67fd6849 2022-02-13 stsp /* Structure for GOT_IMSG_RAW_DELTA. */
271 67fd6849 2022-02-13 stsp struct got_imsg_raw_delta {
272 67fd6849 2022-02-13 stsp uint8_t base_id[SHA1_DIGEST_LENGTH];
273 67fd6849 2022-02-13 stsp uint64_t base_size;
274 67fd6849 2022-02-13 stsp uint64_t result_size;
275 67fd6849 2022-02-13 stsp off_t delta_size;
276 67fd6849 2022-02-13 stsp off_t delta_offset;
277 67fd6849 2022-02-13 stsp off_t delta_out_offset;
278 67fd6849 2022-02-13 stsp
279 67fd6849 2022-02-13 stsp /*
280 67fd6849 2022-02-13 stsp * Delta data has been written at delta_out_offset to the file
281 67fd6849 2022-02-13 stsp * descriptor passed via the GOT_IMSG_RAW_DELTA_OUTFD imsg.
282 67fd6849 2022-02-13 stsp */
283 59d1e4a0 2021-03-10 stsp };
284 ac544f8c 2019-01-13 stsp
285 f4a881ce 2018-11-17 stsp /* Structure for GOT_IMSG_TAG data. */
286 f4a881ce 2018-11-17 stsp struct got_imsg_tag_object {
287 f4a881ce 2018-11-17 stsp uint8_t id[SHA1_DIGEST_LENGTH];
288 f4a881ce 2018-11-17 stsp int obj_type;
289 f4a881ce 2018-11-17 stsp size_t tag_len;
290 f4a881ce 2018-11-17 stsp size_t tagger_len;
291 f4a881ce 2018-11-17 stsp time_t tagger_time;
292 f4a881ce 2018-11-17 stsp time_t tagger_gmtoff;
293 f4a881ce 2018-11-17 stsp size_t tagmsg_len;
294 f4a881ce 2018-11-17 stsp
295 f4a881ce 2018-11-17 stsp /*
296 f4a881ce 2018-11-17 stsp * Followed by tag_len + tagger_len data bytes
297 f4a881ce 2018-11-17 stsp */
298 f4a881ce 2018-11-17 stsp
299 f4a881ce 2018-11-17 stsp /*
300 f4a881ce 2018-11-17 stsp * Followed by 'tagmsg_len' bytes of tag message data in
301 f4a881ce 2018-11-17 stsp * one or more GOT_IMSG_TAG_TAGMSG messages.
302 f4a881ce 2018-11-17 stsp */
303 abe0f35f 2020-03-18 stsp } __attribute__((__packed__));
304 33501562 2020-03-18 stsp
305 4ba14133 2020-03-20 stsp /* Structure for GOT_IMSG_FETCH_HAVE_REF data. */
306 33501562 2020-03-18 stsp struct got_imsg_fetch_have_ref {
307 33501562 2020-03-18 stsp uint8_t id[SHA1_DIGEST_LENGTH];
308 33501562 2020-03-18 stsp size_t name_len;
309 33501562 2020-03-18 stsp /* Followed by name_len data bytes. */
310 7848a0e1 2020-03-19 stsp } __attribute__((__packed__));
311 7848a0e1 2020-03-19 stsp
312 4ba14133 2020-03-20 stsp /* Structure for GOT_IMSG_FETCH_WANTED_BRANCH data. */
313 4ba14133 2020-03-20 stsp struct got_imsg_fetch_wanted_branch {
314 0e4002ca 2020-03-21 stsp size_t name_len;
315 0e4002ca 2020-03-21 stsp /* Followed by name_len data bytes. */
316 0e4002ca 2020-03-21 stsp } __attribute__((__packed__));
317 0e4002ca 2020-03-21 stsp
318 0e4002ca 2020-03-21 stsp /* Structure for GOT_IMSG_FETCH_WANTED_REF data. */
319 0e4002ca 2020-03-21 stsp struct got_imsg_fetch_wanted_ref {
320 4ba14133 2020-03-20 stsp size_t name_len;
321 4ba14133 2020-03-20 stsp /* Followed by name_len data bytes. */
322 4ba14133 2020-03-20 stsp } __attribute__((__packed__));
323 4ba14133 2020-03-20 stsp
324 4ba14133 2020-03-20 stsp /* Structure for GOT_IMSG_FETCH_REQUEST data. */
325 659e7fbd 2020-03-20 stsp struct got_imsg_fetch_request {
326 659e7fbd 2020-03-20 stsp int fetch_all_branches;
327 41b0de12 2020-03-21 stsp int list_refs_only;
328 2690194b 2020-03-21 stsp int verbosity;
329 33501562 2020-03-18 stsp size_t n_have_refs;
330 4ba14133 2020-03-20 stsp size_t n_wanted_branches;
331 0e4002ca 2020-03-21 stsp size_t n_wanted_refs;
332 4ba14133 2020-03-20 stsp /* Followed by n_have_refs GOT_IMSG_FETCH_HAVE_REF messages. */
333 4ba14133 2020-03-20 stsp /* Followed by n_wanted_branches times GOT_IMSG_FETCH_WANTED_BRANCH. */
334 0e4002ca 2020-03-21 stsp /* Followed by n_wanted_refs times GOT_IMSG_FETCH_WANTED_REF. */
335 659e7fbd 2020-03-20 stsp } __attribute__((__packed__));
336 abe0f35f 2020-03-18 stsp
337 abe0f35f 2020-03-18 stsp /* Structures for GOT_IMSG_FETCH_SYMREFS data. */
338 abe0f35f 2020-03-18 stsp struct got_imsg_fetch_symref {
339 abe0f35f 2020-03-18 stsp size_t name_len;
340 abe0f35f 2020-03-18 stsp size_t target_len;
341 abe0f35f 2020-03-18 stsp
342 abe0f35f 2020-03-18 stsp /*
343 d45e6863 2020-03-18 stsp * Followed by name_len + target_len data bytes.
344 abe0f35f 2020-03-18 stsp */
345 abe0f35f 2020-03-18 stsp } __attribute__((__packed__));
346 abe0f35f 2020-03-18 stsp
347 abe0f35f 2020-03-18 stsp struct got_imsg_fetch_symrefs {
348 abe0f35f 2020-03-18 stsp size_t nsymrefs;
349 abe0f35f 2020-03-18 stsp
350 abe0f35f 2020-03-18 stsp /* Followed by nsymrefs times of got_imsg_fetch_symref data. */
351 f4a881ce 2018-11-17 stsp } __attribute__((__packed__));
352 b9f99abf 2020-03-18 stsp
353 ea7396b9 2020-03-18 stsp /* Structure for GOT_IMSG_FETCH_REF data. */
354 ea7396b9 2020-03-18 stsp struct got_imsg_fetch_ref {
355 abe0f35f 2020-03-18 stsp /* Describes a reference which will be fetched. */
356 b9f99abf 2020-03-18 stsp uint8_t refid[SHA1_DIGEST_LENGTH];
357 b9f99abf 2020-03-18 stsp /* Followed by reference name in remaining data of imsg buffer. */
358 b9f99abf 2020-03-18 stsp };
359 f4a881ce 2018-11-17 stsp
360 d2cdc636 2020-03-18 stsp /* Structure for GOT_IMSG_FETCH_DOWNLOAD_PROGRESS data. */
361 d2cdc636 2020-03-18 stsp struct got_imsg_fetch_download_progress {
362 d2cdc636 2020-03-18 stsp /* Number of packfile data bytes downloaded so far. */
363 d2cdc636 2020-03-18 stsp off_t packfile_bytes;
364 baa9fea0 2020-03-18 stsp };
365 f8a36e22 2021-08-26 stsp
366 f8a36e22 2021-08-26 stsp /* Structure for GOT_IMSG_SEND_REQUEST data. */
367 f8a36e22 2021-08-26 stsp struct got_imsg_send_request {
368 f8a36e22 2021-08-26 stsp int verbosity;
369 f8a36e22 2021-08-26 stsp size_t nrefs;
370 f8a36e22 2021-08-26 stsp /* Followed by nrefs GOT_IMSG_SEND_REF messages. */
371 f8a36e22 2021-08-26 stsp } __attribute__((__packed__));
372 f8a36e22 2021-08-26 stsp
373 f8a36e22 2021-08-26 stsp /* Structure for GOT_IMSG_SEND_UPLOAD_PROGRESS data. */
374 f8a36e22 2021-08-26 stsp struct got_imsg_send_upload_progress {
375 f8a36e22 2021-08-26 stsp /* Number of packfile data bytes uploaded so far. */
376 f8a36e22 2021-08-26 stsp off_t packfile_bytes;
377 f8a36e22 2021-08-26 stsp };
378 f8a36e22 2021-08-26 stsp
379 f8a36e22 2021-08-26 stsp /* Structure for GOT_IMSG_SEND_REF data. */
380 f8a36e22 2021-08-26 stsp struct got_imsg_send_ref {
381 f8a36e22 2021-08-26 stsp uint8_t id[SHA1_DIGEST_LENGTH];
382 f8a36e22 2021-08-26 stsp int delete;
383 f8a36e22 2021-08-26 stsp size_t name_len;
384 f8a36e22 2021-08-26 stsp /* Followed by name_len data bytes. */
385 f8a36e22 2021-08-26 stsp } __attribute__((__packed__));
386 668a20f6 2020-03-18 stsp
387 f8a36e22 2021-08-26 stsp /* Structure for GOT_IMSG_SEND_REMOTE_REF data. */
388 f8a36e22 2021-08-26 stsp struct got_imsg_send_remote_ref {
389 f8a36e22 2021-08-26 stsp uint8_t id[SHA1_DIGEST_LENGTH];
390 f8a36e22 2021-08-26 stsp size_t name_len;
391 f8a36e22 2021-08-26 stsp /* Followed by name_len data bytes. */
392 f8a36e22 2021-08-26 stsp } __attribute__((__packed__));
393 f8a36e22 2021-08-26 stsp
394 f8a36e22 2021-08-26 stsp /* Structure for GOT_IMSG_SEND_REF_STATUS data. */
395 f8a36e22 2021-08-26 stsp struct got_imsg_send_ref_status {
396 f8a36e22 2021-08-26 stsp int success;
397 f8a36e22 2021-08-26 stsp size_t name_len;
398 f8a36e22 2021-08-26 stsp /* Followed by name_len data bytes. */
399 f8a36e22 2021-08-26 stsp } __attribute__((__packed__));
400 f8a36e22 2021-08-26 stsp
401 668a20f6 2020-03-18 stsp /* Structure for GOT_IMSG_IDXPACK_REQUEST data. */
402 668a20f6 2020-03-18 stsp struct got_imsg_index_pack_request {
403 668a20f6 2020-03-18 stsp uint8_t pack_hash[SHA1_DIGEST_LENGTH];
404 668a20f6 2020-03-18 stsp } __attribute__((__packed__));
405 baa9fea0 2020-03-18 stsp
406 baa9fea0 2020-03-18 stsp /* Structure for GOT_IMSG_IDXPACK_PROGRESS data. */
407 baa9fea0 2020-03-18 stsp struct got_imsg_index_pack_progress {
408 baa9fea0 2020-03-18 stsp /* Total number of objects in pack file. */
409 668a20f6 2020-03-18 stsp int nobj_total;
410 668a20f6 2020-03-18 stsp
411 baa9fea0 2020-03-18 stsp /* Number of objects indexed so far. */
412 668a20f6 2020-03-18 stsp int nobj_indexed;
413 668a20f6 2020-03-18 stsp
414 668a20f6 2020-03-18 stsp /* Number of non-deltified objects in pack file. */
415 668a20f6 2020-03-18 stsp int nobj_loose;
416 668a20f6 2020-03-18 stsp
417 668a20f6 2020-03-18 stsp /* Number of deltified objects resolved so far. */
418 668a20f6 2020-03-18 stsp int nobj_resolved;
419 d2cdc636 2020-03-18 stsp };
420 d2cdc636 2020-03-18 stsp
421 876c234b 2018-09-10 stsp /* Structure for GOT_IMSG_PACKIDX. */
422 876c234b 2018-09-10 stsp struct got_imsg_packidx {
423 876c234b 2018-09-10 stsp size_t len;
424 c3564dfa 2021-07-15 stsp off_t packfile_size;
425 876c234b 2018-09-10 stsp /* Additionally, a file desciptor is passed via imsg. */
426 876c234b 2018-09-10 stsp };
427 876c234b 2018-09-10 stsp
428 876c234b 2018-09-10 stsp /* Structure for GOT_IMSG_PACK. */
429 876c234b 2018-09-10 stsp struct got_imsg_pack {
430 876c234b 2018-09-10 stsp char path_packfile[PATH_MAX];
431 876c234b 2018-09-10 stsp size_t filesize;
432 876c234b 2018-09-10 stsp /* Additionally, a file desciptor is passed via imsg. */
433 291624d8 2018-11-07 stsp } __attribute__((__packed__));
434 876c234b 2018-09-10 stsp
435 876c234b 2018-09-10 stsp /*
436 d5c81d44 2021-07-08 stsp * Structure for GOT_IMSG_OBJECT_REQUEST, GOT_IMSG_BLOB_REQUEST,
437 d5c81d44 2021-07-08 stsp * GOT_IMSG_TREE_REQUEST, GOT_IMSG_COMMIT_REQUEST, and
438 d5c81d44 2021-07-08 stsp * GOT_IMSG_TAG_REQUEST data.
439 d5c81d44 2021-07-08 stsp */
440 d5c81d44 2021-07-08 stsp struct got_object_id;
441 d5c81d44 2021-07-08 stsp
442 d5c81d44 2021-07-08 stsp /*
443 59d1e4a0 2021-03-10 stsp * Structure for GOT_IMSG_PACKED_OBJECT_REQUEST and
444 59d1e4a0 2021-03-10 stsp * GOT_IMSG_PACKED_RAW_OBJECT_REQUEST data.
445 876c234b 2018-09-10 stsp */
446 876c234b 2018-09-10 stsp struct got_imsg_packed_object {
447 106807b4 2018-09-15 stsp uint8_t id[SHA1_DIGEST_LENGTH];
448 876c234b 2018-09-10 stsp int idx;
449 291624d8 2018-11-07 stsp } __attribute__((__packed__));
450 67fd6849 2022-02-13 stsp
451 67fd6849 2022-02-13 stsp /*
452 67fd6849 2022-02-13 stsp * Structure for GOT_IMSG_DELTA data.
453 67fd6849 2022-02-13 stsp */
454 67fd6849 2022-02-13 stsp struct got_imsg_delta {
455 67fd6849 2022-02-13 stsp /* These fields are the same as in struct got_delta. */
456 67fd6849 2022-02-13 stsp off_t offset;
457 67fd6849 2022-02-13 stsp size_t tslen;
458 67fd6849 2022-02-13 stsp int type;
459 67fd6849 2022-02-13 stsp size_t size;
460 67fd6849 2022-02-13 stsp off_t data_offset;
461 67fd6849 2022-02-13 stsp };
462 876c234b 2018-09-10 stsp
463 67fd6849 2022-02-13 stsp /*
464 67fd6849 2022-02-13 stsp * Structure for GOT_IMSG_RAW_DELTA_REQUEST data.
465 67fd6849 2022-02-13 stsp */
466 67fd6849 2022-02-13 stsp struct got_imsg_raw_delta_request {
467 67fd6849 2022-02-13 stsp uint8_t id[SHA1_DIGEST_LENGTH];
468 67fd6849 2022-02-13 stsp int idx;
469 67fd6849 2022-02-13 stsp };
470 67fd6849 2022-02-13 stsp
471 ca6e02ac 2020-01-07 stsp /* Structure for GOT_IMSG_COMMIT_TRAVERSAL_REQUEST */
472 ca6e02ac 2020-01-07 stsp struct got_imsg_commit_traversal_request {
473 ca6e02ac 2020-01-07 stsp uint8_t id[SHA1_DIGEST_LENGTH];
474 ca6e02ac 2020-01-07 stsp int idx;
475 ca6e02ac 2020-01-07 stsp size_t path_len;
476 ca6e02ac 2020-01-07 stsp /* Followed by path_len bytes of path data */
477 ca6e02ac 2020-01-07 stsp } __attribute__((__packed__));
478 ca6e02ac 2020-01-07 stsp
479 ca6e02ac 2020-01-07 stsp /* Structure for GOT_IMSG_TRAVERSED_COMMITS */
480 ca6e02ac 2020-01-07 stsp struct got_imsg_traversed_commits {
481 ca6e02ac 2020-01-07 stsp size_t ncommits;
482 ca6e02ac 2020-01-07 stsp /* Followed by ncommit IDs of SHA1_DIGEST_LENGTH each */
483 ca6e02ac 2020-01-07 stsp } __attribute__((__packed__));
484 ca6e02ac 2020-01-07 stsp
485 cd95becd 2019-11-29 stsp /*
486 6480c871 2021-08-30 stsp * Structure for GOT_IMSG_GOTCONFIG_REMOTE and
487 6480c871 2021-08-30 stsp * GOT_IMSG_GOTCONFIG_REMOTE data.
488 cd95becd 2019-11-29 stsp */
489 cd95becd 2019-11-29 stsp struct got_imsg_remote {
490 cd95becd 2019-11-29 stsp size_t name_len;
491 6480c871 2021-08-30 stsp size_t fetch_url_len;
492 6480c871 2021-08-30 stsp size_t send_url_len;
493 469dd726 2020-03-20 stsp int mirror_references;
494 0c8b29c5 2021-01-05 stsp int fetch_all_branches;
495 6480c871 2021-08-30 stsp int nfetch_branches;
496 6480c871 2021-08-30 stsp int nsend_branches;
497 6480c871 2021-08-30 stsp int nfetch_refs;
498 cd95becd 2019-11-29 stsp
499 6480c871 2021-08-30 stsp /* Followed by name_len data bytes. */
500 6480c871 2021-08-30 stsp /* Followed by fetch_url_len + send_url_len data bytes. */
501 6480c871 2021-08-30 stsp /* Followed by nfetch_branches GOT_IMSG_GITCONFIG_STR_VAL messages. */
502 6480c871 2021-08-30 stsp /* Followed by nsend_branches GOT_IMSG_GITCONFIG_STR_VAL messages. */
503 6480c871 2021-08-30 stsp /* Followed by nfetch_refs GOT_IMSG_GITCONFIG_STR_VAL messages. */
504 4ba14133 2020-03-20 stsp } __attribute__((__packed__));
505 cd95becd 2019-11-29 stsp
506 cd95becd 2019-11-29 stsp /*
507 cd95becd 2019-11-29 stsp * Structure for GOT_IMSG_GITCONFIG_REMOTES data.
508 cd95becd 2019-11-29 stsp */
509 cd95becd 2019-11-29 stsp struct got_imsg_remotes {
510 cd95becd 2019-11-29 stsp int nremotes; /* This many GOT_IMSG_GITCONFIG_REMOTE messages follow. */
511 cd95becd 2019-11-29 stsp };
512 cd95becd 2019-11-29 stsp
513 cd95becd 2019-11-29 stsp struct got_remote_repo;
514 876c234b 2018-09-10 stsp struct got_pack;
515 876c234b 2018-09-10 stsp struct got_packidx;
516 3022d272 2019-11-14 stsp struct got_pathlist_head;
517 876c234b 2018-09-10 stsp
518 93658fb9 2020-03-18 stsp const struct got_error *got_send_ack(pid_t);
519 876c234b 2018-09-10 stsp const struct got_error *got_privsep_wait_for_child(pid_t);
520 e70bf110 2020-03-22 stsp const struct got_error *got_privsep_flush_imsg(struct imsgbuf *);
521 ad242220 2018-09-08 stsp const struct got_error *got_privsep_send_stop(int);
522 ad242220 2018-09-08 stsp const struct got_error *got_privsep_recv_imsg(struct imsg *, struct imsgbuf *,
523 ad242220 2018-09-08 stsp size_t);
524 2178c42e 2018-04-22 stsp void got_privsep_send_error(struct imsgbuf *, const struct got_error *);
525 93658fb9 2020-03-18 stsp const struct got_error *got_privsep_send_ack(struct imsgbuf *);
526 93658fb9 2020-03-18 stsp const struct got_error *got_privsep_wait_ack(struct imsgbuf *);
527 d5c81d44 2021-07-08 stsp const struct got_error *got_privsep_send_obj_req(struct imsgbuf *, int,
528 d5c81d44 2021-07-08 stsp struct got_object_id *);
529 d5c81d44 2021-07-08 stsp const struct got_error *got_privsep_send_raw_obj_req(struct imsgbuf *, int,
530 d5c81d44 2021-07-08 stsp struct got_object_id *);
531 59d1e4a0 2021-03-10 stsp const struct got_error *got_privsep_send_raw_obj_outfd(struct imsgbuf *, int);
532 1785f84a 2018-12-23 stsp const struct got_error *got_privsep_send_commit_req(struct imsgbuf *, int,
533 1785f84a 2018-12-23 stsp struct got_object_id *, int);
534 13c729f7 2018-12-24 stsp const struct got_error *got_privsep_send_tree_req(struct imsgbuf *, int,
535 13c729f7 2018-12-24 stsp struct got_object_id *, int);
536 268f7291 2018-12-24 stsp const struct got_error *got_privsep_send_tag_req(struct imsgbuf *, int,
537 268f7291 2018-12-24 stsp struct got_object_id *, int);
538 ebc55e2d 2018-12-24 stsp const struct got_error *got_privsep_send_blob_req(struct imsgbuf *, int,
539 ebc55e2d 2018-12-24 stsp struct got_object_id *, int);
540 55da3778 2018-09-10 stsp const struct got_error *got_privsep_send_blob_outfd(struct imsgbuf *, int);
541 3840f4c9 2018-09-12 stsp const struct got_error *got_privsep_send_tmpfd(struct imsgbuf *, int);
542 2178c42e 2018-04-22 stsp const struct got_error *got_privsep_send_obj(struct imsgbuf *,
543 876c234b 2018-09-10 stsp struct got_object *);
544 668a20f6 2020-03-18 stsp const struct got_error *got_privsep_send_index_pack_req(struct imsgbuf *,
545 668a20f6 2020-03-18 stsp uint8_t *, int);
546 73ab1060 2020-03-18 stsp const struct got_error *got_privsep_send_index_pack_outfd(struct imsgbuf *,
547 73ab1060 2020-03-18 stsp int);
548 baa9fea0 2020-03-18 stsp const struct got_error *got_privsep_recv_index_progress(int *, int *, int *,
549 668a20f6 2020-03-18 stsp int *, int *, struct imsgbuf *ibuf);
550 33501562 2020-03-18 stsp const struct got_error *got_privsep_send_fetch_req(struct imsgbuf *, int,
551 0e4002ca 2020-03-21 stsp struct got_pathlist_head *, int, struct got_pathlist_head *,
552 0e4002ca 2020-03-21 stsp struct got_pathlist_head *, int, int);
553 f826addf 2020-03-18 stsp const struct got_error *got_privsep_send_fetch_outfd(struct imsgbuf *, int);
554 8f2d01a6 2020-03-18 stsp const struct got_error *got_privsep_recv_fetch_progress(int *,
555 1d72a2a0 2020-03-24 stsp struct got_object_id **, char **, struct got_pathlist_head *, char **,
556 1d72a2a0 2020-03-24 stsp off_t *, uint8_t *, struct imsgbuf *);
557 f8a36e22 2021-08-26 stsp const struct got_error *got_privsep_send_send_req(struct imsgbuf *, int,
558 abc59930 2021-09-05 naddy struct got_pathlist_head *, struct got_pathlist_head *, int);
559 f8a36e22 2021-08-26 stsp const struct got_error *got_privsep_recv_send_remote_refs(
560 f8a36e22 2021-08-26 stsp struct got_pathlist_head *, struct imsgbuf *);
561 f8a36e22 2021-08-26 stsp const struct got_error *got_privsep_send_packfd(struct imsgbuf *, int);
562 f8a36e22 2021-08-26 stsp const struct got_error *got_privsep_recv_send_progress(int *, off_t *,
563 f8a36e22 2021-08-26 stsp int *, char **, struct imsgbuf *);
564 cfd633c2 2018-09-10 stsp const struct got_error *got_privsep_get_imsg_obj(struct got_object **,
565 cfd633c2 2018-09-10 stsp struct imsg *, struct imsgbuf *);
566 2178c42e 2018-04-22 stsp const struct got_error *got_privsep_recv_obj(struct got_object **,
567 2178c42e 2018-04-22 stsp struct imsgbuf *);
568 59d1e4a0 2021-03-10 stsp const struct got_error *got_privsep_send_raw_obj(struct imsgbuf *, off_t,
569 59d1e4a0 2021-03-10 stsp size_t, uint8_t *);
570 59d1e4a0 2021-03-10 stsp const struct got_error *got_privsep_recv_raw_obj(uint8_t **, off_t *, size_t *,
571 59d1e4a0 2021-03-10 stsp struct imsgbuf *);
572 068fd2bf 2018-04-24 stsp const struct got_error *got_privsep_send_commit(struct imsgbuf *,
573 bff6ca00 2018-04-23 stsp struct got_commit_object *);
574 068fd2bf 2018-04-24 stsp const struct got_error *got_privsep_recv_commit(struct got_commit_object **,
575 bff6ca00 2018-04-23 stsp struct imsgbuf *);
576 068fd2bf 2018-04-24 stsp const struct got_error *got_privsep_recv_tree(struct got_tree_object **,
577 e033d803 2018-04-23 stsp struct imsgbuf *);
578 068fd2bf 2018-04-24 stsp const struct got_error *got_privsep_send_tree(struct imsgbuf *,
579 3022d272 2019-11-14 stsp struct got_pathlist_head *, int);
580 ac544f8c 2019-01-13 stsp const struct got_error *got_privsep_send_blob(struct imsgbuf *, size_t, size_t,
581 ac544f8c 2019-01-13 stsp const uint8_t *);
582 ac544f8c 2019-01-13 stsp const struct got_error *got_privsep_recv_blob(uint8_t **, size_t *, size_t *,
583 ebc55e2d 2018-12-24 stsp struct imsgbuf *);
584 f4a881ce 2018-11-17 stsp const struct got_error *got_privsep_send_tag(struct imsgbuf *,
585 f4a881ce 2018-11-17 stsp struct got_tag_object *);
586 f4a881ce 2018-11-17 stsp const struct got_error *got_privsep_recv_tag(struct got_tag_object **,
587 f4a881ce 2018-11-17 stsp struct imsgbuf *);
588 876c234b 2018-09-10 stsp const struct got_error *got_privsep_init_pack_child(struct imsgbuf *,
589 876c234b 2018-09-10 stsp struct got_pack *, struct got_packidx *);
590 106807b4 2018-09-15 stsp const struct got_error *got_privsep_send_packed_obj_req(struct imsgbuf *, int,
591 106807b4 2018-09-15 stsp struct got_object_id *);
592 59d1e4a0 2021-03-10 stsp const struct got_error *got_privsep_send_packed_raw_obj_req(struct imsgbuf *,
593 59d1e4a0 2021-03-10 stsp int, struct got_object_id *);
594 41fa1437 2018-11-05 stsp const struct got_error *got_privsep_send_pack_child_ready(struct imsgbuf *);
595 aba9c984 2019-09-08 stsp
596 aba9c984 2019-09-08 stsp const struct got_error *got_privsep_send_gitconfig_parse_req(struct imsgbuf *,
597 aba9c984 2019-09-08 stsp int);
598 aba9c984 2019-09-08 stsp const struct got_error *
599 aba9c984 2019-09-08 stsp got_privsep_send_gitconfig_repository_format_version_req(struct imsgbuf *);
600 20b7abb3 2020-10-22 stsp const struct got_error *got_privsep_send_gitconfig_repository_extensions_req(
601 20b7abb3 2020-10-22 stsp struct imsgbuf *);
602 aba9c984 2019-09-08 stsp const struct got_error *got_privsep_send_gitconfig_author_name_req(
603 aba9c984 2019-09-08 stsp struct imsgbuf *);
604 aba9c984 2019-09-08 stsp const struct got_error *got_privsep_send_gitconfig_author_email_req(
605 aba9c984 2019-09-08 stsp struct imsgbuf *);
606 cd95becd 2019-11-29 stsp const struct got_error *got_privsep_send_gitconfig_remotes_req(
607 cd95becd 2019-11-29 stsp struct imsgbuf *);
608 9a1cc63f 2020-02-03 stsp const struct got_error *got_privsep_send_gitconfig_owner_req(struct imsgbuf *);
609 aba9c984 2019-09-08 stsp const struct got_error *got_privsep_recv_gitconfig_str(char **,
610 aba9c984 2019-09-08 stsp struct imsgbuf *);
611 aba9c984 2019-09-08 stsp const struct got_error *got_privsep_recv_gitconfig_int(int *, struct imsgbuf *);
612 cd95becd 2019-11-29 stsp const struct got_error *got_privsep_recv_gitconfig_remotes(
613 257add31 2020-09-09 stsp struct got_remote_repo **, int *, struct imsgbuf *);
614 257add31 2020-09-09 stsp
615 257add31 2020-09-09 stsp const struct got_error *got_privsep_send_gotconfig_parse_req(struct imsgbuf *,
616 257add31 2020-09-09 stsp int);
617 257add31 2020-09-09 stsp const struct got_error *got_privsep_send_gotconfig_author_req(struct imsgbuf *);
618 257add31 2020-09-09 stsp const struct got_error *got_privsep_send_gotconfig_remotes_req(
619 257add31 2020-09-09 stsp struct imsgbuf *);
620 257add31 2020-09-09 stsp const struct got_error *got_privsep_recv_gotconfig_str(char **,
621 257add31 2020-09-09 stsp struct imsgbuf *);
622 257add31 2020-09-09 stsp const struct got_error *got_privsep_recv_gotconfig_remotes(
623 cd95becd 2019-11-29 stsp struct got_remote_repo **, int *, struct imsgbuf *);
624 aba9c984 2019-09-08 stsp
625 ca6e02ac 2020-01-07 stsp const struct got_error *got_privsep_send_commit_traversal_request(
626 ca6e02ac 2020-01-07 stsp struct imsgbuf *, struct got_object_id *, int, const char *);
627 ca6e02ac 2020-01-07 stsp const struct got_error *got_privsep_recv_traversed_commits(
628 ca6e02ac 2020-01-07 stsp struct got_commit_object **, struct got_object_id **,
629 ca6e02ac 2020-01-07 stsp struct got_object_id_queue *, struct imsgbuf *);
630 ca6e02ac 2020-01-07 stsp
631 67fd6849 2022-02-13 stsp const struct got_error *got_privsep_send_raw_delta_req(struct imsgbuf *, int,
632 67fd6849 2022-02-13 stsp struct got_object_id *);
633 67fd6849 2022-02-13 stsp const struct got_error *got_privsep_send_raw_delta_outfd(struct imsgbuf *, int);
634 67fd6849 2022-02-13 stsp const struct got_error *got_privsep_send_raw_delta(struct imsgbuf *, uint64_t,
635 67fd6849 2022-02-13 stsp uint64_t, off_t, off_t, off_t, struct got_object_id *);
636 67fd6849 2022-02-13 stsp const struct got_error *got_privsep_recv_raw_delta(uint64_t *, uint64_t *,
637 67fd6849 2022-02-13 stsp off_t *, off_t *, off_t *, struct got_object_id **, struct imsgbuf *);
638 67fd6849 2022-02-13 stsp
639 aba9c984 2019-09-08 stsp void got_privsep_exec_child(int[2], const char *, const char *);