diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-10 16:58:49 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-10 16:58:49 +0000 |
commit | 49622d784672bf2f7b2fe80589714cdef5adde0c (patch) | |
tree | 892bb79b0ef031d729e688d6be4950f6d17f13b9 /coreutils/mv.c | |
parent | 4eb8b936cb0aeb27c3e12f9a93fc43aa1e9668f5 (diff) | |
download | busybox-w32-49622d784672bf2f7b2fe80589714cdef5adde0c.tar.gz busybox-w32-49622d784672bf2f7b2fe80589714cdef5adde0c.tar.bz2 busybox-w32-49622d784672bf2f7b2fe80589714cdef5adde0c.zip |
selinux support by Yuichi Nakamura <ynakam@hitachisoft.jp> (HitachiSoft)
Diffstat (limited to 'coreutils/mv.c')
-rw-r--r-- | coreutils/mv.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/coreutils/mv.c b/coreutils/mv.c index 7d4905fc9..64cae965b 100644 --- a/coreutils/mv.c +++ b/coreutils/mv.c | |||
@@ -3,6 +3,7 @@ | |||
3 | * Mini mv implementation for busybox | 3 | * Mini mv implementation for busybox |
4 | * | 4 | * |
5 | * Copyright (C) 2000 by Matt Kraai <kraai@alumni.carnegiemellon.edu> | 5 | * Copyright (C) 2000 by Matt Kraai <kraai@alumni.carnegiemellon.edu> |
6 | * SELinux support by Yuichi Nakamura <ynakam@hitachisoft.jp> | ||
6 | * | 7 | * |
7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 8 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
8 | */ | 9 | */ |
@@ -44,6 +45,7 @@ int mv_main(int argc, char **argv) | |||
44 | unsigned long flags; | 45 | unsigned long flags; |
45 | int dest_exists; | 46 | int dest_exists; |
46 | int status = 0; | 47 | int status = 0; |
48 | int copy_flag = 0; | ||
47 | 49 | ||
48 | #if ENABLE_FEATURE_MV_LONG_OPTIONS | 50 | #if ENABLE_FEATURE_MV_LONG_OPTIONS |
49 | applet_long_options = mv_long_options; | 51 | applet_long_options = mv_long_options; |
@@ -113,8 +115,11 @@ DO_MOVE: | |||
113 | goto RET_1; | 115 | goto RET_1; |
114 | } | 116 | } |
115 | } | 117 | } |
116 | if ((copy_file(*argv, dest, | 118 | copy_flag = FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS; |
117 | FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS) >= 0) && | 119 | #if ENABLE_SELINUX |
120 | copy_flag |= FILEUTILS_PRESERVE_SECURITY_CONTEXT; | ||
121 | #endif | ||
122 | if ((copy_file(*argv, dest, copy_flag) >= 0) && | ||
118 | (remove_file(*argv, FILEUTILS_RECUR | FILEUTILS_FORCE) >= 0)) { | 123 | (remove_file(*argv, FILEUTILS_RECUR | FILEUTILS_FORCE) >= 0)) { |
119 | goto RET_0; | 124 | goto RET_0; |
120 | } | 125 | } |