diff --git a/src/uu/cksum/src/cksum.rs b/src/uu/cksum/src/cksum.rs index e8d7da60e..77f274944 100644 --- a/src/uu/cksum/src/cksum.rs +++ b/src/uu/cksum/src/cksum.rs @@ -169,6 +169,13 @@ where (ALGORITHM_OPTIONS_CRC, true) => println!("{sum} {sz}"), (ALGORITHM_OPTIONS_CRC, false) => println!("{sum} {sz} {}", filename.display()), (ALGORITHM_OPTIONS_BLAKE2B, _) if !options.untagged => { + if filename.is_dir() { + return Err(io::Error::new( + io::ErrorKind::InvalidInput, + format!("{}: Is a directory", filename.display()), + ) + .into()); + } if let Some(length) = options.length { // Multiply by 8 here, as we want to print the length in bits. println!("BLAKE2b-{} ({}) = {sum}", length * 8, filename.display());