diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-21 16:55:29 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-21 16:55:29 +0100 |
commit | 43d9747f6e3c46fd230fe89344a9ebe4afd8eff5 (patch) | |
tree | 636ca45766acf200f8519c74587aa6825380f3d3 /coreutils | |
parent | 8ce1dc03c1b2b61e51527b987579c09c991cc4b2 (diff) | |
download | busybox-w32-43d9747f6e3c46fd230fe89344a9ebe4afd8eff5.tar.gz busybox-w32-43d9747f6e3c46fd230fe89344a9ebe4afd8eff5.tar.bz2 busybox-w32-43d9747f6e3c46fd230fe89344a9ebe4afd8eff5.zip |
install: strip before mode/uid/gid is set, not after.
function old new delta
install_main 694 716 +22
basename 21 - -21
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/install.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/coreutils/install.c b/coreutils/install.c index e9682990d..803afe617 100644 --- a/coreutils/install.c +++ b/coreutils/install.c | |||
@@ -167,12 +167,23 @@ int install_main(int argc, char **argv) | |||
167 | free(ddir); | 167 | free(ddir); |
168 | } | 168 | } |
169 | if (isdir) | 169 | if (isdir) |
170 | dest = concat_path_file(last, basename(arg)); | 170 | dest = concat_path_file(last, bb_basename(arg)); |
171 | if (copy_file(arg, dest, copy_flags)) { | 171 | if (copy_file(arg, dest, copy_flags) != 0) { |
172 | /* copy is not made */ | 172 | /* copy is not made */ |
173 | ret = EXIT_FAILURE; | 173 | ret = EXIT_FAILURE; |
174 | goto next; | 174 | goto next; |
175 | } | 175 | } |
176 | if (opts & OPT_STRIP) { | ||
177 | char *args[4]; | ||
178 | args[0] = (char*)"strip"; | ||
179 | args[1] = (char*)"-p"; /* -p --preserve-dates */ | ||
180 | args[2] = dest; | ||
181 | args[3] = NULL; | ||
182 | if (spawn_and_wait(args)) { | ||
183 | bb_perror_msg("strip"); | ||
184 | ret = EXIT_FAILURE; | ||
185 | } | ||
186 | } | ||
176 | } | 187 | } |
177 | 188 | ||
178 | /* Set the file mode (always, not only with -m). | 189 | /* Set the file mode (always, not only with -m). |
@@ -192,16 +203,6 @@ int install_main(int argc, char **argv) | |||
192 | bb_perror_msg("can't change %s of %s", "ownership", dest); | 203 | bb_perror_msg("can't change %s of %s", "ownership", dest); |
193 | ret = EXIT_FAILURE; | 204 | ret = EXIT_FAILURE; |
194 | } | 205 | } |
195 | if (opts & OPT_STRIP) { | ||
196 | char *args[3]; | ||
197 | args[0] = (char*)"strip"; | ||
198 | args[1] = dest; | ||
199 | args[2] = NULL; | ||
200 | if (spawn_and_wait(args)) { | ||
201 | bb_perror_msg("strip"); | ||
202 | ret = EXIT_FAILURE; | ||
203 | } | ||
204 | } | ||
205 | next: | 206 | next: |
206 | if (ENABLE_FEATURE_CLEAN_UP && isdir) | 207 | if (ENABLE_FEATURE_CLEAN_UP && isdir) |
207 | free(dest); | 208 | free(dest); |