Commit 9f33051
committed
mctpd: Allow mctpd to manage its capabilities.
Added the set_cap() function to mctpd, allowing the process to drop
CAP_NET_BIND_SERVICE when it is no longer needed. This requires libcap
on the target device. If libcap is missing drop_bind_cap() will be a
stub, and mctpd will emit a warning when it starts.
Because mctpd requires additional capabilities and may recieve hostile
inputs, dropping the capability when it is no longer needed is useful to
increase safety.
libcap has been added as a possible dependency to the meson build and
mcpd now uses the MCTPD_MANAGING_CAPABILITIES macro to determine if
libcap is available.
mctpd.md has been updated to reflect the new capability management.
Signed-off-by: James Lee <james@codeconstruct.com.au>1 parent 3cd2da6 commit 9f33051
3 files changed
Lines changed: 73 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
| |||
89 | 95 | | |
90 | 96 | | |
91 | 97 | | |
92 | | - | |
| 98 | + | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
| |||
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
103 | | - | |
| 109 | + | |
104 | 110 | | |
105 | 111 | | |
106 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
6342 | 6346 | | |
6343 | 6347 | | |
6344 | 6348 | | |
| 6349 | + | |
| 6350 | + | |
| 6351 | + | |
| 6352 | + | |
| 6353 | + | |
| 6354 | + | |
| 6355 | + | |
| 6356 | + | |
| 6357 | + | |
| 6358 | + | |
| 6359 | + | |
| 6360 | + | |
| 6361 | + | |
| 6362 | + | |
| 6363 | + | |
| 6364 | + | |
| 6365 | + | |
| 6366 | + | |
| 6367 | + | |
| 6368 | + | |
| 6369 | + | |
| 6370 | + | |
| 6371 | + | |
| 6372 | + | |
| 6373 | + | |
| 6374 | + | |
| 6375 | + | |
| 6376 | + | |
| 6377 | + | |
| 6378 | + | |
| 6379 | + | |
| 6380 | + | |
| 6381 | + | |
| 6382 | + | |
| 6383 | + | |
| 6384 | + | |
| 6385 | + | |
| 6386 | + | |
| 6387 | + | |
6345 | 6388 | | |
6346 | 6389 | | |
6347 | 6390 | | |
6348 | 6391 | | |
6349 | 6392 | | |
6350 | 6393 | | |
6351 | 6394 | | |
| 6395 | + | |
| 6396 | + | |
| 6397 | + | |
| 6398 | + | |
6352 | 6399 | | |
6353 | 6400 | | |
6354 | 6401 | | |
| |||
6397 | 6444 | | |
6398 | 6445 | | |
6399 | 6446 | | |
| 6447 | + | |
| 6448 | + | |
| 6449 | + | |
| 6450 | + | |
| 6451 | + | |
| 6452 | + | |
| 6453 | + | |
6400 | 6454 | | |
6401 | 6455 | | |
6402 | 6456 | | |
| |||
0 commit comments