diff options
Diffstat (limited to 'src/apparmor.c')
-rw-r--r-- | src/apparmor.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/apparmor.c b/src/apparmor.c index 5f36f3064..cbfa2aa88 100644 --- a/src/apparmor.c +++ b/src/apparmor.c @@ -16,6 +16,11 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* + * This is an open source non-commercial project. Dear PVS-Studio, please check it. + * PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + */ + #include <config.h> #ifdef HAVE_APPARMOR @@ -39,7 +44,8 @@ apparmor_is_enabled(void) FILE *fd; debug_decl(apparmor_is_enabled, SUDO_DEBUG_APPARMOR); - /* Check whether AppArmor is enabled by reading + /* + * Check whether AppArmor is enabled by reading * /sys/module/apparmor/parameters/enabled * * When this file exists and its contents are equal to "Y", AppArmor @@ -88,20 +94,21 @@ apparmor_prepare(const char *new_profile) goto done; } - if (mode == NULL) + if (mode == NULL) { sudo_debug_printf(SUDO_DEBUG_INFO, - "%s: changing AppArmor profile: %s -> %s", __func__, - old_profile, new_profile ? new_profile : "?" - ); - else + "%s: changing AppArmor profile: %s -> %s", __func__, + old_profile, new_profile ? new_profile : "?"); + } else { sudo_debug_printf(SUDO_DEBUG_INFO, - "%s: changing AppArmor profile: %s (%s) -> %s", __func__, - old_profile, mode, new_profile ? new_profile : "?" - ); + "%s: changing AppArmor profile: %s (%s) -> %s", __func__, + old_profile, mode, new_profile ? new_profile : "?"); + } done: - /* The profile string returned by aa_getcon must be free'd, while the - * mode string must _not_ be free'd */ + /* + * The profile string returned by aa_getcon must be free'd, while the + * mode string must _not_ be free'd. + */ if (old_profile != NULL) free(old_profile); |