mirror of
https://github.com/sheumann/hush.git
synced 2024-09-12 15:54:56 +00:00
Dont change ownership unless we created the directory.
This commit is contained in:
parent
578eff5066
commit
711bb92d7c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user