Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit 057c33c

Browse files
committed
refactor has_linux_capability to is_granted_linux_capability
1 parent 050fc47 commit 057c33c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

entrypoint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ is_kernel_module_loaded() {
281281
return 1
282282
}
283283

284-
has_linux_capability() {
284+
is_granted_linux_capability() {
285285

286286
if capsh --print | grep -Eq "^Current: = .*,?${1}(,|$)"; then
287287
return 0
@@ -310,7 +310,7 @@ assert_kernel_mod() {
310310
return
311311
fi
312312

313-
if [[ ! -d /lib/modules ]] || ! has_linux_capability 'sys_module'; then
313+
if [[ ! -d /lib/modules ]] || ! is_granted_linux_capability 'sys_module'; then
314314
bail "$module module is not loaded in the Docker host's kernel (try: modprobe $module)"
315315
fi
316316

@@ -498,7 +498,7 @@ init_exports() {
498498

499499
init_runtime_assertions() {
500500

501-
if ! has_linux_capability 'cap_sys_admin'; then
501+
if ! is_granted_linux_capability 'cap_sys_admin'; then
502502
bail 'missing CAP_SYS_ADMIN. be sure to run this image with --cap-add SYS_ADMIN or --privileged'
503503
fi
504504

0 commit comments

Comments
 (0)