diff options
author | Jan-Michael Brummer <jan.brummer@tabos.org> | 2023-05-03 14:40:55 +0200 |
---|---|---|
committer | Jan-Michael Brummer <jan.brummer@tabos.org> | 2023-05-03 14:40:55 +0200 |
commit | 7162fe27160efe13ae545a2b6c91097a2bd2e502 (patch) | |
tree | 95ff4eaf9f3ab856852adf8321be8c0dd5a89223 /src | |
parent | e81f7b300429e8cbc41438f6f87ecefe6dff17de (diff) | |
download | libproxy-git-force-config-env.tar.gz |
Add PX_FORCE_CONFIG envforce-config-env
Allow users to enforce a specific config plugin using
PX_FORCE_CONFIG=plugin-name
Fixes: https://github.com/libproxy/libproxy/issues/174
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/px-manager.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/px-manager.c b/src/backend/px-manager.c index 1eab303..4a54352 100644 --- a/src/backend/px-manager.c +++ b/src/backend/px-manager.c @@ -138,8 +138,10 @@ px_manager_add_config_plugin (PxManager *self, { PxConfig *config = g_object_new (type, "config-option", self->config_option, NULL); PxConfigInterface *ifc = PX_CONFIG_GET_IFACE (config); + const char *env = g_getenv ("PX_FORCE_CONFIG"); + const char *force_config = self->config_plugin ? self->config_plugin : env; - if (!self->config_plugin || g_strcmp0 (ifc->name, self->config_plugin) == 0) + if (!force_config || g_strcmp0 (ifc->name, force_config) == 0) self->config_plugins = g_list_insert_sorted (self->config_plugins, config, config_order_compare); } |