Skip to content

Commit 95e2e76

Browse files
committed
Added comment on possible error and wording in the expect message.
1 parent 9b97777 commit 95e2e76

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • rust/krb5-provision-keytab/src

rust/krb5-provision-keytab/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub enum AdminBackend {
3434
generate_sam_account_name: Option<ActiveDirectorySamAccountNameRules>,
3535
},
3636
}
37+
3738
#[derive(Serialize, Deserialize, Debug)]
3839
pub struct ActiveDirectorySamAccountNameRules {
3940
pub prefix: String,
@@ -96,7 +97,10 @@ pub async fn provision_keytab(krb5_config_path: &Path, req: &Request) -> Result<
9697
let mut stdin = child
9798
.stdin
9899
.take()
99-
.expect("Failed to read from stdin of stackable-krb5-provision-keytab command! ");
100+
// a failure here has some fundamental reason like us taking ownership of the pipe
101+
// earlier, which is most probably more a coding than a runtime error - this is
102+
// why this error is not handled here, but we panic instead
103+
.expect("Failed to take ownership of stdin pipe of stackable-krb5-provision-keytab command! ");
100104
stdin.write_all(&req_str).await.context(WriteRequestSnafu)?;
101105
stdin.flush().await.context(WriteRequestSnafu)?;
102106
drop(stdin);

0 commit comments

Comments
 (0)