Release version 0.7
ws: Make the HTTP parts of cockpit-ws log in cockpit-protocol domain

This lets us focus in on the semantic stuff, and leave the
mechanical shunting of bytes into the cockpit-protocol log domain.

Closes #572
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Fix race when disconnecting from an ssh transport

Closes #574
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
agent: Call pam_acct_mgmt() when creating user session

This allows PAM to deny access for the user, so we now
respect HBAC.

Fixes #493
Closes #566
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Add per test logging in test-sshtransport.c

And turn it on for the problematic
/ssh-transport/terminate-problem test that we're trying to diagnose.

Closes #576
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
agent: Close fds before spawning agent for security reasons

Don't leak fds into the agent child process after dropping
privileges.

Fixes #506
Closes #567
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
Try again to quieten down Travis in our IRC channel

Closes #575
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
static: Serve static files from a separate directory

These are files that will remain unauthenticated and retrieved
directly from the server connected to.

These files are served in such a way that they are cached for
a year, and not refreshed. They must be renamed when they are
updated.

Closes #561
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Add a timeout during test-webservice.c tests using alarm()

We may want to expand this further once we get some experience with
how it works.

Closes #577
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Don't send "ping" commands during test-webservice.c tests

This would previously limit the tests to having to run in
5 seconds or less, or erroneous results would result.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Separate function for parsing auth input in CockpitAuth

This allows us to test the real parsing functionality in our
test-auth tests.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
common: Check that JSON is UTF8 before parsing it

Recent versions of json-glib do this (0.99.2 and later) but we need this
guarantee on earlier versions as well. Do the check on our own in
those cases. And define the JSON_PARSER_ERROR_INVALID_DATA error code
when it is not around.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Handle cases where login is not UTF8 valid

Produce an intelligent error message in these cases. cockpit-session
would have produced invalid JSON output here, and so we catch and
handle in properly.

Fixes #507
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
common: Fix JSON string encoding for control characters

The implementation we got from json-glib is totally broken here
and escapes using octal sequences which are invalid in JSON.

Closes #582
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: use mkstemp() rather than mktemp()

Closes #588

Signed-off-by: Stef Walter <stefw@redhat.com>
 * Whitespace fix
daemon: Bail if storaged isn't running.

Fixes #586
Closes #587

Signed-off-by: Stef Walter <stefw@redhat.com>
 * Changed to a g_message()
daemon: Initialize accounts synchronously.

So that they are ready when cockpitd appears on the bus.

Fixes #592
Closes #593

Reviewed-by: Stef Walter <stefw@redhat.com>
ws: Remove some useless rhost stuff in CockpitWebService

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Only share sessions if channel uses normal user/key

If a channel requests a specific user or host key, then force a
new session/agent for that channel.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Test that a session without channel times out

This only happens after all channels have been closed. Refactor
things a bit to make testing easier.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>