commit 2ff12563f8266a459fcfc4d3b635d320c0a761d7 from: Stefan Sperling date: Sat Sep 15 10:39:48 2018 UTC fix 'make PROFILE=1' build commit - 13e51608f0cc4d543d573a2194077091608875c5 commit + 2ff12563f8266a459fcfc4d3b635d320c0a761d7 blob - 7c7fdf3f13ae50b44bf920389211769d3766850f blob + e0a3cb4106c801ab364f7421d420e633af511524 --- lib/object.c +++ lib/object.c @@ -55,25 +55,7 @@ #ifndef MIN #define MIN(_a,_b) ((_a) < (_b) ? (_a) : (_b)) #endif - -const struct got_error * -got_object_id_str(char **outbuf, struct got_object_id *id) -{ - static const size_t len = SHA1_DIGEST_STRING_LENGTH; - - *outbuf = malloc(len); - if (*outbuf == NULL) - return got_error_from_errno(); - - if (got_sha1_digest_to_str(id->sha1, *outbuf, len) == NULL) { - free(*outbuf); - *outbuf = NULL; - return got_error(GOT_ERR_BAD_OBJ_ID_STR); - } - return NULL; -} - int got_object_id_cmp(struct got_object_id *id1, struct got_object_id *id2) { blob - bab79facebb43d058755da15af744e18af33ee0d blob + 2ff896aeceaa318ea2ab3a6c82d5f3751584d169 --- lib/object_parse.c +++ lib/object_parse.c @@ -61,7 +61,25 @@ #define GOT_COMMIT_TAG_PARENT "parent " #define GOT_COMMIT_TAG_AUTHOR "author " #define GOT_COMMIT_TAG_COMMITTER "committer " + +const struct got_error * +got_object_id_str(char **outbuf, struct got_object_id *id) +{ + static const size_t len = SHA1_DIGEST_STRING_LENGTH; + + *outbuf = malloc(len); + if (*outbuf == NULL) + return got_error_from_errno(); + + if (got_sha1_digest_to_str(id->sha1, *outbuf, len) == NULL) { + free(*outbuf); + *outbuf = NULL; + return got_error(GOT_ERR_BAD_OBJ_ID_STR); + } + return NULL; +} + void got_object_close(struct got_object *obj) { blob - 24a35777d623a89c76f44ac36125a7289527bec2 blob + 071331070dc68817f9f11f2dee7249493215e227 --- libexec/got-read-blob/got-read-blob.c +++ libexec/got-read-blob/got-read-blob.c @@ -47,12 +47,14 @@ main(int argc, char *argv[]) imsg_init(&ibuf, GOT_IMSG_FD_CHILD); +#ifndef PROFILE /* revoke access to most system calls */ if (pledge("stdio recvfd", NULL) == -1) { err = got_error_from_errno(); got_privsep_send_error(&ibuf, err); return 1; } +#endif while (1) { struct imsg imsg, imsg_outfd; blob - 7936f1a29d699fa3b1c6a3252f558c313a59f205 blob + f6b5435605333d42433c5981a64efdc3cb4b18e6 --- libexec/got-read-commit/got-read-commit.c +++ libexec/got-read-commit/got-read-commit.c @@ -76,12 +76,14 @@ main(int argc, char *argv[]) imsg_init(&ibuf, GOT_IMSG_FD_CHILD); +#ifndef PROFILE /* revoke access to most system calls */ if (pledge("stdio recvfd", NULL) == -1) { err = got_error_from_errno(); got_privsep_send_error(&ibuf, err); return 1; } +#endif while (1) { struct imsg imsg; blob - 8a787460e3108b743e5595fb7ee1bb1a2da55afb blob + baca7732ad9c42e87766cbc54a518a7321fb69ea --- libexec/got-read-object/got-read-object.c +++ libexec/got-read-object/got-read-object.c @@ -156,12 +156,14 @@ main(int argc, char *argv[]) imsg_init(&ibuf, GOT_IMSG_FD_CHILD); +#ifndef PROFILE /* revoke access to most system calls */ if (pledge("stdio recvfd", NULL) == -1) { err = got_error_from_errno(); got_privsep_send_error(&ibuf, err); return 1; } +#endif while (1) { err = got_privsep_recv_imsg(&imsg, &ibuf, 0); blob - 51e3ea5274739b0370fd91f0a28663069e7036be blob + 2238e3a287aad6db2ee4725210be30d96274f92e --- libexec/got-read-pack/got-read-pack.c +++ libexec/got-read-pack/got-read-pack.c @@ -411,12 +411,14 @@ main(int argc, char *argv[]) return 1; } +#ifndef PROFILE /* revoke access to most system calls */ if (pledge("stdio recvfd", NULL) == -1) { err = got_error_from_errno(); got_privsep_send_error(&ibuf, err); return 1; } +#endif err = receive_packidx(&packidx, &ibuf); if (err) { blob - cb003bb2a8f4e554783c2a0c22796481435ee1f3 blob + 5abd5641f7bf4ae26e07d409b477b3de8140d6bf --- libexec/got-read-tree/got-read-tree.c +++ libexec/got-read-tree/got-read-tree.c @@ -75,12 +75,14 @@ main(int argc, char *argv[]) imsg_init(&ibuf, GOT_IMSG_FD_CHILD); +#ifndef PROFILE /* revoke access to most system calls */ if (pledge("stdio recvfd", NULL) == -1) { err = got_error_from_errno(); got_privsep_send_error(&ibuf, err); return 1; } +#endif while (1) { struct imsg imsg; blob - f8b0bfa821086e80656b9e1a57f229ff653befee blob + 09019b9d9453700ff31458a560af1359b4e9f602 --- regress/delta/delta_test.c +++ regress/delta/delta_test.c @@ -47,7 +47,7 @@ struct delta_test { }; static int -delta_apply() +delta_apply(void) { const struct got_error *err = NULL; int i; @@ -115,8 +115,10 @@ main(int argc, const char *argv[]) return 1; } +#ifndef PROFILE if (pledge("stdio rpath wpath cpath", NULL) == -1) err(1, "pledge"); +#endif RUN_TEST(delta_apply(), "delta_apply"); blob - ebadf49748d6cc69d4783ae31b3a1464bacf51c3 blob + 7d0f1de6e8cf560b249da09dd3332bcf8bfa4f6e --- regress/idset/idset_test.c +++ regress/idset/idset_test.c @@ -206,8 +206,10 @@ main(int argc, char *argv[]) int test_ok = 0, failure = 0; int ch; +#ifndef PROFILE if (pledge("stdio", NULL) == -1) err(1, "pledge"); +#endif while ((ch = getopt(argc, argv, "v")) != -1) { switch (ch) { blob - 9b48c7f0646cc49fe6736800f2314b8f09d3bbe3 blob + 7d05f1a2cc249d41a0e063d1cdc0a1c2efa80e2d --- regress/repository/repository_test.c +++ regress/repository/repository_test.c @@ -458,8 +458,10 @@ main(int argc, char *argv[]) const char *repo_path; int ch; +#ifndef PROFILE if (pledge("stdio rpath wpath cpath proc exec sendfd", NULL) == -1) err(1, "pledge"); +#endif while ((ch = getopt(argc, argv, "v")) != -1) { switch (ch) { blob - c6ece3a0c62118b22c4b7acc12dbef54dbb5e14a blob + 1b97298bec1b9a653524d535083509cbe7aa0d27 --- regress/worktree/worktree_test.c +++ regress/worktree/worktree_test.c @@ -390,9 +390,11 @@ main(int argc, char *argv[]) const char *repo_path; int ch; +#ifndef PROFILE if (pledge("stdio rpath wpath cpath flock proc exec sendfd", NULL) == -1) err(1, "pledge"); +#endif while ((ch = getopt(argc, argv, "v")) != -1) { switch (ch) {