diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-09-09 15:06:49 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-09-09 15:40:04 +0200 |
commit | 089dec90ca99efdb09f56153d11cfae6c5b9b8f1 (patch) | |
tree | d45a84f202dd83a9a9881740221fafa9f7054edc | |
parent | 9d19f5bc7398710fa4a5dd7173a1f84879de988e (diff) | |
download | passt-089dec90ca99efdb09f56153d11cfae6c5b9b8f1.tar passt-089dec90ca99efdb09f56153d11cfae6c5b9b8f1.tar.gz passt-089dec90ca99efdb09f56153d11cfae6c5b9b8f1.tar.bz2 passt-089dec90ca99efdb09f56153d11cfae6c5b9b8f1.tar.lz passt-089dec90ca99efdb09f56153d11cfae6c5b9b8f1.tar.xz passt-089dec90ca99efdb09f56153d11cfae6c5b9b8f1.tar.zst passt-089dec90ca99efdb09f56153d11cfae6c5b9b8f1.zip |
pasta: Set ping_group_range upon namespace creation
...this allows processes running as the only group available in the
namespace to create ICMP Echo sockets.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | passt.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -216,6 +216,10 @@ static void pasta_start_ns(struct ctx *c) write(fd, buf, strlen(buf)); close(fd); + fd = open("/proc/sys/net/ipv4/ping_group_range", O_WRONLY); + write(fd, "0 0", strlen("0 0")); + close(fd); + shell = getenv("SHELL") ? getenv("SHELL") : "/bin/sh"; if (strstr(shell, "/bash")) execve(shell, ((char *[]) { shell, "-l", NULL }), environ); |