aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2004-01-23 20:28:53 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2004-01-23 20:28:53 +0000
commit711bb92d7cd4cc00d3462414d85e3b15c6f2cd1b (patch)
tree42971a775872e40fae2f259320aa71f9325cd03f
parent578eff50667a2192905c68073f97bc6aa21cebe7 (diff)
downloadbusybox-w32-711bb92d7cd4cc00d3462414d85e3b15c6f2cd1b.tar.gz
busybox-w32-711bb92d7cd4cc00d3462414d85e3b15c6f2cd1b.tar.bz2
busybox-w32-711bb92d7cd4cc00d3462414d85e3b15c6f2cd1b.zip
Dont change ownership unless we created the directory.
-rw-r--r--coreutils/install.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/coreutils/install.c b/coreutils/install.c
index 657962c51..3128c5bd9 100644
--- a/coreutils/install.c
+++ b/coreutils/install.c
@@ -80,10 +80,12 @@ extern int install_main(int argc, char **argv)
80 *argv_ptr = '\0'; 80 *argv_ptr = '\0';
81 old_argv_ptr++; 81 old_argv_ptr++;
82 } 82 }
83 if ((mkdir(*argv, mode) == -1) && (errno != EEXIST)) { 83 if (mkdir(*argv, mode) == -1) {
84 bb_perror_msg("coulnt create %s", *argv); 84 if (errno != EEXIST) {
85 ret = EXIT_FAILURE; 85 bb_perror_msg("coulnt create %s", *argv);
86 break; 86 ret = EXIT_FAILURE;
87 break;
88 }
87 } 89 }
88 else if (lchown(*argv, uid, gid) == -1) { 90 else if (lchown(*argv, uid, gid) == -1) {
89 bb_perror_msg("cannot change ownership of %s", *argv); 91 bb_perror_msg("cannot change ownership of %s", *argv);