Correct bug introduced by patch 8ee07d7.
authorRafal Krypa <r.krypa@samsung.com>
Tue, 5 Feb 2013 14:13:56 +0000 (15:13 +0100)
committerTomasz Swierczek <t.swierczek@samsung.com>
Wed, 6 Feb 2013 13:52:51 +0000 (14:52 +0100)
[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

index cf78a26..b058f09 100644 (file)
@@ -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. */