commit f826addf6c9cb9f000276eda59137f01fe9a037e from: Stefan Sperling date: Wed Mar 18 16:13:45 2020 UTC use a dedicated imsg for sending the pack fetch output file descriptor commit - 73ab1060354e23885c41d858ec39bcf11e2f5023 commit + f826addf6c9cb9f000276eda59137f01fe9a037e blob - 0a0cc2608e50604177f758c8f58bb8a78103e8b5 blob + db72516d800d6c47c8ba69883202bc5b761f6ecc --- lib/fetch.c +++ lib/fetch.c @@ -419,7 +419,7 @@ got_fetch_pack(struct got_object_id **pack_hash, struc if (err != NULL) goto done; nfetchfd = -1; - err = got_privsep_send_tmpfd(&fetchibuf, npackfd); + err = got_privsep_send_fetch_outfd(&fetchibuf, npackfd); if (err != NULL) goto done; npackfd = dup(packfd); blob - 0e76d54d1fe621953015794234ff1cad8b3d30d3 blob + 060d60ceb22e8d199bea83b95a778e986b0bfc62 --- lib/got_lib_privsep.h +++ lib/got_lib_privsep.h @@ -110,6 +110,7 @@ enum got_imsg_type { /* Messages related to networking. */ GOT_IMSG_FETCH_REQUEST, + GOT_IMSG_FETCH_OUTFD, GOT_IMSG_FETCH_SYMREFS, GOT_IMSG_FETCH_REF, GOT_IMSG_FETCH_SERVER_PROGRESS, @@ -387,6 +388,7 @@ const struct got_error *got_privsep_recv_index_progres int *, int *, struct imsgbuf *ibuf); const struct got_error *got_privsep_send_fetch_req(struct imsgbuf *, int, struct got_pathlist_head *); +const struct got_error *got_privsep_send_fetch_outfd(struct imsgbuf *, int); const struct got_error *got_privsep_send_fetch_symrefs(struct imsgbuf *, struct got_pathlist_head *); const struct got_error *got_privsep_send_fetch_ref(struct imsgbuf *, blob - 938c697a5bf2802cce9397822a280e11350b4a49 blob + d271edae5641fdd75539b8140f6d33a7f9ac7edb --- lib/privsep.c +++ lib/privsep.c @@ -477,6 +477,13 @@ got_privsep_send_fetch_req(struct imsgbuf *ibuf, int f } const struct got_error * +got_privsep_send_fetch_outfd(struct imsgbuf *ibuf, int fd) +{ + return send_fd(ibuf, GOT_IMSG_FETCH_OUTFD, fd); +} + + +const struct got_error * got_privsep_send_fetch_symrefs(struct imsgbuf *ibuf, struct got_pathlist_head *symrefs) { blob - 913393e0538ea85ff30ac2493fa08b0469e9272b blob + d86b89f565dfeea38e788819fdee0e1e71c6817d --- libexec/got-fetch-pack/got-fetch-pack.c +++ libexec/got-fetch-pack/got-fetch-pack.c @@ -793,7 +793,7 @@ main(int argc, char **argv) } if (imsg.hdr.type == GOT_IMSG_STOP) goto done; - if (imsg.hdr.type != GOT_IMSG_TMPFD) { + if (imsg.hdr.type != GOT_IMSG_FETCH_OUTFD) { err = got_error(GOT_ERR_PRIVSEP_MSG); goto done; }