Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions netns-exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <errno.h>
#include <string.h>
#include <stdbool.h>
#include <fcntl.h>

#include "namespace.h"

Expand Down Expand Up @@ -108,6 +109,16 @@ int main(int argc, char *argv[])
return EXIT_OTHER_ERROR;


// allow non-root user to use the ping command
int fd = open("/proc/sys/net/ipv4/ping_group_range", O_WRONLY);
if (fd == -1) {
fprintf(stderr, "Error setting ping_group_range: %s\n", strerror(errno));
usage(argv0, true);
}
dprintf(fd, "0 2147483647\n");
close(fd);


drop_root_privileges();


Expand Down