From: sagivd Date: Sat, 25 Aug 2018 10:49:24 +0000 (+0300) Subject: chcon: fix issues with recurse and retval for retained files X-Git-Tag: 1_30_0~450 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8f1ae256347b32057d32846f915f53f9106f00bc;p=oweals%2Fbusybox.git chcon: fix issues with recurse and retval for retained files - recurse is not acting as expected (looks like broken old code) - when not using verbose output, return value for retained files is 1, which is not expected. Signed-off-by: sagivd Signed-off-by: Denys Vlasenko --- diff --git a/selinux/chcon.c b/selinux/chcon.c index 3ddb2dd46..92eb76737 100644 --- a/selinux/chcon.c +++ b/selinux/chcon.c @@ -131,8 +131,10 @@ static int FAST_FUNC change_filedir_context( bb_error_msg("can't change context of %s to %s", fname, context_string); } - } else if (option_mask32 & OPT_VERBOSE) { - printf("context of %s retained as %s\n", fname, context_string); + } else { + if (option_mask32 & OPT_VERBOSE) { + printf("context of %s retained as %s\n", fname, context_string); + } rc = TRUE; } skip: @@ -202,7 +204,7 @@ int chcon_main(int argc UNUSED_PARAM, char **argv) fname[fname_len] = '\0'; if (recursive_action(fname, - 1<