From 4d47cad1b5f3c08c7b2205ba666bfdc98021fd71 Mon Sep 17 00:00:00 2001 From: Rafal Krypa Date: Tue, 5 Feb 2013 15:13:56 +0100 Subject: [PATCH] Correct bug introduced by patch 8ee07d7. [Issue#] SSDWSSP-70 [Bug] Internal function dir_set_smack_r() ignores type mask argument. [Cause] Lack of curly brackets after if. [Solution] Fix the typo in code. [Verification] Build, install, run latest tests from security-tests package. Change-Id: Ibed39f9f103231c904d90299eadfaf93c0524b63 --- src/privilege-control.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/privilege-control.c b/src/privilege-control.c index cf78a26..b058f09 100644 --- a/src/privilege-control.c +++ b/src/privilege-control.c @@ -613,12 +613,13 @@ static int dir_set_smack_r(const char *path, const char* label, goto out; } - if (ftsent->fts_statp->st_mode & type_mask) + if (ftsent->fts_statp->st_mode & type_mask) { C_LOGD("smack_lsetlabel (label: %s (type: %d), path: %s)", label, type, ftsent->fts_path); if (smack_lsetlabel(ftsent->fts_path, label, type) != 0) { C_LOGE("smack_lsetlabel failed"); goto out; } + } } /* If last call to fts_read() set errno, we need to return error. */ -- 2.7.4