]> git.ozlabs.org Git - petitboot/commit - discover/platform.h
discover/discover-server: Restrict clients based on uid
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 19 Jun 2018 06:50:28 +0000 (16:50 +1000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Mon, 3 Dec 2018 03:39:57 +0000 (14:39 +1100)
commit336f4eb17fb50526ea9fda82262356581e1b9ae0
tree0a0b0fc427646d6ccd39f9baf209e62bfd40eb23
parentde6f6c4bff7d42f63e2bbd01d2bab65ae9635877
discover/discover-server: Restrict clients based on uid

If crypt support is enabled restrict what actions clients can perform by
default. Initial authorisation is set at connection time; clients
running as root are unrestricted, anything else runs as restricted until
it makes an authentication to pb-discover.

Unprivileged clients may only perform the following actions:
- Boot the default boot option.
- Cancel the autoboot timeout.
- Make an authentication request.

If a group named "petitgroup" exists then the socket permissions are
also modified so that only clients running as root or in that group may
connect to the socket.
The user-event socket is only usable by root since the two main
usecases are by utilities called by pb-discover or by a user in the
shell who will need to su to root anyway.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/discover-server.c
discover/discover-server.h
discover/pb-discover.c
discover/platform.c
discover/platform.h
discover/user-event.c