]> git.ipfire.org Git - thirdparty/gnutls.git/commit
gnutls_priority_init: multiple @KEYWORD lookups with fallback
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 3 Jun 2016 15:57:02 +0000 (16:57 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 9 Jun 2016 15:33:17 +0000 (17:33 +0200)
commit6b6d9dd44e056d12dccbb543122e96d6e4df8489
tree9a8e95039ad9a5a1a01bedd82456051152ab532d
parentf92f0e0e240f29eec3c3835e272f5ad4caebab9e
gnutls_priority_init: multiple @KEYWORD lookups with fallback

The support for using "@KEYWORD" as a priority string is very
useful to separate selection of priorities from application
specific code or config files. It is, however, not general
enough to fully serve all reasonable use cases.

For example, consider an application sets

  gnutls_priority_set_direct(session, "@SYSTEM", NULL);

The system administrator can modify the global priorities
file to change what "@SYSTEM" resolves to for all apps using
GNUTLS. As soon as one application wishes to have a slightly
different configuration from others on the host, you have to
go back and start modifying application specific configuration
files once more. This is bad for the system administrator as
it means there's no longer one single place where they can
see the priority configuration for all apps.

They may try to get around this problem by configuring the
app to use a different keyword, instead of a full priority
string, eg "@LIBVIRT". So the global priorities file can
now define entries for both "SYSTEM" and "LIBVIRT". This
has still placed a burden on the administrator change the
config in two places - both libvirt config files and the
global priorities file.

What is more desirable is if applications were able to provide
a list of keywords that would be tried in order, picking the
first that existed. For example, libvirt could be written to
request the following by default

  gnutls_priority_set_direct(session, "@LIBVIRT,SYSTEM", NULL);

With this, gnutls would first try to find the "LIBVIRT" keyword
in the global configuration file, and if that is not present,
then it would fallback to trying to find the "SYSTEM" keyword.

This provides nice "out of the box" behaviour for system
administrators, whereby the app would be using "SYSTEM" initially
and if the admin wishes to give the app a custom configuration,
they can simply modify the global priorities file to add in the
application specific keyword "LIBVIRT". There is never a need
for the sysadmin to modify any application specific configuration
files any more. It is exclusively controlled in one place via the
global priorities file.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
lib/priority.c