mirror of
https://github.com/ostreedev/ostree.git
synced 2025-03-19 22:50:35 +03:00
Merge pull request #2409 from jlebon/pr/cov-fixes
A couple of Coverity fixes
This commit is contained in:
commit
87db562744
@ -171,7 +171,8 @@ gboolean ostree_sign_dummy_data_verify (OstreeSign *self,
|
||||
if (!g_variant_is_of_type (signatures, (GVariantType *) OSTREE_SIGN_METADATA_DUMMY_TYPE))
|
||||
return glnx_throw (error, "signature: dummy: wrong type passed for verification");
|
||||
|
||||
for (gsize i = 0; i < g_variant_n_children(signatures); i++)
|
||||
gsize n = g_variant_n_children(signatures);
|
||||
for (gsize i = 0; i < n; i++)
|
||||
{
|
||||
g_autoptr (GVariant) child = g_variant_get_child_value (signatures, i);
|
||||
g_autoptr (GBytes) signature = g_variant_get_data_as_bytes(child);
|
||||
@ -188,9 +189,9 @@ gboolean ostree_sign_dummy_data_verify (OstreeSign *self,
|
||||
*out_success_message = g_strdup ("dummy: Signature verified");
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return glnx_throw (error, "signature: dummy: incorrect signature %" G_GSIZE_FORMAT, i);
|
||||
}
|
||||
|
||||
if (n)
|
||||
return glnx_throw (error, "signature: dummy: incorrect signatures found: %" G_GSIZE_FORMAT, n);
|
||||
return glnx_throw (error, "signature: dummy: no signatures");
|
||||
}
|
||||
|
@ -1790,7 +1790,7 @@ ostree_sysroot_init_osname (OstreeSysroot *self,
|
||||
return glnx_throw_errno_prefix (error, "fchmod %s", "var/tmp");
|
||||
|
||||
if (mkdirat (dfd, "var/lib", 0777) < 0)
|
||||
return glnx_throw_errno_prefix (error, "Creating %s", "var/tmp");
|
||||
return glnx_throw_errno_prefix (error, "Creating %s", "var/lib");
|
||||
|
||||
/* This needs to be available and properly labeled early during the boot
|
||||
* process (before tmpfiles.d kicks in), so that journald can flush logs from
|
||||
|
@ -136,8 +136,8 @@ dump_commit (GVariant *variant,
|
||||
g_print ("Parent: %s\n", parent);
|
||||
}
|
||||
|
||||
g_autofree char *contents = ostree_commit_get_content_checksum (variant) ?: "<invalid commit>";
|
||||
g_print ("ContentChecksum: %s\n", contents);
|
||||
g_autofree char *contents = ostree_commit_get_content_checksum (variant);
|
||||
g_print ("ContentChecksum: %s\n", contents ?: "<invalid commit>");
|
||||
g_print ("Date: %s\n", str);
|
||||
|
||||
if ((version = ot_admin_checksum_version (variant)))
|
||||
|
@ -169,6 +169,6 @@ ostree_repo_init repo2 --mode=bare-user
|
||||
${CMD_PREFIX} ostree --repo=repo2 pull-local repo ${origrev}
|
||||
${CMD_PREFIX} ostree --repo=repo2 ls ${origrev} >/dev/null
|
||||
${CMD_PREFIX} ostree --repo=repo2 static-delta apply-offline --sign-type=dummy repo/deltas/${deltaprefix}/${deltadir} badsign 2> apply-offline-bad-key.txt && exit 1
|
||||
assert_file_has_content apply-offline-bad-key.txt "signature: dummy: incorrect signature"
|
||||
assert_file_has_content apply-offline-bad-key.txt "signature: dummy: incorrect signatures found: 1"
|
||||
|
||||
echo 'ok apply offline failed with dummy and bad key'
|
||||
|
Loading…
x
Reference in New Issue
Block a user