← Commit list

3c12ff7c8

Rob Landley
Rob Landley
2005-07-20
FAILED Duration: 21s

Subject

If /tmp and /home were different partitions, then "mv /tmp/file /home/file" would delete /home/file even if /tmp/file didn't exist.

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/mv.c+3 -3
@@ -99,10 +99,10 @@ DO_MOVE:
struct stat source_stat;
int source_exists;
- if (errno != EXDEV) {
+ if (errno != EXDEV ||
+ (source_exists = cp_mv_stat(*argv, &source_stat)) < 1) {
bb_perror_msg("unable to rename `%s'", *argv);
- }
- else if ((source_exists = cp_mv_stat(*argv, &source_stat)) >= 0) {
+ } else {
if (dest_exists) {
if (dest_exists == 3) {
if (source_exists != 3) {