bitcoind: only make blocksdir group-readable when dataDirReadableByGroup

This commit is contained in:
nixbitcoin 2020-05-03 14:03:01 +02:00
parent 81a04a4ef1
commit 205fca3576
No known key found for this signature in database
GPG Key ID: DD11F9AD5308B3BA

View File

@ -268,7 +268,7 @@ in {
mkdir -m 0770 -p '${cfg.dataDir}/blocks' mkdir -m 0770 -p '${cfg.dataDir}/blocks'
fi fi
chown -R '${cfg.user}:${cfg.group}' '${cfg.dataDir}' chown -R '${cfg.user}:${cfg.group}' '${cfg.dataDir}'
chmod -R g+rX '${cfg.dataDir}/blocks' ${optionalString cfg.dataDirReadableByGroup "chmod -R g+rX '${cfg.dataDir}/blocks'"}
cfg=$(cat ${configFile}; printf "rpcpassword="; cat "${config.nix-bitcoin.secretsDir}/bitcoin-rpcpassword") cfg=$(cat ${configFile}; printf "rpcpassword="; cat "${config.nix-bitcoin.secretsDir}/bitcoin-rpcpassword")
confFile='${cfg.dataDir}/bitcoin.conf' confFile='${cfg.dataDir}/bitcoin.conf'