nixos/slurm: fix creation of slurmdbd config file

replace cp/chmod by install to avoid security issues.
See https://github.com/NixOS/nixpkgs/issues/121293
This commit is contained in:
Markus Kowalewski 2021-05-01 00:15:55 +02:00
parent a5c0b6fc95
commit d07185f986
No known key found for this signature in database
GPG Key ID: D865C8A91D7025EB

View File

@ -403,9 +403,7 @@ in
requires = [ "munged.service" "mysql.service" ];
preStart = ''
cp ${slurmdbdConf} ${configPath}
chmod 600 ${configPath}
chown ${cfg.user} ${configPath}
install -m 600 -o ${cfg.user} -T ${slurmdbdConf} ${configPath}
${optionalString (cfg.dbdserver.storagePassFile != null) ''
echo "StoragePass=$(cat ${cfg.dbdserver.storagePassFile})" \
>> ${configPath}