Commit Graph

2069 Commits

Author SHA1 Message Date
Matthew Barnes 239f05ecdd gpg: Add custom data buffers to wrapper GIO streams
ot_gpgme_data_input() and ot_gpgme_data_output(), shamelessly ripped
off from seahorse_gpgme_data_input() and seahorse_gpgme_data_output().
2015-05-07 17:07:36 -04:00
Matthew Barnes cd1551b1ee gpg: Fix ot_gpgme_error_to_gio_error()
Need to extract the error code from a gpgme_error_t, can't just compare
it directly.
2015-05-07 16:02:39 -04:00
Giuseppe Scrivano 223a9eaaa5 ot-fs-utils: remove empty line at EOF
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 21:59:30 +02:00
Giuseppe Scrivano 70d9599246 summary: delete summary.sig on an update
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 21:58:04 +02:00
Giuseppe Scrivano 6aeeba4280 tests: add a test for signed summary file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 21:58:04 +02:00
Giuseppe Scrivano ef7a4dee10 pull: verify signature for the summary file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 21:58:04 +02:00
Giuseppe Scrivano 5f33133054 summary: add new command line arguments to sign the summary file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 21:58:04 +02:00
Giuseppe Scrivano fee785a72e ostree-repo: add new API to sign the summary file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 21:58:04 +02:00
Giuseppe Scrivano 94360d3d1c pull: get rid of detached metadata for deltas
Once the summary file will be signed, we can validate the superblock
from there.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 21:58:04 +02:00
Giuseppe Scrivano 8c3d4eb7b2 pull: check that the superblock checksum is the same as in the summary
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 21:58:04 +02:00
Giuseppe Scrivano 222696996f core: store information about delta files checksums
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 21:58:04 +02:00
Giuseppe Scrivano ae672c3c9f core: new function _ostree_parse_delta_name
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 21:58:04 +02:00
Giuseppe Scrivano e0da4db77c summary: list the available static deltas
Write the information in the additional_metadata element for backward
compatibility.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 21:58:04 +02:00
Giuseppe Scrivano 0f8f668cd3 trivial-httpd: add option to specify the port
I use the trivial httpd server locally. Each time I restart the
server, I end up modifying manually the config file for other repos so
to point to the correct port. In this way I can just re-use the same
port.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 16:16:27 +02:00
Giuseppe Scrivano 26bb93ac24 trivial-httpd: fix indentation
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-07 16:16:23 +02:00
Matthew Barnes 4ef0280941 Remove unnecessary #include "libgsystem.h" 2015-05-06 22:07:11 -04:00
Matthew Barnes 302ac4dd89 Use g_auto(GStrv) instead of gs_strfreev 2015-05-06 22:07:11 -04:00
Matthew Barnes cca69b3f55 Use g_autoptr(GVariantBuilder) instead of gs_unref_variant_builder 2015-05-06 22:07:11 -04:00
Matthew Barnes c69347b622 Use g_autoptr(GKeyFile) instead of gs_unref_keyfile 2015-05-06 22:07:10 -04:00
Matthew Barnes c2c322efa9 Use g_autoptr(GVariant) instead of gs_unref_variant 2015-05-06 22:07:10 -04:00
Matthew Barnes bb231fdf74 Use g_autoptr(GPtrArray) instead of gs_unref_ptrarray 2015-05-06 22:07:10 -04:00
Matthew Barnes 196d983af9 Use g_autoptr(GHashTable) instead of gs_unref_hashtable 2015-05-06 22:07:10 -04:00
Matthew Barnes e6556dd223 Use g_autoptr(GBytes) instead of gs_unref_bytes 2015-05-06 22:07:10 -04:00
Matthew Barnes 3f044267b5 Use g_autoptr(GChecksum) instead of gs_free_checksum 2015-05-06 22:07:10 -04:00
Matthew Barnes 6a5f7b1288 Use glnx_unref_object instead of gs_unref_object
For non-GIO object types, at least until autocleanup support for GObject
based types becomes more widespread.
2015-05-06 22:07:04 -04:00
Matthew Barnes 4ee1acd981 Use g_autoptr() for GIO object types
GLib 2.44 supplies all the necessary autocleanup macros for GIO types,
and libglnx backports the relevant macros for ostree.
2015-05-06 21:51:19 -04:00
Matthew Barnes 7a62d64968 Use g_autofree instead of gs_free 2015-05-06 21:50:17 -04:00
Matthew Barnes 4f33515316 Juggling libglnx.h includes 2015-05-06 21:50:06 -04:00
Matthew Barnes 83aac088d1 gpg: Add ostree_gpg_verify_result_describe_variant()
Needed for printing signature details in places where
OstreeGpgVerifyResult cannot go.
2015-05-06 21:04:40 -04:00
Colin Walters 4a3c2a25b7 repo: Stop creating "transaction" symlink
This originally was a way that we detected the case where a pull was
interrupted.  Later, we added `.commitpartial` files which also cover
this case.

See also https://github.com/GNOME/ostree/pull/85

We still want to honor their existence (and unlink them) in case an
old version of ostree was in use, but I believe it's safe to stop
creating them now.

The only case where this would break is if you have a version of
ostree that predates commitpartial in your rollback history, but such
old versions are no longer in use by operating systems I support at
least.

Closes: https://github.com/GNOME/ostree/pull/100
2015-05-06 13:26:47 -04:00
Matthew Barnes e0f066e9c2 libglnx: Pick up bugfix and backports
Need more autocleanup backports for GIO types.
2015-05-06 10:28:31 -04:00
Colin Walters 5becd5ccad Teach fsck about partial commits
An OSTree user noticed that `ostree fsck` would produce `missing
object` errors in the case of interrupted pulls.

It's possible to do e.g. `ostree pull --subpath=/usr/share/rpm ...`,
which gets you just that portion of the commit.  The use case for this
was being able to see what changes would appear in an update before
actually downloading all of it.

(I think this would be better covered by static deltas, but those
 aren't final yet, and `--subpath` predates it)

Further, `.commitpartial` is used as a successor to the `transaction`
symlink for more precise knowledge in the case where a pull was
interrupted that we needed to resume scanning.

So it makes sense for `ostree fsck` to be aware of it.
2015-05-06 08:07:20 -04:00
Colin Walters 279308b5b9 core: Cleanup commitpartial file with fd-relative lookups
First, this is just a general continuation of the `GFile -> openat`
transition.

Second, it's preparatory work for fsck to gain awareness of partial
commits.
2015-05-06 08:07:20 -04:00
Giuseppe Scrivano a68242c6c9 doc: remove unknown parameter from inline documentation
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-05 16:29:20 +02:00
Matthew Barnes 81138963c3 repo: Fix an obvious typo 2015-05-05 10:25:00 -04:00
Giuseppe Scrivano 9fa10e69f9 libglnx: fix reference to commit
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-05 16:23:51 +02:00
Colin Walters 9ef98fd05a sysroot: Add an API to lock
If a system administrator happens to type `ostree admin upgrade`
multiple times, currently that will lead to a potentially corrupted
system.

I originally attempted to do locking *internally* in `libostree`, but
that didn't work out because currently a number of the commands
perform multi-step operations that all need to be serialized.  All of
the current code in `ostree admin deploy` is an example.

Therefore, allow callers to perform locking, as most of the higher
level logic is presently implemented there.

At some point, we can revisit having internal locking, but it will be
difficult.  A more likely approach would be similar to Java's approach
with concurrency on iterators - a "fail fast" method.
2015-05-05 08:52:44 -04:00
Matthew Barnes 33b0667597 Fix build when using GLib < 2.44 2015-05-04 12:02:02 -04:00
Giuseppe Scrivano 857a852540 pull: the commit size in the summary is not for the detached metadata
Use the size specified in the summary file only for the not detached
metadata.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-03 21:44:09 +02:00
Matthew Barnes f162c0b6d6 gpg: Fix _ostree_gpg_verifier_add_keyring()
The function never fails, but its API makes it look like it can.

Fortunately it's private, so just fix it.
2015-05-01 15:24:11 -04:00
Matthew Barnes e7246e6d64 ostree: Split up "remote" subcommands
To make room for "remote gpg-import", which will be non-trivial.
ot-builtin-remote.c was already a little too crowded anyway.

Also while we're at it, port this bit of code away from libgsystem.
2015-05-01 14:38:17 -04:00
Matthew Barnes ca63fab6b1 repo: Initialize GPGME in instance init()
Initially I had this in class_init() but there it would get invoked
during introspection scanning.
2015-05-01 14:38:17 -04:00
Matthew Barnes 97379ec38c libotutil: Add ot_gpgme_ctx_tmp_home_dir()
Currently used for signature verification, will also be used for
importing GPG keys.
2015-05-01 10:21:40 -04:00
Matthew Barnes ceacc57206 libotutil: Establish a place for GPG utilities
Add ot-gpg-utils.[ch] and move _ostree_gpg_error_to_gio_error() here.
2015-05-01 10:20:34 -04:00
Giuseppe Scrivano cd93780d97 show: add option --gpg-homedir
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-04-27 15:22:41 +02:00
Giuseppe Scrivano f37cbe1fc9 gpg: do not use secring.gpg
It contains the secret keyring

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-04-27 15:22:41 +02:00
Giuseppe Scrivano cf30f8717a g_output_stream_splice: check correctly the error code
While at it, change the style of other two occurrences.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-04-24 18:26:22 +02:00
Giuseppe Scrivano 8ab2e60edc test-auto-summary.sh properly quote arguments to assert_streq
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-04-24 15:46:28 +02:00
Matthew Barnes 9c449624f2 pull: Always request detached metadata for commits
Always request detached metadata for commit objects, even if we already
have the commit object.  This ensures we fetch any post facto detached
metadata updates such as new GPG signatures.

https://bugzilla.gnome.org/748220
2015-04-23 19:57:10 -04:00
Micah Abbott d801d347f7 reset: update help output
The inline help for 'ostree reset' now correctly shows that it
requires a REF and a COMMIT as arguments.
2015-04-23 14:32:11 -04:00