diff options
Diffstat (limited to 'coreutils/mv.c')
-rw-r--r-- | coreutils/mv.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/coreutils/mv.c b/coreutils/mv.c index 5d02196e3..613d4ac46 100644 --- a/coreutils/mv.c +++ b/coreutils/mv.c | |||
@@ -71,7 +71,8 @@ int mv_main(int argc, char **argv) | |||
71 | } | 71 | } |
72 | 72 | ||
73 | DO_MOVE: | 73 | DO_MOVE: |
74 | if (dest_exists && !(flags & OPT_FILEUTILS_FORCE) | 74 | if (dest_exists |
75 | && !(flags & OPT_FILEUTILS_FORCE) | ||
75 | && ((access(dest, W_OK) < 0 && isatty(0)) | 76 | && ((access(dest, W_OK) < 0 && isatty(0)) |
76 | || (flags & OPT_FILEUTILS_INTERACTIVE)) | 77 | || (flags & OPT_FILEUTILS_INTERACTIVE)) |
77 | ) { | 78 | ) { |
@@ -108,6 +109,9 @@ int mv_main(int argc, char **argv) | |||
108 | goto RET_1; | 109 | goto RET_1; |
109 | } | 110 | } |
110 | } | 111 | } |
112 | /* FILEUTILS_RECUR also prevents nasties like | ||
113 | * "read from device and write contents to dst" | ||
114 | * instead of "create same device node" */ | ||
111 | copy_flag = FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS; | 115 | copy_flag = FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS; |
112 | #if ENABLE_SELINUX | 116 | #if ENABLE_SELINUX |
113 | copy_flag |= FILEUTILS_PRESERVE_SECURITY_CONTEXT; | 117 | copy_flag |= FILEUTILS_PRESERVE_SECURITY_CONTEXT; |