aboutsummaryrefslogtreecommitdiff
path: root/coreutils
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 /coreutils
parent578eff50667a2192905c68073f97bc6aa21cebe7 (diff)
downloadbusybox-711bb92d7cd4cc00d3462414d85e3b15c6f2cd1b.tar.gz
Dont change ownership unless we created the directory.
Diffstat (limited to 'coreutils')
-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)
*argv_ptr = '\0';
old_argv_ptr++;
}
- if ((mkdir(*argv, mode) == -1) && (errno != EEXIST)) {
- bb_perror_msg("coulnt create %s", *argv);
- ret = EXIT_FAILURE;
- break;
+ if (mkdir(*argv, mode) == -1) {
+ if (errno != EEXIST) {
+ bb_perror_msg("coulnt create %s", *argv);
+ ret = EXIT_FAILURE;
+ break;
+ }
}
else if (lchown(*argv, uid, gid) == -1) {
bb_perror_msg("cannot change ownership of %s", *argv);