Skip to content

Commit 58f7e70

Browse files
committed
Rust: EC2 Getting Started fix awsdocs#7031 invalid OpenOptions creating keyfile
1 parent 28b5af9 commit 58f7e70

File tree

1 file changed

+3
-0
lines changed
  • rustv1/examples/ec2/src/getting_started

1 file changed

+3
-0
lines changed

rustv1/examples/ec2/src/getting_started/util.rs

+3
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ impl UtilImpl {
132132
fn open_file_0600(path: &PathBuf) -> Result<std::fs::File, EC2Error> {
133133
use std::os::unix::fs::OpenOptionsExt;
134134
std::fs::OpenOptions::new()
135+
.write(true)
136+
.create(true)
137+
.truncate(true)
135138
.mode(0o600)
136139
.open(path.clone())
137140
.map_err(|e| EC2Error::new(format!("Failed to create {path:?} ({e:?})")))

0 commit comments

Comments
 (0)