File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
rust/krb5-provision-keytab/src Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ use std::{
6
6
} ;
7
7
8
8
use serde:: { Deserialize , Serialize } ;
9
- use snafu:: { ResultExt , Snafu } ;
9
+ use snafu:: { OptionExt , ResultExt , Snafu } ;
10
10
use stackable_secret_operator_crd_utils:: SecretReference ;
11
11
use tokio:: { io:: AsyncWriteExt , process:: Command } ;
12
12
@@ -62,6 +62,9 @@ pub enum Error {
62
62
63
63
#[ snafu( display( "failed to write request" ) ) ]
64
64
WriteRequest { source : std:: io:: Error } ,
65
+
66
+ #[ snafu( display( "failed to obtain stdin for child process" ) ) ]
67
+ ChildStdin ,
65
68
}
66
69
67
70
/// Provisions a Kerberos Keytab based on the [`Request`].
@@ -93,7 +96,7 @@ pub async fn provision_keytab(krb5_config_path: &Path, req: &Request) -> Result<
93
96
// Get a `ChildStdin` object for the spawned process and write the serialized request
94
97
// for a Principal into it in order for the child process to deserialize it and
95
98
// process the request
96
- let mut stdin = child. stdin . take ( ) . unwrap ( ) ;
99
+ let mut stdin = child. stdin . take ( ) . context ( ChildStdinSnafu ) ? ;
97
100
stdin. write_all ( & req_str) . await . context ( WriteRequestSnafu ) ?;
98
101
stdin. flush ( ) . await . context ( WriteRequestSnafu ) ?;
99
102
drop ( stdin) ;
You can’t perform that action at this time.
0 commit comments