commit - 85e62fc9f57c4a31877fcf257477a7dc5075903f
commit + 3972b889791e5d7bb291bf59b8736e6d43ce93f9
blob - 7511786325d8e67359b25d6e5a6983eaf0f84457
blob + b643ffc4d3b4304f1d21cd0eeb70e6170a63554e
--- lib/got_lib_privsep.h
+++ lib/got_lib_privsep.h
/* Structure for GOT_IMSG_ENUMERATED_TREE */
struct got_imsg_enumerated_tree {
- uint8_t id[SHA1_DIGEST_LENGTH]; /* tree ID */
+ struct got_object_id id; /* tree ID */
int nentries; /* number of tree entries */
/* Followed by tree's path in remaining data of imsg buffer. */
blob - e51908c9bc07441fc896089ee1c96ad436e9c94a
blob + 7e62208eb4b4a54c4cea9971137def3815fabedf
--- lib/privsep.c
+++ lib/privsep.c
if (wbuf == NULL)
return got_error_from_errno("imsg_create ENUMERATED_TREE");
- if (imsg_add(wbuf, tree_id->sha1, SHA1_DIGEST_LENGTH) == -1)
+ if (imsg_add(wbuf, tree_id, sizeof(*tree_id)) == -1)
return got_error_from_errno("imsg_add ENUMERATED_TREE");
if (imsg_add(wbuf, &nentries, sizeof(nentries)) == -1)
return got_error_from_errno("imsg_add ENUMERATED_TREE");
err = got_error(GOT_ERR_PRIVSEP_LEN);
break;
}
- memcpy(tree_id.sha1, itree->id, sizeof(tree_id.sha1));
+ memcpy(&tree_id, &itree->id, sizeof(tree_id));
free(path);
path = strndup(imsg.data + sizeof(*itree), path_len);
if (path == NULL) {