Skip to content

Commit

Permalink
Podman detection in FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylviettee committed Jul 25, 2024
1 parent 7f826da commit 54e9502
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/librc/librc.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ detect_container(const char *systype RC_UNUSED)
return NULL;
if (strcmp(systype, RC_SYS_JAIL) == 0)
return RC_SYS_JAIL;
if (strcmp(systype, RC_SYS_PODMAN) == 0)
return RC_SYS_PODMAN;
}

int jailed = 0;
Expand All @@ -265,6 +267,9 @@ detect_container(const char *systype RC_UNUSED)
if (sysctlbyname("security.jail.jailed", &jailed, &len, NULL, 0) == 0)
if (jailed == 1)
return RC_SYS_JAIL;

if (exists("/var/run/.containerenv"))
return RC_SYS_PODMAN;
#endif

#ifdef __linux__
Expand Down

0 comments on commit 54e9502

Please sign in to comment.