chiark / gitweb /
sshkeys: Do not include filename in context
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 1 Jun 2021 20:50:47 +0000 (21:50 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 1 Jun 2021 20:57:43 +0000 (21:57 +0100)
This gets printed when we log the AuthKeysManipError.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/sshkeys.rs

index ebff7b91e0f55acbd6a68a5b63eeedbab6657e58..30b7693dbcd418bb3a70c250284cfefce30483aa 100644 (file)
@@ -482,14 +482,13 @@ impl Global {
       }
       Ok::<_,AE>(())
     })()
-      .with_context(|| path.clone())
       .context("check authorized_keys magic/banner")?;
 
     let mut f = fs::OpenOptions::new()
       .write(true).truncate(true).create(true)
       .mode(0o644)
       .open(&tmp)
-      .with_context(|| tmp.clone()).context("open new auth keys file")?;
+      .context("open new auth keys file (.tmp)")?;
 
     let include = &config.authorized_keys_include;
 
@@ -500,7 +499,7 @@ impl Global {
                include)?;
       f.flush()?;
       Ok::<_,io::Error>(())
-    })().with_context(|| tmp.clone()).context("write header")?;
+    })().context("write header (to .tmp)")?;
 
     if let Some(mut sf) = match File::open(include) {
       Ok(y) => Some(y),