Skip to content

Commit f545064

Browse files
committed
src,permission: add debug log on is_tree_granted
Signed-off-by: RafaelGSS <[email protected]>
1 parent e72761f commit f545064

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/permission/fs_permission.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,16 @@ bool is_tree_granted(
6969
resolved_param.erase(0, 2);
7070
}
7171
#endif
72-
return granted_tree->Lookup(resolved_param, true);
72+
auto _is_granted = granted_tree->Lookup(resolved_param, true);
73+
if (node::per_process::enabled_debug_list.enabled(
74+
node::DebugCategory::PERMISSION_MODEL)) [[unlikely]] {
75+
node::per_process::Debug(node::DebugCategory::PERMISSION_MODEL,
76+
"Access %d to %s\n",
77+
_is_granted,
78+
param);
79+
}
80+
81+
return _is_granted;
7382
}
7483

7584
static const char* kBoxDrawingsLightUpAndRight = "└─ ";

0 commit comments

Comments
 (0)