Displaying 1 result from an estimated 1 matches for "_nonet_group".
2009 Aug 02
0
Disable networking
...nonet
(setup the iptables rule)
Code:
# iptables -I OUTPUT -m owner --gid-owner nonet -j REJECT --reject-with icmp-net-unreachable
(create nonet.c)
Code:
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <grp.h>
#include <unistd.h>
#ifndef _NONET_GROUP
#define _NONET_GROUP "nonet"
#endif
int main(int argc, char *argv[])
{
struct group *gr;
if (argc <= 1) {
fprintf(stderr, "Usage: %s command [ arg ... ]\n", argv[0]);
exit(1);
}
if (!(gr = getgrnam(_NONET_GROUP))) {
perror("getgrnam");
ex...