summaryrefslogtreecommitdiffstats
path: root/proxy/src
diff options
context:
space:
mode:
authorRoland Mainz <rmainz@redhat.com>2015-04-14 16:07:18 +0200
committerSimo Sorce <simo@redhat.com>2015-04-15 10:31:39 -0400
commit116e6c8f716e1104823c77f3d732513dd1b2a794 (patch)
tree0ac322b1403183d2ce364ab2240bc4cc57787156 /proxy/src
parentbcea066dc65fd2fef6f0c26454f5ecc076d69430 (diff)
Remove support for iniparse library
This library already does not support some features we need and we want to drop its usage as the code quality is bad. Fixes: https://fedorahosted.org/gss-proxy/ticket/139 Signed-off-by: Roland Mainz <rmainz@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'proxy/src')
-rw-r--r--proxy/src/gp_config.c52
-rw-r--r--proxy/src/gp_config_iniparser.c164
-rw-r--r--proxy/src/gp_config_iniparser.h42
3 files changed, 0 insertions, 258 deletions
diff --git a/proxy/src/gp_config.c b/proxy/src/gp_config.c
index d3af376..71e2ca6 100644
--- a/proxy/src/gp_config.c
+++ b/proxy/src/gp_config.c
@@ -567,58 +567,6 @@ void free_config(struct gp_config **cfg)
*cfg = NULL;
}
-#ifdef WITH_INIPARSER
-#include "gp_config_iniparser.h"
-
-int gp_config_init(const char *config_file,
- struct gp_ini_context *ctx)
-{
- return gp_iniparser_init(config_file, ctx);
-}
-
-int gp_config_get_string(struct gp_ini_context *ctx,
- const char *secname,
- const char *keyname,
- char **value)
-{
- return gp_iniparser_get_string(ctx, secname, keyname, value);
-}
-
-int gp_config_get_string_array(struct gp_ini_context *ctx,
- const char *secname,
- const char *keyname,
- int *num_values,
- char ***values)
-{
- return ENOENT;
-}
-
-int gp_config_get_int(struct gp_ini_context *ctx,
- const char *secname,
- const char *keyname,
- int *value)
-{
- return gp_iniparser_get_int(ctx, secname, keyname, value);
-}
-
-int gp_config_get_nsec(struct gp_ini_context *ctx)
-{
- return gp_iniparser_get_nsec(ctx);
-}
-
-char *gp_config_get_secname(struct gp_ini_context *ctx,
- int i)
-{
- return gp_iniparser_get_secname(ctx, i);
-}
-
-int gp_config_close(struct gp_ini_context *ctx)
-{
- return gp_iniparser_close(ctx);
-}
-
-#endif /* WITH_INIPARSER */
-
#ifdef WITH_DINGLIBS
#include "gp_config_dinglibs.h"
diff --git a/proxy/src/gp_config_iniparser.c b/proxy/src/gp_config_iniparser.c
deleted file mode 100644
index 45677d7..0000000
--- a/proxy/src/gp_config_iniparser.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- GSS-PROXY
-
- Copyright (C) 2011 Red Hat, Inc.
- Copyright (C) 2011 Simo Sorce <simo.sorce@redhat.com>
- Copyright (C) 2012 Guenther Deschner <guenther.deschner@redhat.com>
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-*/
-
-#include "config.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include "gp_proxy.h"
-#include "gp_config.h"
-#include "gp_config_iniparser.h"
-
-#ifdef WITH_INIPARSER
-
-#include <iniparser.h>
-
-int gp_iniparser_get_string(struct gp_ini_context *ctx,
- const char *secname,
- const char *key,
- char **value)
-{
- dictionary *dict;
- char *skey;
- char *val;
- int ret;
-
- dict = (dictionary *)ctx->private_data;
-
- if (!value) {
- return EINVAL;
- }
-
- *value = NULL;
-
- ret = asprintf(&skey, "%s:%s", secname, key);
- if (ret == -1) {
- return ENOMEM;
- }
-
- val = iniparser_getstring(dict, skey, NULL);
- free(skey);
-
- if (!val) {
- return ENOENT;
- }
-
- *value = val;
-
- return 0;
-}
-
-int gp_iniparser_get_int(struct gp_ini_context *ctx,
- const char *secname,
- const char *key,
- int *value)
-{
- dictionary *dict;
- char *skey;
- int ret;
-
- dict = (dictionary *)ctx->private_data;
-
- if (!value) {
- return EINVAL;
- }
-
- *value = -1;
-
- ret = asprintf(&skey, "%s:%s", secname, key);
- if (ret == -1) {
- return ENOMEM;
- }
-
- ret = iniparser_getint(dict, skey, -1);
- free(skey);
-
- if (ret == -1) {
- return ENOENT;
- }
-
- *value = ret;
-
- return 0;
-}
-
-int gp_iniparser_init(const char *config_file,
- struct gp_ini_context *ctx)
-{
- dictionary *d;
-
- if (!ctx) {
- return EINVAL;
- }
-
- d = iniparser_load(config_file);
- if (!d) {
- return ENOENT;
- }
-
- ctx->private_data = d;
-
- return 0;
-}
-
-int gp_iniparser_close(struct gp_ini_context *ctx)
-{
- dictionary *dict;
-
- if (!ctx) {
- return 0;
- }
-
- dict = (dictionary *)ctx->private_data;
-
- iniparser_freedict(dict);
-
- return 0;
-}
-
-int gp_iniparser_get_nsec(struct gp_ini_context *ctx)
-{
- dictionary *dict = dict = (dictionary *)ctx->private_data;
-
- return iniparser_getnsec(dict);
-}
-
-char *gp_iniparser_get_secname(struct gp_ini_context *ctx,
- int i)
-{
- dictionary *dict = dict = (dictionary *)ctx->private_data;
- char *value;
-
- value = iniparser_getsecname(dict, i);
- if (!value) {
- return NULL;
- }
-
- return strdup(value);
-}
-
-#endif /* WITH_INIPARSER */
diff --git a/proxy/src/gp_config_iniparser.h b/proxy/src/gp_config_iniparser.h
deleted file mode 100644
index 8fc3200..0000000
--- a/proxy/src/gp_config_iniparser.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- GSS-PROXY
-
- Copyright (C) 2011 Red Hat, Inc.
- Copyright (C) 2011 Simo Sorce <simo.sorce@redhat.com>
- Copyright (C) 2012 Guenther Deschner <guenther.deschner@redhat.com>
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-*/
-
-#include "gp_config.h"
-
-int gp_iniparser_get_string(struct gp_ini_context *ctx,
- const char *secname,
- const char *key,
- char **value);
-int gp_iniparser_get_int(struct gp_ini_context *ctx,
- const char *secname,
- const char *key,
- int *value);
-int gp_iniparser_init(const char *config_file,
- struct gp_ini_context *ctx);
-int gp_iniparser_close(struct gp_ini_context *ctx);
-int gp_iniparser_get_nsec(struct gp_ini_context *ctx);
-char *gp_iniparser_get_secname(struct gp_ini_context *ctx,
- int i);