From: José Bollo Date: Tue, 2 Sep 2014 13:11:55 +0000 (+0200) Subject: Improvement of tagging directories. X-Git-Tag: accepted/tizen/common/20141121.095621~10 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fsecurity%2Fsecurity-manager.git;a=commitdiff_plain;h=192eb07965994e541d0b6f8da1137328e9a1607b Improvement of tagging directories. The directories are visited two times: in pre-order and post-order. Here to avoid tagging at both times we choose to simply tag in post-order (that is for simplicity of the code. Change-Id: I866481471d433036ca371035c74e583b3a9dcfda Signed-off-by: José Bollo --- diff --git a/src/server/service/smack-labels.cpp b/src/server/service/smack-labels.cpp index 040cf70..ff447eb 100644 --- a/src/server/service/smack-labels.cpp +++ b/src/server/service/smack-labels.cpp @@ -125,6 +125,10 @@ static bool dirSetSmack(const std::string &path, const std::string &label, return false; } + /* avoid to tag directories two times */ + if (ftsent->fts_info == FTS_D) + continue; + ret = fn(ftsent); if (ret == FileDecision::ERROR) { LogError("fn(ftsent) failed.");