commit - ac617115880dba63f046743d329f0498086950db
commit + c466367a7c85f0e99043c411c9bc1ba99b4cf059
blob - adbbe1f6966f1814a34b228098272182fe1286aa
blob + 25f79e9af25b9a62a83b3025a2a668efd61b8005
--- 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 - 9cbcb675b7312262df2e80015f56f28faf7afc4a
blob + a9c84158ee4ada56fe936fe113ea1877ba7edf1d
--- 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) {