From baf8b495a05861db3860891c32a416cdfc950909 Mon Sep 17 00:00:00 2001 From: bug1 Date: Fri, 23 Jan 2004 20:28:53 +0000 Subject: Dont change ownership unless we created the directory. git-svn-id: svn://busybox.net/trunk/busybox@8336 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- coreutils/install.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'coreutils/install.c') 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); -- cgit v1.2.3-55-g6feb