Commit Graph

1541 Commits

Author SHA1 Message Date
Michael Scherer bfe542abd8 improve consistency with others admin commands 2014-03-22 14:15:12 -04:00
Michael Scherer e1a1a1f593 Fix typo in man page ( envrionment => environment ) 2014-03-22 14:15:10 -04:00
Colin Walters 6c463f0b20 Release 2014.3 2014-03-21 14:54:03 -04:00
Colin Walters a80872afa0 pull: Don't print, just use progress callback
More work on removing g_print() from the library.
2014-03-21 14:52:56 -04:00
Colin Walters 44c386c8f9 pull: End status line on error as well
This way we don't append the error to the current line.
2014-03-19 09:49:55 -04:00
Colin Walters b68f8f95f0 core: Add "admin instutil set-kargs"
This will be used by Anaconda as a convenience command to set the
bootloader arguments.
2014-03-19 09:49:55 -04:00
Colin Walters 4309b49866 libostree: Add ostree_sysroot_deployment_set_kargs()
It turns out people sometimes want to be able to change the kernel
arguments.  Add a convenient API to do so for the current deployment.

This will be used by Anaconda.
2014-03-19 09:49:55 -04:00
Colin Walters 9fed088d6e libostree: Fix ostree_deployment_clone() to also clone bootconfig
This way one can easily mutate it for a new deployment list.
2014-03-19 09:49:55 -04:00
Colin Walters 606918e763 libostree: Add ostree_bootconfig_parser_clone()
This will be necessary to fix ostree_deployment_clone(), but is
potentially useful on its own for other consumers.
2014-03-19 09:49:55 -04:00
Colin Walters 24b1e9c0ac Add "ostree admin instutil", move selinux-ensure-labeled there
There are going to be a few utilities that are only useful for
installers and disk image creation tools.  Let's not expose them all
at the toplevel; instead, hide them under "instutil".
2014-03-19 09:49:55 -04:00
Colin Walters a10ddca1da test-sysroot: Use GSystem to spawn subprocess
I was getting a weird hang in the installed tests with the shell as a
zombie process, not reaped by the parent, which was just stuck in
select() on the output pipes.  The thing is we don't actually want to
capture stdout/stderr, we just want to inherit.

GSystem.Subprocess makes that possible, so let's just use it now that
it's a proper installed library.
2014-03-19 09:15:38 -04:00
Colin Walters efd3a75daa Revert "Disable test-sysroot.test"
This reverts commit 73868a96d1.
2014-03-19 09:15:38 -04:00
Vadim Rutkovsky 73868a96d1 Disable test-sysroot.test
It hangs on test-sysroot.js:40 during GLib.spawn_command_line_sync - it seems it can't
handle sh -c and the inner process becomes a zombie
2014-03-19 13:08:37 +01:00
Colin Walters fbc232d72b TODO: update 2014-03-15 19:05:52 -04:00
Colin Walters ba4f7ac7be Remove custom SELinux policy
This was a temporary hack until the requisite bits landed upstream in
the Fedora SELinux policy.
2014-03-15 13:16:14 -04:00
Colin Walters b6b7d37c9d libostree: Fix crash if output is not a tty
This was a recent regression.
2014-03-14 21:59:36 -04:00
Colin Walters cbc11f42e5 libostree: Add API to append a GPG signature
This will be used by rpm-ostree which needs to use an external program
to sign commits.
2014-03-14 21:57:48 -04:00
Colin Walters 4995352fe0 libostree: Add a better error if we fail to read keyring directory
I had accidentally put it in the -devel package and not noticed.
2014-03-14 14:42:46 -04:00
Colin Walters e11de9357c admin: selinux-ensure-labeled: new builtin
Code like rpm-ostree generates disk images directly.  In order to
ensure SELinux labeling is correct, it currently has a helper program
that runs over the deployment root, then over the whole disk and to
only set a label if none exist.

In order to make it easier to write installers such as Anaconda
without having them depend on rpm-ostree (or whatever other
build-server side program), pull in the helper code here.
2014-03-13 08:21:45 -04:00
Colin Walters 1f7f7382b1 deploy: Less usage of g_print
No need to spam the console here.
2014-03-11 13:16:38 -04:00
Colin Walters bf918f1586 libostree: Remove g_print() from bootloader code
No need to be so chatty.
2014-03-11 13:15:57 -04:00
Colin Walters 5c839f0267 pull: Drop some g_print(), replace others with async progress
We shouldn't g_print() from a library, particularly when the
expectation is that the client has an async progress set up.

This should fix the pull output extending the status line.
2014-03-11 09:36:54 -04:00
Colin Walters c2123bfc71 pull: Ensure temporary data that appears corrupted is deleted
If a MITM attacker (or just network corruption) causes a temporary
downloaded object in tmp/ to be corrupted, we'll end up
continually trying to commit it, and fail.

Fix this unlinking the temp file immediately after opening it.  This
will ensure that if we exit due to an error (or crash), the kernel
will clean up the space for us.

https://bugzilla.gnome.org/show_bug.cgi?id=725924
2014-03-07 19:36:55 -05:00
Colin Walters 19d36c540a packaging: Update internal spec file 2014-03-01 15:46:03 -05:00
Colin Walters cca4cf3e62 build: Add --enable-selinux-custom-policy
Don't use this.

It's just for me, and only temporarily until this stuff all lands in
the Fedora (and ideally upstream) selinux-policy.
2014-03-01 15:10:40 -05:00
Colin Walters 5bda4b4347 Release 2014.2 2014-03-01 13:55:55 -05:00
Colin Walters 79fa7ca692 Add /run/ostree-booted
The idea with this is that things like yum should be able to look for
it and determine whether or not they should assume that they can
change things on the system.

https://bugzilla.gnome.org/show_bug.cgi?id=725380
2014-02-28 03:49:25 -05:00
Colin Walters 4f04a55a5d upgrade/switch: Fix status line being overwritten with pull progress 2014-02-27 16:27:26 -05:00
Colin Walters d8852d099a checkout: Use fd-relative open of newly created directory
We were walking the full path again on our directories, no need to do
that.
2014-02-27 11:49:49 -05:00
Colin Walters b6704f8346 checkout: Only fchown/fchmod directories after we're done populating them
See https://mail.gnome.org/archives/ostree-list/2014-February/msg00020.html
2014-02-27 11:19:33 -05:00
Colin Walters 683a719b7e Update libgsystem, use it to set dirfd-relative xattrs on symlinks
This is a bit more efficient in that we're not walking full paths, and
it helps avoid security/reliability issues if an attacker (or just a
misbehaving process) has the ability to mutate paths in the middle.
2014-02-26 16:34:37 -05:00
Colin Walters 0eb8c37ecb upgrade: Properly set origin_refspec variable for resolve/printing
1) We were ignoring the remote, which is broken
2) We were printing NULL later on
2014-02-26 15:13:12 -05:00
Colin Walters c85682cb85 switch: Don't check whether revision matches
It's quite possible that say "buildmaster" and "smoketested" are the
same revision - but we should allow switching between them.
2014-02-26 15:12:08 -05:00
Colin Walters b762c2f8f1 pull: Remove explicit threading
Mixing async and threads has proved to be too much for my little mind.
It has race conditions that I've tried repeatedly to fix, but failed.

The threading here was scanning metadata objects - and there are
two parts to that:

1) Physically loading them from disk
2) Parsing them

Now #1 has been partially addressed by avoiding a storm of lstat() if
we're starting from a known working state.  If pull gets interrupted,
then we do need to rescan all objects.  Also, we can address this with
local metadata packfiles.

The other potentially slow bit is that we recurse across the metadata,
blocking the main thread.  We could ameliorate that in the future by
scheduling metadata parsing as idle "chunks".

Anyways, let's move the needle back to reliability, and readd speed
more carefully.

https://bugzilla.gnome.org/show_bug.cgi?id=706456
2014-02-21 15:04:23 -05:00
Colin Walters f2e0162846 upgrade: Refuse chronologically older commits unless --allow-downgrade
We don't want to allow MITM attackers to intercept upgrade requests
and provide clients with older OS versions vulnerable to security
flaws.

Only "ostree admin upgrade" gets this behavior for now - whether we
want to do it for "ostree admin switch" is another question.
2014-02-20 18:25:56 -05:00
Colin Walters 9fc9008af8 repo: Fix crash without SELinux policy enabled during commit 2014-02-20 14:19:49 -05:00
Colin Walters 071916196c build: Fix build without SELinux 2014-02-20 10:12:53 -05:00
Colin Walters 3337334be5 libostree: Split off SELinux OstreeSePolicy class
It's better if this is independent from the OstreeSysroot; for
example, a policy is active in a given deployment root at once, not
for a sysroot globally.

We can also collect SELinux-related API in one place.

Unfortunately at the moment there can be only one instance of this
class per process.
2014-02-19 08:43:45 -05:00
Colin Walters cc49096044 Add internal SELinux policy overrides
In the future, this will likely include an ostree_t domain.  For now,
this is just a few additional allow rules.
2014-02-19 08:40:19 -05:00
Colin Walters 53bd648dac manual-tests: New directory with custom test scripts
This is just a demo script.
2014-02-14 18:16:37 -05:00
Daniel Drake 8ccd603cba fetcher: set timeouts on HTTP connections
We're seeing some hangs while ostree is fetching updates.
I imagine the fact that SoupSessionAsync has no timeout by default
could be the cause of this.

Set timeout values to 60 seconds, which is the default for the new
SoupSession API which we may switch to later.

https://bugzilla.gnome.org/show_bug.cgi?id=724310
2014-02-13 11:21:26 -06:00
Colin Walters 371cebf258 build: make "sudo make install" over existing install work 2014-02-13 10:57:51 -05:00
Cosimo Cecchi d4f86fdef2 os-init: also create a symlink for /var/lock
After creating one for /var/run. This is needed at least on Debian
systems.
2014-02-12 14:05:13 -08:00
Colin Walters ad08799ef1 deploy: Remove now-unimplemented --no-bootloader argument 2014-02-12 16:47:39 -05:00
Daniel Drake c8b16d9313 boot/ostree-remount.service: run before tmpfiles.d
tmpfiles.d configurations generally require write access to some places
that are read-only until ostree-remount runs.

Make sure ostree-remount has run first.

Thanks to Cosimo Cecchi for finding and diagnosing this problem.

https://bugzilla.gnome.org/show_bug.cgi?id=724183
2014-02-11 17:27:38 -05:00
Colin Walters 3ffdef07a4 repo: Split generic GPG commit verification out into helper
This will be used for a future commit which GPG verifies static
deltas.
2014-02-10 09:40:35 -05:00
Colin Walters 60c4d467aa deltas: Add a timestamp to delta metadata 2014-02-10 09:40:35 -05:00
Colin Walters f526fd4e3c pull: Remove a duplicate hash table
Not sure why we had two...perhaps the code originally had them
separate.
2014-02-10 09:40:35 -05:00
Colin Walters 26d5db696b tests: Fix up GPG tests for more strict EL7 GPG
These GPG tests were failing for me on EL7 - it appears to be because
we had only one directory for both private and public keys, and we
were giving that to ostree for verification, which passed them onto
gpgv.

In EL7 beta at least, gpgv now barfs if it finds a private key where
it is just expecting to find public keys.

Fix this by splitting out the public trusted directory from the
private key directory.  Except now for signing, we still need the
public key there, so symlink it.  Whee!
2014-02-10 09:40:35 -05:00
Colin Walters 2ee2751fd1 repo: Don't set GPG engine executable path
The instructions one finds on the internets are apparently wrong, we
really need to keep the default here, since gpgme uses it to actually
find the helper binary it runs.

This fixes the GPG tests for me on EL7 at least.
2014-02-10 09:12:00 -05:00