diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-17 00:35:15 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-17 00:35:15 +0000 |
commit | a6163ca355464b34513723b82ba24f0d001d8332 (patch) | |
tree | d848b80df74bc965f990bf88fd5fc68ac46a432b /coreutils | |
parent | ab47eeee6aeadd5afd78026d34dfcea129e63dce (diff) | |
download | busybox-w32-a6163ca355464b34513723b82ba24f0d001d8332.tar.gz busybox-w32-a6163ca355464b34513723b82ba24f0d001d8332.tar.bz2 busybox-w32-a6163ca355464b34513723b82ba24f0d001d8332.zip |
install: fix install a b /a/link/to/dir
install: fix -s (strip) option
nmeter: add TODO
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/install.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/coreutils/install.c b/coreutils/install.c index 7f168d2fd..5503b55cd 100644 --- a/coreutils/install.c +++ b/coreutils/install.c | |||
@@ -102,7 +102,8 @@ int install_main(int argc, char **argv) | |||
102 | opt_complementary = "?:s--d:d--s" USE_SELINUX(":Z--\xff:\xff--Z"); | 102 | opt_complementary = "?:s--d:d--s" USE_SELINUX(":Z--\xff:\xff--Z"); |
103 | /* -c exists for backwards compatibility, it's needed */ | 103 | /* -c exists for backwards compatibility, it's needed */ |
104 | 104 | ||
105 | flags = getopt32(argc, argv, "cdpsg:m:o:" USE_SELINUX("Z:"), &gid_str, &mode_str, &uid_str USE_SELINUX(, &scontext)); | 105 | flags = getopt32(argc, argv, "cdpsg:m:o:" USE_SELINUX("Z:"), |
106 | &gid_str, &mode_str, &uid_str USE_SELINUX(, &scontext)); | ||
106 | 107 | ||
107 | #if ENABLE_SELINUX | 108 | #if ENABLE_SELINUX |
108 | if (flags & OPT_PRESERVE_SECURITY_CONTEXT) { | 109 | if (flags & OPT_PRESERVE_SECURITY_CONTEXT) { |
@@ -165,7 +166,8 @@ int install_main(int argc, char **argv) | |||
165 | return ret; | 166 | return ret; |
166 | } | 167 | } |
167 | 168 | ||
168 | isdir = lstat(argv[argc - 1], &statbuf) < 0 ? 0 : S_ISDIR(statbuf.st_mode); | 169 | /* coreutils install resolves link in this case, don't use lstat */ |
170 | isdir = stat(argv[argc - 1], &statbuf) < 0 ? 0 : S_ISDIR(statbuf.st_mode); | ||
169 | 171 | ||
170 | for (i = optind; i < argc - 1; i++) { | 172 | for (i = optind; i < argc - 1; i++) { |
171 | char *dest; | 173 | char *dest; |
@@ -192,7 +194,11 @@ int install_main(int argc, char **argv) | |||
192 | ret = EXIT_FAILURE; | 194 | ret = EXIT_FAILURE; |
193 | } | 195 | } |
194 | if (flags & OPT_STRIP) { | 196 | if (flags & OPT_STRIP) { |
195 | if (BB_EXECLP("strip", "strip", dest, NULL) == -1) { | 197 | char *args[3]; |
198 | args[0] = (char*)"strip"; | ||
199 | args[1] = dest; | ||
200 | args[2] = NULL; | ||
201 | if (spawn_and_wait(args)) { | ||
196 | bb_perror_msg("strip"); | 202 | bb_perror_msg("strip"); |
197 | ret = EXIT_FAILURE; | 203 | ret = EXIT_FAILURE; |
198 | } | 204 | } |