Skip to content

Commit

Permalink
Podman detection in FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylviettee authored and navi-desu committed Jul 25, 2024
1 parent 089c473 commit ba6de6d
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 @@ -259,6 +259,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 @@ -267,6 +269,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 ba6de6d

Please sign in to comment.