commit ac10ca42df0ba80f2bccabac01a0722c6807e1d1
parent 5e099b8801eba9d22c0416447c568bef534ac1b9
Author: Florian Dold <dold@taler.net>
Date: Tue, 21 Jul 2026 19:49:16 +0200
util: load only .conf files from the default config directory
Every directory entry was parsed, so a README aborted the load outright,
and now that the listing is sorted a foo.conf~ backup would sort after
foo.conf and override it.
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/packages/taler-util/src/talerconfig.ts b/packages/taler-util/src/talerconfig.ts
@@ -782,6 +782,14 @@ export class Configuration {
const files = nodejs_fs.readdirSync(dirname).sort(compareFilenames);
for (const f of files) {
const fn = nodejs_path.join(dirname, f);
+ // Only ".conf" files are configuration, as in the C reference. The
+ // directory routinely also holds READMEs and editor backups, and a
+ // backup would otherwise sort after the file it backs up and override
+ // it.
+ if (!f.endsWith(".conf")) {
+ logger.warn(`skipping file ${fn}`);
+ continue;
+ }
this.loadFromFilename(fn, true);
}
}