mirror of
https://github.com/vgough/encfs.git
synced 2025-02-05 20:39:46 +01:00
Handle ENCFS6_CONFIG set to non-existing file
This used to give the confusing error Found config file %s, but failed to load - exiting
This commit is contained in:
parent
b2943eeed1
commit
5e834968b2
@ -363,7 +363,13 @@ ConfigType readConfig(const string &rootDir,
|
||||
// allow environment variable to override default config path
|
||||
if (nm->environmentOverride != NULL) {
|
||||
char *envFile = getenv(nm->environmentOverride);
|
||||
if (envFile != NULL) return readConfig_load(nm, envFile, config);
|
||||
if (envFile != NULL) {
|
||||
if (! fileExists(envFile)) {
|
||||
rError("fatal: config file specified by environment does not exist: %s", envFile);
|
||||
exit(1);
|
||||
}
|
||||
return readConfig_load(nm, envFile, config);
|
||||
}
|
||||
}
|
||||
// the standard place to look is in the root directory
|
||||
string path = rootDir + nm->fileName;
|
||||
|
Loading…
Reference in New Issue
Block a user