diff options
Diffstat (limited to 'src/firejail/landlock.c')
-rw-r--r-- | src/firejail/landlock.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/firejail/landlock.c b/src/firejail/landlock.c index 11de2e297..a5fd55232 100644 --- a/src/firejail/landlock.c +++ b/src/firejail/landlock.c | |||
@@ -206,6 +206,8 @@ int ll_restrict(uint32_t flags) { | |||
206 | if (!ll_is_supported()) | 206 | if (!ll_is_supported()) |
207 | return 0; | 207 | return 0; |
208 | 208 | ||
209 | timetrace_start(); | ||
210 | |||
209 | if (arg_debug) | 211 | if (arg_debug) |
210 | fprintf(stderr, "%s: Starting Landlock restrict\n", __func__); | 212 | fprintf(stderr, "%s: Starting Landlock restrict\n", __func__); |
211 | 213 | ||
@@ -218,7 +220,9 @@ int ll_restrict(uint32_t flags) { | |||
218 | }; | 220 | }; |
219 | 221 | ||
220 | LandlockEntry *ptr = cfg.lprofile; | 222 | LandlockEntry *ptr = cfg.lprofile; |
223 | int rules = 0; | ||
221 | while (ptr) { | 224 | while (ptr) { |
225 | rules++; | ||
222 | fnc[ptr->type](ptr->data); | 226 | fnc[ptr->type](ptr->data); |
223 | ptr = ptr->next; | 227 | ptr = ptr->next; |
224 | } | 228 | } |
@@ -239,8 +243,8 @@ int ll_restrict(uint32_t flags) { | |||
239 | __func__, strerror(errno)); | 243 | __func__, strerror(errno)); |
240 | goto out; | 244 | goto out; |
241 | } | 245 | } |
242 | if (arg_debug) | 246 | fmessage("%d Landlock rules initialized in %0.2f ms\n", rules, timetrace_end()); |
243 | fprintf(stderr, "%s: Enforcing Landlock\n", __func__); | 247 | |
244 | out: | 248 | out: |
245 | close(ll_ruleset_fd); | 249 | close(ll_ruleset_fd); |
246 | return error; | 250 | return error; |