ws: Rename error code 'no-agent' to 'no-cockpit'

And update its message, since it was a bit confusing.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Rename cockpit_ws_agent_timeout to cockpit_ws_session_timeout

That's really what it's watching, various sessions and is related
to the CockpitSession structs that live in cockpitwebservice.c

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
bridge: Rename 'agent' -> 'bridge' and install to $PATH

This is done for a couple reasons.

 1. This really is a bridge into the system, and not an agent doing
    things on its own. It merely conveys the commands that the web
    interface sends its way. There is a lot of confusion about what
    Cockpit does, and this is one step towards clearing that up.

 2. The path to the bridge is public API, and will need to be
    usable across all future versions of Cockpit across different
    machines. Various distros can't agree on /usr/libexec so we
    can't really use it in such a public API guarantee.

 3. Name is similar to 'systemd-stdio-bridge' which does a similar
    task, but it much much simpler.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
man: Cleanup manual building automake foo

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
man: Add manual page for 'cockpit-bridge'

Closes #1349
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Send and expect 'init' control messages over each transport

Each transport when opened sends 'init' control messages to each
other. This is initially used to double check that the same protocol
version is in use. But this will be expanded in later commits.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Don't complain if SSH connection already closed when writing

When closing an SSH connection, don't complain if it's already
closed. libssh returns SSH_REQUEST_DENIED in this case.

This happens when the remote has closed but libssh hasn't let us
know yet. We assume that the notification will come soon.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Send a 'channel-seed' in the WebSocket init message

This allows various web sockets to generate unique channels, without
having to get into NAT'ing everything in CockpitWebService.

This is necessary once various frames are the source of channels.
They'll need to be seeded appropriately so that they pick unique
channel ids.

The way that channels get their id, also needs to change a bit.
The id can't be allocated until the transport is open. So queueing
of messages happens at the channel level now.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
session: Rename 'passwd' to 'password' for clarity

In the cases we're dealing with an actual password instead
of a struct passwd, use the full word 'password'

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
session: Lookup user info earlier and use it consistently

Lookup user info via getpwnam() right after authenticating and
use it consistently as the full user name, etc.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
session: Lookup the user's full name in session

This can be a blocking operation, don't look it up in
cockpit-ws where we can't be blocking waiting for an
LDAP server or something like that.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Send user info in the 'init' control channel message

Rather than filling in the user into the index page environment,
send it in the 'init' control message, along with the cockpit
setup info.

The index page will be changing, and this is much cleaner.

Closes #1332
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
bridge: Add cockpit-bridge --packages to list packages

This command line tool lists the installed packages, their
paths, checksums and aliases.
bridge: Fix checksum issues with packages

 * Make order of finalizing the checksums irrelevant
 * If a dependent package isn't cacheable or doesn't exist
   then don't allow a checksum

Closes #1350
Signed-off-by: Marius Vollmer <mvollmer@redhat.com>
 - Fixed memory leaks