Fix segfault in DLOG in dir_set_smack_r function.
authorJanusz Kozerski <j.kozerski@samsung.com>
Mon, 4 Feb 2013 15:36:29 +0000 (16:36 +0100)
committerTomasz Swierczek <t.swierczek@samsung.com>
Tue, 5 Feb 2013 09:13:47 +0000 (10:13 +0100)
[Issue#]       N/A
[Bug]          Segfult in dir_set_smack_r function.
[Cause]        Wrong DLOG agrument - printing enum like a string.
[Solution]     Fix print format.
[Verification] Build libprivilege with WRT_SMACK_ENABLE and run libprivilege-control tests.

Change-Id: I7be2f912537a4585afdcf9cc088eea340dfb0c74

src/privilege-control.c

index ccae127..a9a6a99 100644 (file)
@@ -613,7 +613,7 @@ static int dir_set_smack_r(const char *path, const char* label,
                        goto out;
                }
 
-               C_LOGD("smack_lsetlabel (label: %s (type: %s), path: %s)", label, type, ftsent->fts_path);
+               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)
                        if (smack_lsetlabel(ftsent->fts_path, label, type) != 0) {
                                C_LOGE("smack_lsetlabel failed");