acme: new_account: prevent replacing existing accounts

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2021-10-22 08:35:24 +02:00
parent 7a356a748a
commit 0a33951e9e

View File

@ -139,7 +139,7 @@ impl AcmeClient {
let account_path = account_path(account_name.as_ref());
let file = OpenOptions::new()
.write(true)
.create(true)
.create_new(true)
.mode(0o600)
.open(&account_path)
.map_err(|err| format_err!("failed to open {:?} for writing: {}", account_path, err))?;