Skip to content

Commit 91d2185

Browse files
authored
fix: Do not allow sharing . (#105)
* Do not allow sharing . We create a temp dir in ., and it will be changing over time. We could filter it out, but that's a can of worms. So for now just forbid sharing . * Add comment about . limitation
1 parent 519ef0c commit 91d2185

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,12 @@ async fn send(args: SendArgs) -> anyhow::Result<()> {
671671
);
672672
std::process::exit(1);
673673
}
674+
// todo: remove this as soon as we have a mem store that does not require a temp dir,
675+
// or create a temp dir outside the current directory.
676+
if cwd.join(&args.path) == cwd {
677+
println!("can not share from the current directory");
678+
std::process::exit(1);
679+
}
674680

675681
let mut mp = MultiProgress::new();
676682
let mp2 = mp.clone();

0 commit comments

Comments
 (0)