Skip to content

Commit 63f36bf

Browse files
committed
Add CAP_SYS_TIME in the container if available
Signed-off-by: DL6ER <[email protected]>
1 parent 60d8067 commit 63f36bf

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ The webserver and DNS service inside the container can be customized if necessar
251251
- `CAP_NET_ADMIN`: modify routing tables and other network-related operations (in particular inserting an entry in the neighbor table to answer DHCP requests using unicast packets)
252252
- `CAP_SYS_NICE`: FTL sets itself as an important process to get some more processing time if the latter is running low
253253
- `CAP_CHOWN`: we need to be able to change ownership of log files and databases in case FTL is started as a different user than `pihole`
254+
- `CAP_SYS_TIME`: FTL needs to be able to set the system time to update it using the Network Time Protocol (NTP) in the background
254255
255256
This image automatically grants those capabilities, if available, to the FTLDNS process, even when run as non-root.\
256257
By default, docker does not include the `NET_ADMIN` capability for non-privileged containers, and it is recommended to explicitly add it to the container using `--cap-add=NET_ADMIN`.\

src/bash_functions.sh

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ fix_capabilities() {
112112
capsh --has-p=cap_net_raw 2>/dev/null && CAP_STR+=',CAP_NET_RAW'
113113
capsh --has-p=cap_net_admin 2>/dev/null && CAP_STR+=',CAP_NET_ADMIN' || DHCP_READY='false'
114114
capsh --has-p=cap_sys_nice 2>/dev/null && CAP_STR+=',CAP_SYS_NICE'
115+
capsh --has-p=cap_sys_time 2>/dev/null && CAP_STR+=',CAP_SYS_TIME'
115116

116117
if [[ ${CAP_STR} ]]; then
117118
# We have the (some of) the above caps available to us - apply them to pihole-FTL

0 commit comments

Comments
 (0)