diff options
author | Jan-Michael Brummer <jan.brummer@tabos.org> | 2023-05-03 14:54:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-03 14:54:20 +0200 |
commit | 74d02dd846d446003dc49356411ec45b4109503c (patch) | |
tree | 95ff4eaf9f3ab856852adf8321be8c0dd5a89223 | |
parent | e81f7b300429e8cbc41438f6f87ecefe6dff17de (diff) | |
download | libproxy-git-74d02dd846d446003dc49356411ec45b4109503c.tar.gz |
Add PX_FORCE_CONFIG env (#205)
Allow users to enforce a specific config plugin using
PX_FORCE_CONFIG=plugin-name
Fixes: https://github.com/libproxy/libproxy/issues/174
-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); } |