From 3c58a54570cfcebaff16d713fcfa02426152c824 Mon Sep 17 00:00:00 2001 From: venaas Date: Tue, 15 Apr 2008 13:05:18 +0000 Subject: include argument now relative to current config file, also never try to open master config basename git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@230 e88ac4ed-0b26-0410-9574-a7f39faa03bf --- radsecproxy.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'radsecproxy.c') diff --git a/radsecproxy.c b/radsecproxy.c index 030ffba..c5c5375 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -2581,28 +2581,12 @@ void addrealm(char *value, char **servers, char *message) { debug(DBG_DBG, "addrealm: added realm %s", value); } -struct gconffile *openconfigfile(const char *filename) { - FILE *f; - char pathname[100], *base = NULL; +struct gconffile *openconfigfile(const char *file) { struct gconffile *cf = NULL; - - f = pushgconffile(&cf, filename); - if (f) { - debug(DBG_DBG, "reading config file %s", filename); - return cf; - } - if (strlen(filename) + 1 <= sizeof(pathname)) { - /* basename() might modify the string */ - strcpy(pathname, filename); - base = basename(pathname); - f = pushgconffile(&cf, base); - } - - if (!f) - debugx(1, DBG_ERR, "could not read config file %s nor %s\n%s", filename, base, strerror(errno)); - - debug(DBG_DBG, "reading config file %s", base); + if (!pushgconffile(&cf, file)) + debugx(1, DBG_ERR, "could not read config file %s\n%s", file, strerror(errno)); + debug(DBG_DBG, "reading config file %s", file); return cf; } @@ -3020,7 +3004,6 @@ void getmainconfig(const char *configfile) { "Rewrite", CONF_CBK, confrewrite_cb, NULL ); - popgconffile(&cfs); tlsfree(); rewritefree(); -- cgit v1.1