diff options
author | Elliott Hughes <enh@google.com> | 2015-08-30 06:35:30 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-08-30 06:35:30 -0500 |
commit | f1f20b9306ed3658e9433e00e78f2ac640d0160d (patch) | |
tree | fda6dc67905671272119bf9e2095c43886e01737 /tests/mv.test | |
parent | e96dd0716e5932625af9e8a91bfa3d989abe1fdb (diff) | |
download | toybox-f1f20b9306ed3658e9433e00e78f2ac640d0160d.tar.gz |
Fix mv on overwrite.
We need to remove the destination, not the source, to be able to overwrite.
Diffstat (limited to 'tests/mv.test')
-rwxr-xr-x | tests/mv.test | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/mv.test b/tests/mv.test index 53fc9992..030e9ccc 100755 --- a/tests/mv.test +++ b/tests/mv.test @@ -96,3 +96,10 @@ touch file1 file2 testing "Move -n file new_file (exist)" "mv -n file1 file2 && [ -e file1 -a -e file2 ] && echo 'yes'" "yes\n" "" "" rm -f file* + +touch file1 file2 +chmod 400 file1 file2 +testing "Move file over unwritable file with no stdin" \ + "</dev/null mv file2 file1 && [ -e file -a ! -e file2 ] && echo 'yes'" \ + "yes\n" "" "" +rm -f file* |