From: Rafal Krypa Date: Mon, 4 Feb 2013 18:40:28 +0000 (+0100) Subject: Correct debug in dir_set_smack_r(). X-Git-Tag: 2.1b_release~12^2^2~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41a9a61bbf03c25ba6956d676b0ac1227c471282;p=platform%2Fcore%2Fsecurity%2Flibprivilege-control.git Correct debug in dir_set_smack_r(). [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 --- diff --git a/src/privilege-control.c b/src/privilege-control.c index a9a6a99..b68bcae 100644 --- a/src/privilege-control.c +++ b/src/privilege-control.c @@ -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;