commit ed77be6862e23dbd16a470dbeed633200d4ece9c from: Stefan Sperling via: Thomas Adam date: Thu Apr 25 14:57:36 2024 UTC fix previous; pledge("stdio") must wait until after the TLS handshake commit - 69e2f7200332153e8dd19ba643dc552c6f26ac6e commit + ed77be6862e23dbd16a470dbeed633200d4ece9c blob - f443ed57aaa607502d7aade2e884676a1cfe4b79 blob + a5f2e1b28bbc8c0f51f1f3e9385f4f165dbd0b1b --- libexec/got-fetch-http/got-fetch-http.c +++ libexec/got-fetch-http/got-fetch-http.c @@ -431,11 +431,7 @@ upload_request(int https, const char *host, const char if ((sock = dial(https, host, port)) == -1) return -1; -#ifndef PROFILE - /* TODO: can we push this upwards such that get_refs() is covered? */ - if (pledge("stdio", NULL) == -1) - err(1, "pledge"); -#endif + if (bufio_init(&bio)) { warnx("bufio_init"); goto err; @@ -445,7 +441,11 @@ upload_request(int https, const char *host, const char warnx("bufio_starttls"); goto err; } - +#ifndef PROFILE + /* TODO: can we push this upwards such that get_refs() is covered? */ + if (pledge("stdio", NULL) == -1) + err(1, "pledge"); +#endif if (http_open(&bio, https, "POST", host, port, path, "/git-upload-pack", NULL, UPLOAD_PACK_REQ) == -1) goto err;