Correct debug in dir_set_smack_r().
authorRafal Krypa <r.krypa@samsung.com>
Mon, 4 Feb 2013 18:40:28 +0000 (19:40 +0100)
committerTomasz Swierczek <t.swierczek@samsung.com>
Tue, 5 Feb 2013 09:13:59 +0000 (10:13 +0100)
[Issue#]       N/A
[Bug]          Debug log about setting Smack label on file is printed even for files don't matching the mask.
[Cause]        Debug log misplaced.
[Solution]     Move the log inside if block, checking whether file should be labeled.
[Verification] Build.

Change-Id: I1d83ca6986be8e4a47818e69738a66deda1b9b74

src/privilege-control.c

index a9a6a99..b68bcae 100644 (file)
@@ -613,8 +613,8 @@ static int dir_set_smack_r(const char *path, const char* label,
                        goto out;
                }
 
-               C_LOGD("smack_lsetlabel (label: %s (type: %d), path: %s)", label, type, ftsent->fts_path);
                if (ftsent->fts_statp->st_mode & S_IFMT & 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;