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