mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-13 18:12:03 +08:00
if the loading of default config in the new location fails, try the old default file.
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
#include <vpn.h>
|
#include <vpn.h>
|
||||||
#include <tlslib.h>
|
#include <tlslib.h>
|
||||||
|
|
||||||
|
#define OLD_DEFAULT_CFG_FILE "/etc/ocserv.conf"
|
||||||
#define DEFAULT_CFG_FILE "/etc/ocserv/ocserv.conf"
|
#define DEFAULT_CFG_FILE "/etc/ocserv/ocserv.conf"
|
||||||
|
|
||||||
static const char* pid_file = NULL;
|
static const char* pid_file = NULL;
|
||||||
@@ -245,6 +246,9 @@ unsigned prefix = 0;
|
|||||||
unsigned force_cert_auth;
|
unsigned force_cert_auth;
|
||||||
|
|
||||||
pov = configFileLoad(file);
|
pov = configFileLoad(file);
|
||||||
|
if (pov == NULL && file != NULL && strcmp(file, DEFAULT_CFG_FILE) == 0)
|
||||||
|
pov = configFileLoad(OLD_DEFAULT_CFG_FILE);
|
||||||
|
|
||||||
if (pov == NULL) {
|
if (pov == NULL) {
|
||||||
fprintf(stderr, "Error loading config file %s\n", file);
|
fprintf(stderr, "Error loading config file %s\n", file);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user