We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b05debe commit c4b0a89Copy full SHA for c4b0a89
backhand-cli/src/bin/unsquashfs.rs
@@ -205,7 +205,14 @@ fn main() -> ExitCode {
205
return ExitCode::SUCCESS;
206
}
207
208
- let squashfs = Squashfs::from_reader_with_offset_and_kind(file, args.offset, kind).unwrap();
+ let squashfs = match Squashfs::from_reader_with_offset_and_kind(file, args.offset, kind) {
209
+ Ok(s) => s,
210
+ Err(_e) => {
211
+ let line = format!("{:>14}", red_bold.apply_to(format!("Could not read image: {_e}")));
212
+ pb.finish_with_message(line);
213
+ return ExitCode::FAILURE;
214
+ }
215
+ };
216
let root_process = unsafe { geteuid() == 0 };
217
if root_process {
218
umask(Mode::from_bits(0).unwrap());
0 commit comments