Merge pull request #163383 from Lassulus/tor_newlines

nixos/tor: admit newlines in secret key
This commit is contained in:
Lassulus 2022-03-09 19:19:39 +01:00 committed by GitHub
commit 155c02837b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -962,7 +962,7 @@ in
'') onion.authorizedClients ++
optional (onion.secretKey != null) ''
install -d -o tor -g tor -m 0700 ${escapeShellArg onion.path}
key="$(cut -f1 -d: ${escapeShellArg onion.secretKey})"
key="$(cut -f1 -d: ${escapeShellArg onion.secretKey} | head -1)"
case "$key" in
("== ed25519v"*"-secret")
install -o tor -g tor -m 0400 ${escapeShellArg onion.secretKey} ${escapeShellArg onion.path}/hs_ed25519_secret_key;;