ffproxy-1.6.orig/0000750000175000017500000000000010167007022012464 5ustar manumanuffproxy-1.6.orig/db/0000750000175000017500000000000007521023013013047 5ustar manumanuffproxy-1.6.orig/db/filter.rheader.entry0000640000175000017500000000063707714711577017066 0ustar manumanu# db/filter.rheader.entry # response filtering # # put header entries to remove from response here # use filter.rheader.match to remove entries via regular expressions # empty lines and lines starting with # are ignored # string matching is performed here (case insensitive) # # Examples: # Prohibit cookie usage: #Set-Cookie: #Cookie: # # The following entries should always be used: Connection: Proxy-Connection: ffproxy-1.6.orig/db/filter.rheader.match0000640000175000017500000000045207714710502016777 0ustar manumanu# db/filter.rheader.match # response filtering # # put header entries to remove from response here # use filter.rheader.entry to remove entries without regular expressions # empty lines and lines starting with # are ignored # regular expression matching is performed here # # Examples: #[Cc]ookie: ffproxy-1.6.orig/db/filter.rheader.drop0000640000175000017500000000052007714711570016651 0ustar manumanu# db/filter.rheader.drop # response filtering # # put header entries here that cause ffproxy to drop entire response # empty lines and lines starting with # are ignored # string matching is performed here (case insensitive) # # Examples: #Content-Type: application/ # # perhaps better: #application/ #audio/mpeg # #Cookie: #Session-Id: ffproxy-1.6.orig/db/access.ip0000640000175000017500000000062007714710416014657 0ustar manumanu# db/access.ip # # put IPv4 and IPv6 addresses allowed to connect here # empty lines and lines starting with # are ignored # regular expression matching is used here # # Examples: #^192\.168\.10\.(1|2|3|128)$ #^127\.0\.0\.1$ #^2001:768:18ff:4:: #:bfcf%9005$ # # This allows everyone to connect: #.* # # This allows everyone to connect via IPv6: #: # # This allows everyone to connect via IPv4: #\. # ffproxy-1.6.orig/db/filter.header.add0000640000175000017500000000072007714526652016262 0ustar manumanu# db/filter.header.add # # put header entries to add to outgoing headers here # use db/filter.header.entry to delete header entries via string matching # use db/filter.header.match to delete header entries via regular expressions # empty lines and lines starting with # are ignored # # Examples: #User-Agent: Mozilla/4.0 (4.0; BarOS; BazCompatible; QuxExtension; QuuxDumb) # # The following entries should always be used: Connection: close Proxy-Connection: close ffproxy-1.6.orig/db/filter.host.match0000640000175000017500000000131107714711554016345 0ustar manumanu# db/filter.host.match # # put hosts disallowed connecting to here # empty lines and lines starting with # are ignored # regular expression matching is used, # hostnames are converted to lower case before matching # # Examples: # Don't get ads from hostnames matching these expressions: #endemann #bannercommunity #doubleclick #sponsornetz #badservant # # Don't connect to `bad' sites: #adult #xxx #sex #porn #gamez #warez #eroti[ck] #erotik # # More ads: #^ad(s|[0-9]*)\..* #^.*\.admaster.* #^adserver\..* #^adfarm.*\..* #^bs.*\.gmx\.net$ #^banner.*\..* #^finance\.altavista\..* #^werbung.*\..* # # Don't allow Opera to connect to its secret servers: #^213\.165\.64\.4.$ #^213\.165\.64\.3.$ #^rgs.*\.opera\.com$ ffproxy-1.6.orig/db/filter.header.drop0000640000175000017500000000035507714711520016470 0ustar manumanu# db/filter.header.drop # # put header entries here that cause ffproxy to drop entire request # empty lines and lines starting with # are ignored # string matching is performed here (case insensitive) # # Examples: #Cookie: #Session-Id: ffproxy-1.6.orig/db/access.dyndns0000640000175000017500000000046307714710351015551 0ustar manumanu# db/access.dyndns # # put hostnames with changing IPv4 addresses allowed to connect here # empty lines and lines starting with # are ignored # hostnames are resolved to IPv4 address, if IPv4 address matches # IP address of connecting host, access is granted # # Example: #myhost.dyndns.org #dynip.myip.com ffproxy-1.6.orig/db/filter.url.match0000640000175000017500000000061707714710513016174 0ustar manumanu# db/filter.url.match # # put URIs to filter here # empty lines and lines starting with # are ignored # regular expression matching is used # # Examples: # Filter Ads: #WERBUNG #/ads/ #/RealMedia #\.ads/ #ooperatio #/advert #banner/ #/scripts/cms/ #/xrps\.asp #/event\.ng # # File types we don't like: # (also use Content-Type filtering via db/filter.rheader.drop) #\.com$ #\.exe$ #\.doc$ # /\.\./ ffproxy-1.6.orig/db/filter.header.entry0000640000175000017500000000075707714711530016674 0ustar manumanu# db/filter.header.entry # # put header entries to remove here # use filter.header.add to add custom entries # use filter.header.match to remove entries via regular expressions # empty lines and lines starting with # are ignored # string matching is performed here (case insensitive) # # Examples: #Accept-Language: #User-Agent: #From: # # Prohibit cookie usage: #Set-Cookie: #Cookie: # # The following entries should always be used: Accept-Encoding: Accept: Connection: Proxy-Connection: Host: ffproxy-1.6.orig/db/filter.header.match0000640000175000017500000000050707714710275016625 0ustar manumanu# db/filter.header.match # # put header entries to remove here # use filter.header.add to add custom entries # use filter.header.entry to remove entries without regular expressions # empty lines and lines starting with # are ignored # regular expression matching is performed here # # Examples: #\*/\* #iso-8859-([1-9]|1[0-4]) ffproxy-1.6.orig/db/access.host0000640000175000017500000000074607714711454015240 0ustar manumanu# db/access.host # # put IPv4 and IPv6 hostnames (reverse names) allowed to connect here # use db/access.dyndns for hosts without proper reverse name # use db/access.ip for IPv4 and IPv6 IP addresses # empty lines and lines starting with # are ignored # regular expression matching is used here, # hostnames are converted to lowercase before matching # # Examples: #^menuhin\.burden\.eu\.org$ #^.*\.mydomain\.org$ # # This would allow everyone with a valid reverse name to connect: #.* ffproxy-1.6.orig/BUGS0000640000175000017500000000067510166764453013201 0ustar manumanuI've access to a limited number of different systems only, so it's not guaranteed that ffproxy will compile or work at all. So far, I've tested ffproxy to work under OpenBSD (x86), NetBSD (x86), FreeBSD (x86), Linux (x86) and Solaris9 (sparc) (compiled with gcc). If you've patches to make ffproxy work on other systems, or if you've success stories, please let me know. Send bug reports, comments, questions to Niklas Olmes ffproxy-1.6.orig/TODO0000640000175000017500000000013507715023737013174 0ustar manumanuNew Features to add: * add content filtering * caching support More ideas? Mail me. ffproxy-1.6.orig/db.c0000640000175000017500000002621110165212411013216 0ustar manumanu/* * ffproxy (c) 2002-2004 Niklas Olmes * http://faith.eu.org * * $Id: db.c,v 2.1 2004/12/31 08:59:15 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include "configure.h" #ifdef HAVE_SYS_TYPES_H # include #endif #include #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include #include "cfg.h" #include "print.h" #include "msg.h" #include "alloc.h" #include "file.h" #include "db.h" static void clear_databases(void); static void clear_db(char *[]); static void clear_rdb(regex_t *[]); static void read_db(const char *, char *[]); static void read_rdb(const char *, regex_t *[]); static void read_file(const char *, struct msg *); static void read_config_file(void); static void verify_config(void); #define MAX_E 256 regex_t *a_ip[MAX_E]; regex_t *a_host[MAX_E]; char *a_dyndns[MAX_E]; regex_t *f_host[MAX_E]; regex_t *f_url[MAX_E]; regex_t *f_hdr_drop[MAX_E]; regex_t *f_hdr_match[MAX_E]; char *f_hdr_entry[MAX_E]; char *f_hdr_add[MAX_E]; regex_t *f_rhdr_drop[MAX_E]; regex_t *f_rhdr_match[MAX_E]; char *f_rhdr_entry[MAX_E]; struct msg e_inv; struct msg e_res; struct msg e_con; struct msg e_post; struct msg e_fil; void reload_databases(void) { clear_databases(); load_databases(); } void load_databases(void) { extern struct cfg config; read_config_file(); verify_config(); if (*config.dbdir != '\0' && chdir(config.dbdir) != 0) fatal("could not chdir() to dbdir (%s)", config.dbdir); read_rdb("db/access.ip", a_ip); read_rdb("db/access.host", a_host); read_db("db/access.dyndns", a_dyndns); read_rdb("db/filter.host.match", f_host); read_rdb("db/filter.url.match", f_url); read_rdb("db/filter.header.drop", f_hdr_drop); read_rdb("db/filter.header.match", f_hdr_match); read_db("db/filter.header.entry", f_hdr_entry); read_db("db/filter.header.add", f_hdr_add); read_rdb("db/filter.rheader.drop", f_rhdr_drop); read_rdb("db/filter.rheader.match", f_rhdr_match); read_db("db/filter.rheader.entry", f_rhdr_entry); read_file("html/invalid", &e_inv); read_file("html/resolve", &e_res); read_file("html/connect", &e_con); read_file("html/post", &e_post); read_file("html/filtered", &e_fil); } static void clear_databases(void) { clear_rdb(a_ip); clear_rdb(a_host); clear_db(a_dyndns); clear_rdb(f_host); clear_rdb(f_url); clear_rdb(f_hdr_drop); clear_rdb(f_hdr_match); clear_db(f_hdr_entry); clear_db(f_hdr_add); clear_rdb(f_rhdr_drop); clear_rdb(f_rhdr_match); clear_db(f_rhdr_entry); free(e_inv.c); free(e_res.c); free(e_con.c); free(e_post.c); free(e_fil.c); e_inv.len = e_res.len = e_con.len = e_post.len = e_fil.len = 0; } static void clear_db(char *db[]) { int i; i = 0; while (db[i] != NULL) { free(db[i]); db[i++] = NULL; } } static void clear_rdb(regex_t * r[]) { int i; i = 0; while (r[i] != NULL) { regfree(r[i]); free(r[i]); r[i++] = NULL; } } static void read_db(const char *f, char *db[]) { FILE *fp; char buf[512], *p; size_t i; fp = my_fopen(f); i = 0; while (fgets(buf, sizeof(buf), fp) != NULL && i < MAX_E - 1) { if (buf[0] == '#' || buf[0] == '\r' || buf[0] == '\n') continue; if ((p = strchr(buf, '\n')) == NULL) { (void) fclose(fp); fatal_n("line too long in file %s", f); } *p = '\0'; p = (char *) my_alloc(strlen(buf) + 1); strcpy(p, buf); db[i++] = p; } (void) fclose(fp); db[i] = NULL; } static void read_rdb(const char *f, regex_t * r[]) { FILE *fp; regex_t *regex; char buf[512], *p; char errbuf[512]; size_t i; int err; fp = my_fopen(f); i = 0; while (fgets(buf, sizeof(buf), fp) != NULL && i < MAX_E - 1) { if (buf[0] == '#' || buf[0] == '\n' || buf[0] == '\r') continue; if ((p = strchr(buf, '\n')) == NULL) { (void) fclose(fp); fatal_n("line too long in file %s", f); } *p = '\0'; regex = (regex_t *) my_alloc(sizeof(regex_t)); if ((err = regcomp(regex, buf, REG_EXTENDED)) != 0) { (void) regerror(err, regex, errbuf, sizeof(errbuf)); warn("invalid regular expression (%s) in file (%s): %s", buf, f, errbuf); free(regex); continue; } r[i++] = regex; } (void) fclose(fp); r[i] = NULL; } static void read_file(const char *fn, struct msg * m) { int f; char buf[8192]; ssize_t len; f = my_open(fn); len = read(f, &buf, sizeof(buf)); m->c = (char *) my_alloc(len + 1); (void) memcpy(m->c, buf, len); m->c[len] = '\0'; m->len = len; (void) close(f); } #include "dns.h" static void read_config_file(void) { extern struct cfg config; FILE *fp; char obuf[100]; char abuf[100]; char b[300]; if (*config.file == '\0') { ; } else if ((fp = fopen(config.file, "r")) != NULL) { while (fgets(b, sizeof(b), fp) != NULL) { (void) sscanf(b, "%99s %99s", obuf, abuf); if (config.first && strcmp("daemonize", obuf) == 0) { if (strcmp(abuf, "yes") == 0) config.daemon = 1; else config.daemon = 0; continue; } else if (strcmp("child_processes", obuf) == 0) { config.childs = atoi(abuf); continue; } else if (config.first && strcmp("bind_ipv4", obuf) == 0) { if (strcmp(abuf, "yes") == 0) config.bind_ipv4 = 1; else config.bind_ipv4 = 0; continue; } else if (config.first && strcmp("bind_ipv6", obuf) == 0) { if (strcmp(abuf, "yes") == 0) config.bind_ipv6 = 1; else config.bind_ipv6 = 0; continue; } else if (config.first && strcmp("bind_ipv4_host", obuf) == 0) { (void) strncpy(config.ipv4, abuf, sizeof(config.ipv4) - 1); config.ipv4[sizeof(config.ipv4) - 1] = '\0'; continue; } else if (config.first && strcmp("bind_ipv6_host", obuf) == 0) { (void) strncpy(config.ipv6, abuf, sizeof(config.ipv6) - 1); config.ipv6[sizeof(config.ipv6) - 1] = '\0'; continue; } else if (config.first && strcmp("port", obuf) == 0) { config.port = atoi(abuf); continue; } else if (strcmp("use_ipv6", obuf) == 0) { if (strcmp(abuf, "yes") == 0) config.use_ipv6 = 1; else config.use_ipv6 = 0; continue; } else if (config.first && strcmp("uid", obuf) == 0) { if (!(config.uid = atoi(abuf))) { struct passwd *pwd; if ((pwd = getpwnam(abuf))) config.uid = (unsigned long) pwd->pw_uid; else fatal_n("UID %s not found", abuf); } continue; } else if (config.first && strcmp("gid", obuf) == 0) { if (!(config.gid = atoi(abuf))) { struct group *grp; if ((grp = getgrnam(abuf))) config.gid = (unsigned long) grp->gr_gid; else fatal_n("GID %s not found", abuf); } continue; } else if (config.first && strcmp("chroot_dir", obuf) == 0) { (void) strncpy(config.chroot, abuf, sizeof(config.chroot) - 1); config.chroot[sizeof(config.chroot) - 1] = 0; continue; } else if (strcmp("forward_proxy", obuf) == 0) { (void) strncpy(config.proxyhost, abuf, sizeof(config.proxyhost) - 1); config.proxyhost[sizeof(config.proxyhost) - 1] = 0; continue; } else if (strcmp("forward_proxy_port", obuf) == 0) { config.proxyport = atoi(abuf); continue; } else if (strcmp("forward_proxy_ipv6", obuf) == 0) { if (strcmp(abuf, "yes") == 0) config.aux_proxy_ipv6 = 1; else config.aux_proxy_ipv6 = 0; continue; } else if (config.first && strcmp("db_files_path", obuf) == 0) { (void) strncpy(config.dbdir, abuf, sizeof(config.dbdir) - 1); config.dbdir[sizeof(config.dbdir) - 1] = 0; continue; } else if (strcmp("backlog_size", obuf) == 0) { config.backlog = atoi(abuf); continue; } else if (strcmp("use_syslog", obuf) == 0) { if (strcmp(abuf, "yes") == 0) config.syslog = 1; else config.syslog = 0; continue; } else if (strcmp("log_all_requests", obuf) == 0) { if (strcmp(abuf, "yes") == 0) config.logrequests = 1; else config.logrequests = 0; continue; } else if (strcmp("accel_host", obuf) == 0) { (void) strncpy(config.accelhost, abuf, sizeof(config.accelhost) - 1); config.accelhost[sizeof(config.accelhost) - 1] = '\0'; continue; } else if (strcmp("accel_port", obuf) == 0) { config.accelport = atoi(abuf); continue; } else if (strcmp("accel_user_host", obuf) == 0) { if (strcmp(abuf, "yes") == 0) config.accelusrhost = 1; else config.accelusrhost = 0; continue; } else if (strcmp("use_keep_alive", obuf) == 0) { if (strcmp(abuf, "yes") == 0) config.kalive = 1; else config.kalive = 0; continue; } else if (strcmp("unrestricted_connect", obuf) == 0) { if (strcmp(abuf, "yes") == 0) config.unr_con = 1; else config.unr_con = 0; continue; } else if (strcmp("timeout_connect", obuf) == 0) { config.to_con = atoi(abuf); continue; } else if (!config.first) { continue; } else if (*obuf != '#') { warn("unknown option in config file %s: %s", config.file, obuf); continue; } } (void) fclose(fp); } else { if (strcmp(config.file, CFGFILE) == 0) info("default config file (%s) not available, not using config file", CFGFILE); else fatal("unable to open config file %s", config.file); } config.first = 0; } #define ZHWRONG(a, o, v) if(a < 1 || a > v) fatal_n("%s is set < 1 or value is too high (maximum: %d, current: %d)", o, v, a); #define HWRONG(a, o, v) if(a < 0 || a > v) fatal_n("Value of %s is set too high or negative (maximum: %d, current: %d)", o, v, a); #define HUWRONG(a, o, v) if(a > v) fatal_n("Value of %s is set too high (maximum: %d, current: %d)", o, v, a); static void verify_config(void) { extern struct cfg config; HUWRONG(config.port, "port", MAX_PORTS); ZHWRONG(config.childs, "child_processes", MAX_CHILDS); HWRONG(config.backlog, "backlog_size", MAX_BACKLOG); HUWRONG(config.proxyport, "forward_proxy_port", MAX_PORTS); HUWRONG(config.uid, "uid", MAX_UID); HUWRONG(config.gid, "gid", MAX_GID); HUWRONG(config.accelport, "accel_port", MAX_PORTS); if ((config.uid && !config.gid) || (!config.uid && config.gid)) fatal_n("Only one of uid and gid is set to non-zero.\nYou have to use both or none of them"); if (*config.accelhost && config.accelport) config.accel = 1; else config.accel = 0; if (!config.bind_ipv4 && !config.bind_ipv6) fatal_n("Both IPv4 and IPv6 binding disabled. This makes no sense"); } ffproxy-1.6.orig/db.h0000640000175000017500000000010407714727524013242 0ustar manumanuvoid load_databases(void); void reload_databases(void); ffproxy-1.6.orig/html/0000750000175000017500000000000007714520061013437 5ustar manumanuffproxy-1.6.orig/html/post0000640000175000017500000000042407714527021014353 0ustar manumanuHTTP/1.1 400 ERROR Connection: close Content-Type: text/html; charset=iso-8859-1 Error: Unable to post data

Error

Your request to post data to $h failed, unable to post data

URL: $u ffproxy-1.6.orig/html/connect0000640000175000017500000000035207714527015015022 0ustar manumanuHTTP/1.1 503 ERROR Connection: close Content-Type: text/html; charset=iso-8859-1 Error: Unable to connect to server

Error

Unable to connect to server $h ffproxy-1.6.orig/html/resolve0000640000175000017500000000034507714527023015051 0ustar manumanuHTTP/1.1 503 ERROR Connection: close Content-Type: text/html; charset=iso-8859-1 Error: Unable to resolve IP

Error

Unable to resolve IP for host $h ffproxy-1.6.orig/html/filtered0000640000175000017500000000037607714527016015176 0ustar manumanuHTTP/1.1 200 OK (filtered) Connection: close Content-Type: text/html; charset=iso-8859-1 Filtered URL

Filtered URL

Your request was filtered

URL: $u on host $h ffproxy-1.6.orig/html/invalid0000640000175000017500000000034407714527020015014 0ustar manumanuHTTP/1.1 400 ERROR Connection: close Content-Type: text/html; charset=iso-8859-1 Error: Invalid request

Error

Your browser sent an invalid request ffproxy-1.6.orig/configure.h.in0000640000175000017500000001014210165217057015233 0ustar manumanu/* * $Id: configure.h.in,v 1.1 2004/12/31 07:26:08 niklas Exp $ */ #ifndef HAD_CONFIGURE_H #define HAD_CONFIGURE_H 1 /* configure.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the `daemon' function. */ #undef HAVE_DAEMON /* Define to 1 if you have the `dup2' function. */ #undef HAVE_DUP2 /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `gethostbyname' function. */ #undef HAVE_GETHOSTBYNAME /* Define to 1 if you have the `inet_ntoa' function. */ #undef HAVE_INET_NTOA /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the `regcomp' function. */ #undef HAVE_REGCOMP /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define to the type of arg 1 for `select'. */ #undef SELECT_TYPE_ARG1 /* Define to the type of args 2, 3 and 4 for `select'. */ #undef SELECT_TYPE_ARG234 /* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned' if does not define. */ #undef size_t /* Define as `fork' if `vfork' does not work. */ #undef vfork #endif ffproxy-1.6.orig/regex.c0000640000175000017500000000215010165212412013740 0ustar manumanu/* * ffproxy (c) 2002, 2003 Niklas Olmes * http://faith.eu.org * * $Id: regex.c,v 2.1 2004/12/31 08:59:15 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include "configure.h" #ifdef HAVE_SYS_TYPES_H # include #endif #include #include "regex.h" int do_regex(const char *s, const regex_t * r) { regmatch_t pmatch[1]; size_t nmatch; nmatch = 0; return regexec(r, s, nmatch, pmatch, 0); } ffproxy-1.6.orig/regex.h0000640000175000017500000000011507517766752014000 0ustar manumanu#include int do_regex(const char *, const regex_t *); ffproxy-1.6.orig/cfg.h0000640000175000017500000000142710061167532013407 0ustar manumanustruct cfg { unsigned int port; char ipv4[256]; char ipv6[256]; int daemon; int childs; int ccount; int backlog; unsigned long uid; unsigned long gid; char chroot[256]; char dbdir[256]; char file[256]; char proxyhost[256]; unsigned int proxyport; int syslog; int logrequests; int use_ipv6; int aux_proxy_ipv6; int bind_ipv6; int bind_ipv4; int accel; int accelusrhost; char accelhost[256]; unsigned int accelport; int kalive; int unr_con; int to_con; int nowarn; int first; }; #define MAX_CHILDS 1024 #define MAX_BACKLOG 64 #define MAX_PORTS 65535 #define MAX_UID 65535 #define MAX_GID MAX_UID #define MAX_FSIZE 256*1024 ffproxy-1.6.orig/dbs.h0000640000175000017500000000077007517766752013445 0ustar manumanu#include extern regex_t *a_ip[]; extern regex_t *a_host[]; extern char *a_dyndns[]; extern regex_t *f_host[]; extern regex_t *f_url[]; extern regex_t *f_hdr_drop[]; extern regex_t *f_hdr_match[]; extern char *f_hdr_entry[]; extern char *f_hdr_add[]; extern regex_t *f_rhdr_drop[]; extern regex_t *f_rhdr_match[]; extern char *f_rhdr_entry[]; extern char *e_inv; extern char *e_res; extern char *e_con; extern char *e_post; extern char *e_fil; extern char *e_nic; ffproxy-1.6.orig/dns.c0000640000175000017500000000454110165212411013417 0ustar manumanu/* * ffproxy (c) 2002, 2003 Niklas Olmes * http://faith.eu.org * * $Id: dns.c,v 2.1 2004/12/31 08:59:15 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include "configure.h" #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #include #include #ifdef HAVE_NETDB_H # include #endif #include "req.h" #include "alloc.h" #include "print.h" #include "dns.h" static char *ip_to_a(in_addr_t); in_addr_t resolve(const char *h) { struct hostent *hp; in_addr_t ip; if ((ip = inet_addr(h)) != INADDR_NONE) return ip; if ((hp = gethostbyname(h)) == NULL) return INADDR_NONE; else { (void) memcpy(&ip, hp->h_addr, hp->h_length); return ip; } } static char * ip_to_a(in_addr_t ip) { char *p; struct in_addr addr; addr.s_addr = ip; p = inet_ntoa(addr); return p; } char * resolve_to_a(const char *h) { char *p; p = ip_to_a(resolve(h)); return p; } struct clinfo * identify(const struct sockaddr * addr, socklen_t salen) { struct clinfo *host; host = (struct clinfo *) my_alloc(sizeof(struct clinfo)); (void) memset(host, 0, sizeof(struct clinfo)); if (getnameinfo(addr, salen, host->name, sizeof(host->name), NULL, 0, NI_NAMEREQD)) *host->name = '\0'; DEBUG(("identify() => getnameinfo() for Reverse Name returned (%s)", host->name)); if (getnameinfo(addr, salen, host->ip, sizeof(host->ip), NULL, 0, NI_NUMERICHOST)) *host->ip = '\0'; DEBUG(("identify() => getnameinfo() for IP Address returned (%s)", host->ip)); return host; } ffproxy-1.6.orig/dns.h0000640000175000017500000000057110165176246013442 0ustar manumanu#include "configure.h" #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifndef INADDR_NONE # define INADDR_NONE -1 #endif in_addr_t resolve(const char *); char *resolve_to_a(const char *); struct clinfo *identify(const struct sockaddr *, socklen_t); ffproxy-1.6.orig/msg.c0000640000175000017500000000405110165212412013416 0ustar manumanu/* * ffproxy (c) 2002, 2003 Niklas Olmes * http://faith.eu.org * * $Id: msg.c,v 2.1 2004/12/31 08:59:15 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include "configure.h" #ifdef HAVE_SYS_TYPES_H # include #endif #include #ifdef HAVE_UNISTD_H # include #endif #include "req.h" #include "dbs.h" #include "msg.h" #include "poll.h" void err_msg(int s, struct req * r, int m) { char msg[8192]; char *p; size_t i; int j; p = NULL; switch (m) { case E_INV: p = e_inv; break; case E_RES: p = e_res; break; case E_CON: p = e_con; break; case E_POST: p = e_post; break; case E_FIL: p = e_fil; break; } *msg = '\0'; i = 0; while (p != NULL && *p != '\0' && i < sizeof(msg) - 1) if (*p == '$') { switch (*(p + 1)) { case 'u': j = 0; while (i < sizeof(msg) - 1 && r->url[j] != '\0') msg[i++] = r->url[j++]; p += 2; break; case 'h': j = 0; while (i < sizeof(msg) - 1 && r->host[j] != '\0') msg[i++] = r->host[j++]; p += 2; break; case 'c': j = 0; while (i < sizeof(msg) - 1 && r->cl->name[j] != '\0') msg[i++] = r->cl->name[j++]; p += 2; break; default: msg[i++] = *(p++); break; } } else msg[i++] = *(p++); msg[i] = '\0'; if (i > 0 && my_poll(s, OUT)) (void) write(s, msg, i - 1); } ffproxy-1.6.orig/msg.h0000640000175000017500000000031307714727524013445 0ustar manumanu#ifndef HAD_REQ_H #include "req.h" #endif struct msg { char *c; int len; }; enum { E_INV = 10, E_RES, E_CON, E_POST, E_FIL }; void err_msg(int, struct req *, int); ffproxy-1.6.orig/req.h0000640000175000017500000000111710061055613013427 0ustar manumanu#define HAD_REQ_H struct clinfo { char name[128]; char ip[128]; }; struct req { char url[2048]; char urlpath[2048]; char host[128]; unsigned int port; int type; int relative; int kalive; int vmajor; int vminor; long clen; char tstamp[32]; char ctype[32]; char *header[32]; char fname[256]; char lname[257]; int loop; struct clinfo *cl; }; enum { GET = 0, POST, HEAD, CONNECT, UNKNOWN }; ffproxy-1.6.orig/README0000640000175000017500000000110710166764447013370 0ustar manumanuDescription =========== ffproxy is a filtering HTTP/HTTPS proxy server. It is able to filter by host, URL, and header. Custom header entries can be filtered and added. It can even drop its privileges and optionally chroot() to some directory. Logging to syslog() is supported, as is using another auxiliary proxy server. An HTTP accelerator feature (acting as a front-end to an HTTP server) is included. Contacting IPv6 servers as well as binding to IPv6 is supported and allows transparent IPv6 over IPv4 browsing (and vice versa). Website: http://faith.eu.org/programs.html ffproxy-1.6.orig/configure0000750000175000017500000051413310167002041014376 0ustar manumanu#! /bin/sh # From configure.ac Revision: 1.4 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for ffproxy 1.6. # # Report bugs to . # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='ffproxy' PACKAGE_TARNAME='ffproxy' PACKAGE_VERSION='1.6' PACKAGE_STRING='ffproxy 1.6' PACKAGE_BUGREPORT='niklas@noxa.de' ac_unique_file="main.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures ffproxy 1.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of ffproxy 1.6:";; esac cat <<\_ACEOF Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF ffproxy configure 1.6 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by ffproxy $as_me 1.6, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers configure.h" # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Checks for libraries. echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect (); int main () { connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 if test $ac_cv_lib_socket_connect = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi # Checks for header files. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------- ## ## Report this to niklas@noxa.de ## ## ----------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi # Checks for library functions. for ac_header in unistd.h vfork.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------- ## ## Report this to niklas@noxa.de ## ## ----------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in fork vfork do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then echo "$as_me:$LINENO: checking for working fork" >&5 echo $ECHO_N "checking for working fork... $ECHO_C" >&6 if test "${ac_cv_func_fork_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_fork_works=cross else cat >conftest.$ac_ext <<_ACEOF /* By Ruediger Kuhlmann. */ #include #if HAVE_UNISTD_H # include #endif /* Some systems only have a dummy stub for fork() */ int main () { if (fork() < 0) exit (1); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_fork_works=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_fork_works=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5 echo "${ECHO_T}$ac_cv_func_fork_works" >&6 else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then echo "$as_me:$LINENO: checking for working vfork" >&5 echo $ECHO_N "checking for working vfork... $ECHO_C" >&6 if test "${ac_cv_func_vfork_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_vfork_works=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ #include #include #include #include #include #if HAVE_UNISTD_H # include #endif #if HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; exit( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_vfork_works=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_vfork_works=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5 echo "${ECHO_T}$ac_cv_func_vfork_works" >&6 fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WORKING_VFORK 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define vfork fork _ACEOF fi if test "x$ac_cv_func_fork_works" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WORKING_FORK 1 _ACEOF fi for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------- ## ## Report this to niklas@noxa.de ## ## ----------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if STDC_HEADERS || HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { exit (malloc (0) ? 0 : 1); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_malloc_0_nonnull=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 0 _ACEOF case $LIBOBJS in "malloc.$ac_objext" | \ *" malloc.$ac_objext" | \ "malloc.$ac_objext "* | \ *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi for ac_header in sys/select.h sys/socket.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------- ## ## Report this to niklas@noxa.de ## ## ----------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking types of arguments for select" >&5 echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6 if test "${ac_cv_func_select_args+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #if HAVE_SYS_SELECT_H # include #endif #if HAVE_SYS_SOCKET_H # include #endif int main () { extern int select ($ac_arg1, $ac_arg234, $ac_arg234, $ac_arg234, $ac_arg5); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done done done # Provide a safe default value. : ${ac_cv_func_select_args='int,int *,struct timeval *'} fi echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 echo "${ECHO_T}$ac_cv_func_select_args" >&6 ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS shift cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG234 ($2) _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG5 ($3) _ACEOF rm -f conftest* echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef signal # undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_func in dup2 gethostbyname inet_ntoa memset regcomp select socket strchr strncasecmp daemon do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by ffproxy $as_me 1.6, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ ffproxy config.status 1.6 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "configure.h" ) CONFIG_HEADERS="$CONFIG_HEADERS configure.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi ffproxy-1.6.orig/ffproxy.8.s0000640000175000017500000002611010167006763014527 0ustar manumanu.\" $Id: ffproxy.8.s,v 2.3 2005/01/05 15:55:30 niklas Exp niklas $ .\" Copyright (c) 2002-2005 Niklas Olmes .\" See COPYING for license (GNU GPL) .\" http://faith.eu.org .Dd Jan 5, 2005 .Dt ffproxy 8 .Sh NAME .Nm ffproxy .Nd filtering HTTP/HTTPS proxy server .Sh SYNOPSIS .Nm ffproxy .Op Fl p Ar port .Op Fl c Ar ip|hostname .Op Fl C Ar ip|hostname .Op Fl l Ar childs .Op Fl u Ar uid|user Fl g Ar gid|group .Op Fl r Ar dir .Op Fl D Ar datadir .Op Fl x Ar proxyip|proxyhost Fl X Ar proxyport .Op Fl a Ar ip|hostname .Op Fl A Ar port .Op Fl f Ar configfile .Op Fl ds4bBhv .Sh DESCRIPTION .Nm ffproxy is a filtering HTTP/HTTPS proxy server. It is able to filter by host, URL, and header. Custom header entries can be filtered and added. It can even drop its privileges and optionally .Xr chroot 2 to some directory. Logging to .Xr syslog 3 is supported, as is using another auxiliary proxy server. An HTTP accelerator feature (acting as a front-end to an HTTP server) is included. Contacting IPv6 servers as well as binding to IPv6 is supported and allows transparent IPv6 over IPv4 browsing (and vice versa). .Pp Remind that there is an alternative to command line options by using configuration files. See .Xr ffproxy.conf 5 and .Pa sample.config for details. It allows options that are not available on command line. .Pp The following command line options are recognized. They specify general settings like IP to bind to or place of the db/ and html/ directories. Note that arguments to options must be seperated from the option by spaces, as are such options from each other. .Pp .Bl -tag -width "message" .It Fl p Ar port Bind to port. Default is 8080. .It Fl c Ar ip|hostname Bind to IPv4. Default is any IPv4. .It Fl C Ar ip|hostname Bind to IPv6. Default is any IPv6. .It Fl l Ar childs Maximum number of child processes to be forked. That is, the maximum number of concurrent requests allowed. Default is 10. .It Fl u Ar uid|user Fl g Ar gid|group Change UID and GID. Both options must be used. Default is not changing UID and GID. .It Fl r Ar dir Change root .Xr chroot 7 to dir. Used in conjunction with -u and -g. Because ffproxy drops its privileges and chroots after reading the configuration files, -D should be set to . (the current dir). It might need .Pa /etc/resolv.conf copied as etc/resolv.conf in its working directory. Example: ``# cd /var/ffproxy ; /usr/local/bin/ffproxy -r /var/ffproxy -D . -d -u proxy -g proxy -f ""'' .It Fl x Ar ip|hostname Specify IP (or hostname) of an auxiliary proxy server that the program will forward requests to. Used together with -X. .It Fl X Ar port Port number of auxiliary proxy. .It Fl D Ar dir Location of the db/ and html/ directories. For example, specifying -D /var/ffproxy tells the proxy to search for db/ files in .Pa /var/ffproxy/db/ and html/ files in .Pa /var/ffproxy/html/ . .It Fl a Ar ip|hostname Auxiliary forward HTTP server to use (see section HTTP ACCELERATOR). .It Fl A Ar port Port to use for above. Defaults to 80. .It Fl f Ar configfile User configuration file to load. Please note that command line options get overwritten by set configuration file options. Default location is .Pa _CFGFILE_ . Read .Xr ffproxy.conf 5 for details. Use -f "" to disable configuration files. .It Fl d Run as daemon. .It Fl s Be silent. Don't log to syslog. .It Fl 4 Use IPv4 only. Do not try contacting servers via IPv6. .It Fl b Don't bind to IPv4. Might be needed under Linux 2.4, due to a ``Feature'' IPv6 binds to IPv4, too. Try using this option or bind to specific IPv6 address via -C. .It Fl B Don't bind to IPv6. .It Fl h Show usage information. .It Fl v Display version number. .El .Sh THE DB/ DIRECTORY The db/ directory contains files that control the behaviour of ffproxy. The files for filtering are prefixed by `filter'. Access to the proxy server is controlled by files with prefix `host'. .Ss Filtering Requests or header entries to be filtered are matched by extended regular expressions or case insensitive by strings. .Pp ffproxy is able to filter requests by host, header, remote header, and URL. The specific files are .Pp .Bl -tag -width xxxx -compact -offset indent .It Ar filter.host.match .It Ar filter.header.drop .It Ar filter.header.entry .It Ar filter.header.match .It Ar filter.rheader.drop .It Ar filter.rheader.entry .It Ar filter.rheader.match .It Ar filter.url.match .El .Pp Files ending in `drop' specify requests to be completely filtered (dropped). Files ending in `entry' specify header entries to be removed from the header. They are matched case insensitive without extended regular expressions. Files ending in `match' specify extended regular expressions to be matched against header entries, host, or URL. .Pp Adding custom header entries is also supported. The entries of file .Pa filter.header.add will be added to every outgoing request. .Ss Access Control Access to the proxy is controlled through the files prefixed `host'. .Pp .Pa host.dyndns contains host names with dynamic IPv4 addresses. The host names are resolved to IPv4 addresses and compared to the client's IP. If it matches, access is granted. .Pp .Pa host.ip contains static IPv4 and IPv6 address. .Pp .Pa host.name contains official hostnames (reverse lookup). .Pp Except for .Pa host.dyndns , the files contain extended regular expressions. If any of the entries matches, access is granted. .Ss Layout of db/ Files Every mentioned file above must exist, although it may be empty. Every entry is exactly one line. Empty lines are ignored, as are lines beginning with a # (comments). .Pp The location of the db/ directory may be specified by an argument to the command line option -D. If this option and configuration file option db_files_path are not used, ffproxy will search for db/ and html/ in .Pa _BASE_ . .Pp ffproxy comes with sample db/ files. They also contain needed and suggested entries, as described next. .Ss Suggested db/ file entries The file .Pa filter.header.entry should contain following entries for the program's proper operation .Bd -literal -offset indent Accept-Encoding: Accept: Connection: Proxy-Connection: Host: .Ed .Pp First two lines are needed for browsers that send out Accept*: Headers but don't understand encoded data coming back from the proxy. Host: has to be removed, since proxies require absolute URIs (Host: is redundant). .Pp .Pa filter.header.add should contain .Bd -literal -offset indent Connection: close Proxy-Connection: close .Ed .Pp We removed the two entries through .Pa filter.header.entry and now implant our own to force disconnection after each request. .Pp .Pa filter.rheader.entry should contain .Bd -literal -offset indent Connection: Proxy-Connection: .Ed .Pp Whatever the server answered, we remove it. .Sh THE HTML/ DIRECTORY This directory contains files with HTTP header and HTML that are sent to the user's browser if either an error occured or a request was filtered. In the files, the variable .Va $u will be replaced by the URL, .Va $h by the host to connect to, and .Va $c by the hostname of the client. .Pp Since the files are loaded into memory for faster execution, the size of each file is limited to about 8 kB (what is more than enough, the default files are under 1 kB). .Pp The specific files are (every file must exist) .Pp .Bl -tag -width xxxxxxxxxxx -compact -offset indent .It Ar connect Connection failed (503) .It Ar filtered Request filtered (200) .It Ar invalid Invalid request (400) .It Ar post Unable to post data (400) .It Ar resolve Resolve error (503) .El .Sh HTTP ACCELERATOR ffproxy may also be used as a HTTP accelerator, that is, connecting to just one HTTP server and beeing a front-end to that. Use accel_host and accel_port in configuration file or command line options -a and -A to use this feature. .Pp Default behaviour is *not* sending Host: header to allow insertion of a custom one via .Pa filter.header.add (see section THE DB/ DIRECTORY) or keeping the original one used by connecting client (`Host:' hast to be removed from default .Pa filter.header.entry , of course). To change this, use `accel_user_host no' in the configuration file. ``Host: accel_host:accel_port'' will be used then. .Sh TRANSPARENT OPERATION It is possible to redirect all HTTP traffic, that is, traffic to port 80, to the proxy's listening port. It will then transparently act as a HTTP proxy, the client not even knowing it is connecting to a proxy. .Pp On OpenBSD one could enable this by adding a line like .Bd -literal -offset indent rdr on rl0 proto tcp from any to any port 80 -> 127.0.0.1 port 8080 .Ed .Pp to .Pa /etc/pf.conf . In this example, rl0 is the local interface. All traffic coming from rl0 directed to port 80 (HTTP standard port) is sent to 127.0.0.1:8080 where ffproxy is supposed to be listening. .Sh KEEP ALIVE The program supports keep alive on client to proxy connections. This is used automatically by default and may be disabled by setting `use_keep_alive no' in the configuration file. .Sh HTTPS OPERATION The proxy allows HTTPS proxying via implementation of the CONNECT request method. By default, only port 443 is allowed for CONNECT. This may be changed by using `unrestricted_connect yes' in the configuration file. Timeout may also be tuned by `timeout_connect seconds'. .Sh RELOADING CONFIGURATION Send a SIGHUP to the pid of the ffproxy master process to let it reload db/ files, html/ files, *and* configuration file. If no configuration file was specified, .Pa _CFGFILE_ is tried. Of course, only some changes to the program can be done at runtime. See .Xr ffproxy.conf 5 for details on options that may be changed at runtime. .Pp If daemonized, the master process writes the pid file .Pa ffproxy.pid to the working directory, that is, the directory specified by db_files_path or the command line parameter -D. It defaults to .Pa _BASE_ . The program will terminate if writing fails. .Sh LOGGING By default, the proxy logs incorrect and filtered requests. To log all requests, use the configuration file keyword `log_all_requests yes'. Please make sure that you seperate the programs log output from that of other programs by modifying .Xr syslog.conf 5 , since the output is very noisy. .Sh FILES Behaviour of ffproxy is determined by .Bl -bullet .It startup options given either on the command line or read from configuration files -- .Pa _CFGFILE_ is loaded by default. .It the files in db/ which specify filtering options and who is allowed to connect and use ffproxy .El .Pp If daemonized, ffproxy writes the pid of its master process to the file named .Pa ffproxy.pid in its working directory -- .Pa _BASE_ by default. .Sh SEE ALSO .Pa sample.config for a sample configuration file .Pp .Pa _CFGFILE_ for default configuration file .Pp .Xr ffproxy.conf 5 for details on config file .Pp .Xr ffproxy.quick 7 for a short description of how to set up the proxy .Pp .Pa http://faith.eu.org/programs.html for latest version and patches .Pp .Xr regex 7 , .Xr re_format 7 , .Xr syslogd 8 , .Xr chroot 2 , .Xr kill 1 .Sh CONTRIBUTORS Dobrica Pavlinusic provided patches for http accelerator feature .Sh VERSION This manual documents ffproxy 1.6 (2005-01-05). .Pp Send bug reports, comments, suggestions to .Sh AUTHOR Niklas Olmes ffproxy-1.6.orig/configure.ac0000640000175000017500000000171010167001614014753 0ustar manumanu# Process this file with autoconf to produce a configure script. # # $Id: configure.ac,v 1.4 2005/01/05 15:11:06 niklas Exp niklas $ # AC_PREREQ(2.59) AC_INIT([ffproxy],[1.6],[niklas@noxa.de]) AC_REVISION($Revision: 1.4 $) AC_CONFIG_SRCDIR([main.c]) AC_CONFIG_HEADERS([configure.h]) # Checks for programs. AC_PROG_CC AC_PROG_INSTALL # Checks for libraries. AC_CHECK_LIB(nsl, gethostbyname) AC_CHECK_LIB(socket, connect) # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME # Checks for library functions. AC_FUNC_FORK AC_FUNC_MALLOC AC_FUNC_SELECT_ARGTYPES AC_TYPE_SIGNAL AC_CHECK_FUNCS([dup2 gethostbyname inet_ntoa memset regcomp select socket strchr strncasecmp daemon]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT ffproxy-1.6.orig/install-sh0000750000175000017500000002143210015235744014500 0ustar manumanu#!/bin/sh # install - install a program, script, or datafile scriptversion=2004-01-12.10 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename= transform_arg= instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= usage="Usage: $0 [OPTION]... SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 -d DIRECTORIES... In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. In the second, create the directory path DIR. Options: -b=TRANSFORMBASENAME -c copy source (using $cpprog) instead of moving (using $mvprog). -d create directories instead of installing files. -g GROUP $chgrp installed files to GROUP. -m MODE $chmod installed files to MODE. -o USER $chown installed files to USER. -s strip installed files (using $stripprog). -t=TRANSFORM --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; -c) instcmd=$cpprog shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit 0;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; --version) echo "$0 $scriptversion"; exit 0;; *) # When -d is used, all remaining arguments are directories to create. test -n "$dir_arg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then instcmd=: chmodcmd= else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift test -d "$pathcomp" || $mkdirprog "$pathcomp" pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $instcmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else # If we're going to rename the final executable, determine the name now. if test -z "$transformarg"; then dstfile=`basename "$dst"` else dstfile=`basename "$dst" $transformbasename \ | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename. test -z "$dstfile" && dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now remove or move aside any old file at destination location. We # try this two ways since rm can't unlink itself on some systems and # the destination file might be busy for other reasons. In this case, # the final cleanup might fail but the new file should still install # successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi || { (exit 1); exit; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ffproxy-1.6.orig/filter.c0000640000175000017500000001103010165212411014107 0ustar manumanu/* * ffproxy (c) 2002, 2003 Niklas Olmes * http://faith.eu.org * * $Id: filter.c,v 2.1 2004/12/31 08:59:15 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include #include "configure.h" #ifdef HAVE_STDLIB_H # include #endif #include #include "req.h" #include "dbs.h" #include "print.h" #include "alloc.h" #include "http.h" #include "regex.h" #include "filter.h" static void rotate(int, char *[]); extern char loop_header[]; int filter_request(struct req * r) { size_t i; int j; i = 0; while (f_host[i] != NULL) if (do_regex(r->host, f_host[i++]) == 0) return 1; i = 0; while (f_url[i] != NULL) if (do_regex(r->url, f_url[i++]) == 0) return 1; i = 0; start_over: while (r->header[i] != NULL && i < sizeof(r->header) - 2) { DEBUG(("filter_request() => header entry %d (%s)", i, r->header[i])); if (strncasecmp(r->header[i], loop_header, strlen(loop_header)) == 0) { DEBUG(("filter_request() => LOOP DETECTED")); r->loop = 1; return -1; } if (http_parse(r, r->header[i]) == 0) goto skip; j = 0; while (f_hdr_drop[j] != NULL) if (do_regex(r->header[i], f_hdr_drop[j++]) == 0) return 1; j = 0; while (f_hdr_entry[j] != NULL) { if (strncasecmp(r->header[i], f_hdr_entry[j], strlen(f_hdr_entry[j])) == 0) { rotate(i, r->header); goto start_over; } j++; } j = 0; while (f_hdr_match[j] != NULL) { if (do_regex(r->header[i], f_hdr_match[j]) == 0) { rotate(i, r->header); goto start_over; } j++; } skip: i++; } if (r->header[i] != NULL) free(r->header[i]); r->header[i] = (char *) my_alloc(strlen(loop_header) + 1); (void) strcpy(r->header[i], loop_header); DEBUG(("filter_request() => added loop header[%d] (%s)", i, r->header[i])); i++; j = 0; while (f_hdr_add[j] != NULL && i < sizeof(r->header) - 1) { r->header[i] = (char *) my_alloc(strlen(f_hdr_add[j]) + 1); (void) strcpy(r->header[i], f_hdr_add[j]); DEBUG(("filter_request() => added header[%d] (%s)", i, r->header[i])); i++, j++; } r->header[i] = NULL; DEBUG(("filter_request() => done, request ok")); return 0; } static const char http_pkalive[] = "Proxy-Connection: keep-alive"; static const char http_kalive[] = "Connection: keep-alive"; int filter_remote(struct req * r) { size_t i; int j; i = 0; start_over: while (r->header[i] != NULL) { DEBUG(("filter_remote() => remote header entry %d (%s)", i, r->header[i])); if (strncasecmp(r->header[i], loop_header, strlen(loop_header)) == 0) { DEBUG(("filter_request() => LOOP DETECTED")); r->loop = 1; return -1; } if (http_parse(r, r->header[i]) == 0) goto skip; j = 0; while (f_rhdr_drop[j] != NULL) if (do_regex(r->header[i], f_rhdr_drop[j++]) == 0) return 1; j = 0; while (f_rhdr_entry[j] != NULL) { if (strncasecmp(r->header[i], f_rhdr_entry[j], strlen(f_rhdr_entry[j])) == 0) { rotate(i, r->header); goto start_over; } j++; } j = 0; while (f_rhdr_match[j] != NULL) { if (do_regex(r->header[i], f_rhdr_match[j]) == 0) { rotate(i, r->header); goto start_over; } j++; } skip: i++; } if(r->kalive && i - 2 < sizeof(r->header)) { r->header[i] = (char *) my_alloc(strlen(http_pkalive) + 1); (void) strcpy(r->header[i], http_pkalive); r->header[++i] = (char *) my_alloc(strlen(http_kalive) + 1); (void) strcpy(r->header[i], http_kalive); r->header[++i] = NULL; } else if(r->kalive) { r->kalive = 0; } DEBUG(("filter_remote() => done, request ok")); return 0; } static void rotate(int i, char *a[]) { if (a[i] == NULL) { DEBUG(("rotate() => entry to rotate, %d, is NULL", i)); } else { DEBUG(("rotate() => freeing a[%d] == (%s)", i, a[i])); free(a[i]); a[i] = a[i + 1]; if (a[i + 1] != NULL) { i++; while (a[i] != NULL) { a[i] = a[i + 1]; i++; } } } DEBUG(("rotate() => done")); } ffproxy-1.6.orig/filter.h0000640000175000017500000000013307517766752014153 0ustar manumanuint filter_request(struct req *); int filter_remote(struct req *); ffproxy-1.6.orig/access.c0000640000175000017500000000300510061271660014074 0ustar manumanu/* * ffproxy (c) 2002, 2003 Niklas Olmes * http://faith.eu.org * * $Id: access.c,v 2.0 2004/06/08 06:39:51 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include "req.h" #include "dbs.h" #include "print.h" #include "dns.h" #include "regex.h" #include "access.h" int check_access(const struct clinfo * host) { int i; if (*host->ip != '\0') { i = 0; while (a_ip[i] != NULL) if (do_regex(host->ip, a_ip[i++]) == 0) return 0; if (*host->name != '\0') { i = 0; while (a_host[i] != NULL) if (do_regex(host->name, a_host[i++]) == 0) return 0; } i = 0; while (a_dyndns[i] != NULL) if (strcmp(host->ip, resolve_to_a(a_dyndns[i++])) == 0) return 0; } DEBUG(("check_access() => done, no access. IP (%s) Host (%s)", host->ip, host->name)); return 1; } ffproxy-1.6.orig/access.h0000640000175000017500000000006507512335211014104 0ustar manumanuint check_access(const struct clinfo *); ffproxy-1.6.orig/mkinstalldirs0000750000175000017500000000556110015235745015310 0ustar manumanu#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2003-11-08.23 # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit 0 ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./-- && rmdir ./-- fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./-- "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ffproxy-1.6.orig/file.c0000640000175000017500000000241010165212411013543 0ustar manumanu/* * ffproxy (c) 2002, 2003 Niklas Olmes * http://faith.eu.org * * $Id: file.c,v 2.1 2004/12/31 08:59:15 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include #include "configure.h" #ifdef HAVE_FCNTL_H # include #endif #include "print.h" #include "file.h" int my_open(const char *path) { int f; if ((f = open(path, O_RDONLY, 0)) < 0) fatal("unable to open file %s", path); return f; } FILE * my_fopen(const char *path) { FILE *fp; if ((fp = fopen(path, "r")) == NULL) fatal("unable to open file %s", path); return fp; } ffproxy-1.6.orig/file.h0000640000175000017500000000012707517766752013610 0ustar manumanuint my_open(const char *path); FILE *my_fopen(const char *path); ffproxy-1.6.orig/request.c0000640000175000017500000003554010165212412014327 0ustar manumanu/* * ffproxy (c) 2002-2004 Niklas Olmes * http://faith.eu.org * * $Id: request.c,v 2.1 2004/12/31 08:59:15 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include "configure.h" #ifdef HAVE_SYS_TYPES_H # include #endif #include #include #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #include #include "req.h" #include "cfg.h" #include "msg.h" #include "alloc.h" #include "print.h" #include "http.h" #include "filter.h" #include "poll.h" #include "request.h" #include "configure.h" static int read_header(int, struct req *); static char sgetc(int); static size_t getline(int, char[], int); static int do_request(int, struct req *); void handle_request(int cl, struct clinfo * clinfo) { extern struct cfg config; struct req r; char buf[2048]; keep_alive: (void) memset(&r, 0, sizeof(r)); r.cl = clinfo; if (getline(cl, buf, sizeof(buf)) < 1) *buf = '\0'; if ((http_url(&r, buf)) == 0) { int i; r.loop = 0; if (r.type == CONNECT) { DEBUG(("handle_request => CONNECT request detected")); if (read_header(cl, &r) != 0) { info("invalid CONNECT header from (%s) [%s]", clinfo->name, clinfo->ip); err_msg(cl, &r, E_INV); } else if (r.port != 443 && ! config.unr_con) { info("invalid CONNECT port (%d) for host (%s) from (%s) [%s]", r.port, r.host, clinfo->name, clinfo->ip); err_msg(cl, &r, E_INV); } else if (filter_request(&r) != 0) { info("filtered CONNECT request for (%s:%d) from (%s) [%s]", r.host, r.port, clinfo->name, clinfo->ip); } else { if (config.logrequests) { if (r.port == 443) info("HTTPS CONNECT to (%s) from (%s) [%s]", r.host, clinfo->name, clinfo->ip); else info("CONNECT to host (%s:%d) from (%s) [%s]", r.host, r.port, clinfo->ip); } i = do_request(cl, &r); switch (i) { case E_INV: info("invalid CONNECT request for (%s:%d) from (%s) [%s]", r.host, r.port, clinfo->name, clinfo->ip); break; case E_RES: info("resolve failure for host (%s) from (%s) [%s]", r.host, clinfo->name, clinfo->ip); break; case E_CON: info("connection failure for host (%s) from (%s) [%s]", r.host, clinfo->name, clinfo->ip); break; default: i = 0; } if (i != 0) { err_msg(cl, &r, i); r.kalive = 0; } } i = 0; while (r.header[i] != NULL) free(r.header[i++]); r.header[0] = NULL; } else if (read_header(cl, &r) != 0) { info("invalid header from (%s) [%s]", clinfo->name, clinfo->ip); err_msg(cl, &r, E_INV); i = 0; while (r.header[i] != NULL) free(r.header[i++]); r.header[0] = NULL; } else if (filter_request(&r) != 0) { info("filtered request for URL (%s) from (%s) [%s]", r.url, clinfo->name, clinfo->ip); if (r.loop) warn("LOOP DETECTED for URL (%s) from (%s) [%s]", r.url, clinfo->name, clinfo->ip); else err_msg(cl, &r, E_FIL); i = 0; while (r.header[i] != NULL) free(r.header[i++]); r.header[0] = NULL; } else { if (config.logrequests) info("request for URL (%s) from (%s) [%s]", r.url, clinfo->name, clinfo->ip); i = do_request(cl, &r); switch (i) { case E_INV: info("invalid request for URL (%s) from (%s) [%s]", r.url, clinfo->name, clinfo->ip); break; case E_RES: info("resolve failure for host (%s) from (%s) [%s]", r.host, clinfo->name, clinfo->ip); break; case E_CON: info("connection failure for host (%s) from (%s) [%s]", r.host, clinfo->name, clinfo->ip); break; case E_POST: info("failure while post for URL (%s) from (%s) [%s]", r.url, clinfo->name, clinfo->ip); break; case E_FIL: info("filtered request for URL (%s) from (%s) [%s]", r.url, clinfo->name, clinfo->ip); break; default: i = 0; } if (i != 0) { err_msg(cl, &r, i); r.kalive = 0; } i = 0; while (r.header[i] != NULL) free(r.header[i++]); r.header[0] = NULL; if (config.kalive && r.kalive && r.clen > 0L) goto keep_alive; } } else { if (*buf == '\0') { ; } else { info("invalid request from (%s) [%s]", clinfo->name, clinfo->ip); } } } static int read_header(int cl, struct req * r) { size_t len, i; char buf[2048]; char *b, *p; i = 0; while ((len = getline(cl, buf, sizeof(buf))) > 0 && i < sizeof(r->header) - 1) { b = buf; while (isspace((int) *b) && *(b++) != '\0'); if (*b == '\0') continue; p = (char *) my_alloc(len + 1); (void) strcpy(p, b); r->header[i] = p; DEBUG(("read_header() => entry %d (%s)", i, r->header[i])); i++; if (r->relative && http_rel(r, p) != 0) { r->header[i] = NULL; return 1; } } r->header[i] = NULL; if (i >= sizeof(r->header) - 1) return 1; return 0; } static char sgetc(int s) { char c; if (read(s, &c, 1) != 1 || c < 1) return -1; else return c; } static size_t getline(int s, char buf[], int len) { int c; size_t i; if (my_poll(s, IN) <= 0) return 0; i = 0; while (--len > 0) { c = sgetc(s); if (c == '\n' || c == -1) break; else if (c != '\r') buf[i++] = c; } buf[i] = '\0'; return i; } #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_NETDB_H # include #endif #include #ifdef HAVE_STDLIB_H # include #endif #include #ifdef HAVE_UNISTD_H # include #endif #include "dns.h" static int do_request(int cl, struct req * r) { extern struct cfg config; unsigned long ip; int s; void *foo; size_t len, i; char buf[4096]; len = 0; ip = 0L; s = 0; if (config.use_ipv6 && (config.aux_proxy_ipv6 || *config.proxyhost == '\0')) { struct addrinfo hints, *res, *res0; char port[6]; DEBUG(("do_request() => trying ipv6")); port[0] = '\0'; (void) memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; if (*config.proxyhost != '\0' && config.proxyport) { DEBUG(("do_request() => trying ipv6 for proxy %s port %d", config.proxyhost, config.proxyport)); (void) snprintf(port, 6, "%d", config.proxyport); if (getaddrinfo(config.proxyhost, port, &hints, &res)) { DEBUG(("do_request() => getaddrinfo() failed for proxy %s", config.proxyhost)); return E_RES; } } else { (void) snprintf(port, 6, "%d", r->port); if (getaddrinfo(r->host, port, &hints, &res)) { DEBUG(("do_request() => getaddrinfo() failed for %s", r->host)); return E_RES; } } s = -1; for (res0 = res; res; res = res->ai_next) { if ((s = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) < 0) continue; else if (connect(s, res->ai_addr, res->ai_addrlen) < 0) { (void) close(s); s = -1; continue; } else break; } freeaddrinfo(res0); if (s == -1) { if (*config.proxyhost != '\0' && config.proxyport) { DEBUG(("do_request() => socket() or connect() after getaddrinfo() failed for proxy %s port %d", config.proxyhost, config.proxyport)); } else { DEBUG(("do_request() => socket() or connect() after getaddrinfo() failed for %s port %d", r->host, r->port)); } return E_CON; } } else { struct sockaddr_in addr; DEBUG(("do_request() => not trying ipv6")); (void) memset(&addr, 0, sizeof(addr)); if (*config.proxyhost != '\0' && config.proxyport) { DEBUG(("do_request() => using aux proxy w/o trying ipv6")); if ((addr.sin_addr.s_addr = resolve(config.proxyhost)) == INADDR_NONE) { DEBUG(("do_request() => resolve failure for proxy %s", config.proxyhost)); return E_RES; } addr.sin_port = htons(config.proxyport); addr.sin_family = AF_INET; } else { if ((ip = resolve(r->host)) == INADDR_NONE) { DEBUG(("do_request() => resolve failure for %s", r->host)); return E_RES; } addr.sin_addr.s_addr = ip; addr.sin_port = htons(r->port); addr.sin_family = AF_INET; } if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) { DEBUG(("do_request() => socket() failed for %s port %d", r->host, r->port)); return E_CON; } else if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &foo, sizeof(foo)) != 0) { DEBUG(("do_request() => setsockopt() failed for %s port %d", r->host, r->port)); return E_CON; } else if (connect(s, (struct sockaddr *) & addr, sizeof(addr)) == -1) { DEBUG(("do_request() => connect() failed for %s port %d", r->host, r->port)); return E_CON; } } #ifdef USE_DEBUG i = 0; DEBUG(("do_request() => header is:")); while (r->header[i] != NULL) DEBUG(("=> [%s]", r->header[i++])); #endif if (r->vmajor >= 1 && r->vminor >= 0) r->vmajor = 1, r->vminor = 0; if (config.accel && config.accelusrhost) len = snprintf(buf, sizeof(buf), "%s %s HTTP/%d.%d\r\n", ((r->type == GET) ? "GET" : ((r->type) == HEAD) ? "HEAD" : "POST"), (*config.proxyhost && config.proxyport) != '\0' ? r->url : r->urlpath, r->vmajor, r->vminor); else if (r->port == 80) len = snprintf(buf, sizeof(buf), "%s %s HTTP/%d.%d\r\n" "Host: %s\r\n", ((r->type == GET) ? "GET" : ((r->type) == HEAD) ? "HEAD" : "POST"), (*config.proxyhost && config.proxyport) != '\0' ? r->url : r->urlpath, r->vmajor, r->vminor, r->host); else if (r->port == 443 || r->type == CONNECT) { *buf = '\0'; len = 0; } else len = snprintf(buf, sizeof(buf), "%s %s HTTP/%d.%d\r\n" "Host: %s:%d\r\n", ((r->type == GET) ? "GET" : ((r->type) == HEAD) ? "HEAD" : "POST"), (*config.proxyhost && config.proxyport) != '\0' ? r->url : r->urlpath, r->vmajor, r->vminor, r->host, r->port); if (r->type != CONNECT) { i = 0; while (r->header[i] != NULL) { len += strlen(r->header[i]) + strlen("\r\n"); if (len < sizeof(buf)) { (void) strncat(buf, r->header[i++], len); (void) strncat(buf, "\r\n", strlen("\r\n")); } else { DEBUG(("do_request() => header too big")); (void) close(s); i = 0; while (r->header[i] != NULL) free(r->header[i++]); r->header[0] = NULL; return E_INV; } } } i = 0; while (r->header[i] != NULL) free(r->header[i++]); r->header[0] = NULL; if (r->type != CONNECT) { len += strlen("\r\n"); if (len >= sizeof(buf) - 1) { DEBUG(("do_request() => header too big")); (void) close(s); return E_INV; } (void) strncat(buf, "\r\n", strlen("\r\n")); DEBUG(("do_request() => request ready: type %d url (%s) host (%s) port %d", r->type, r->url, r->host, r->port)); DEBUG(("=> version maj %d min %d", r->vmajor, r->vminor)); DEBUG(("=> header: (%s)", buf)); if (my_poll(s, OUT) <= 0 || write(s, buf, len) < 1) { DEBUG(("do_request() => sending request failed")); (void) close(s); return E_CON; } } if (r->type == POST) { long rest; DEBUG(("do_request() => posting data")); if ((rest = r->clen) < 0L) { DEBUG(("do_request() => post: invalid clen %ld", r->clen)); (void) close(s); return E_POST; } while (rest > 0L) { if (my_poll(cl, OUT) <= 0) { (void) close(s); return E_POST; } len = read(cl, buf, sizeof(buf)); if (len < 1) break; else rest -= len; if (my_poll(s, OUT) <= 0 || write(s, buf, len) < 1) { DEBUG(("do_request() => post: error writing post data")); (void) close(s); return E_POST; } } DEBUG(("do_request() => post done")); } if (r->type != CONNECT) { i = 0; while ((len = getline(s, buf, sizeof(buf))) > 0 && i < sizeof(r->header) - 1) { DEBUG(("do_request() => got remote header line: (%s)", buf)); r->header[i] = (char *) my_alloc(len + 1); (void) strcpy(r->header[i++], buf); } r->header[i] = NULL; if (len > 0) { DEBUG(("do_request() => remote header too big")); (void) close(s); i = 0; while (r->header[i] != NULL) free(r->header[i++]); r->header[0] = NULL; return E_FIL; } if (filter_remote(r) != 0) { DEBUG(("do_request() => response was filtered")); (void) close(s); i = 0; while (r->header[i] != NULL) free(r->header[i++]); r->header[0] = NULL; return E_FIL; } *buf = '\0'; len = 0; i = 0; while (r->header[i] != NULL) { len += strlen(r->header[i]) + strlen("\r\n"); if (len < sizeof(buf) - 1) { (void) strcat(buf, r->header[i++]); (void) strcat(buf, "\r\n"); } else { DEBUG(("do_request() => remote header too big (at concatenation)")); i = 0; while (r->header[i] != NULL) free(r->header[i++]); r->header[0] = NULL; (void) close(s); return E_FIL; } } i = 0; while (r->header[i] != NULL) free(r->header[i++]); r->header[0] = NULL; len += strlen("\r\n"); if (len >= sizeof(buf) - 1) { DEBUG(("do_request() => remote header too big (at final)")); (void) close(s); return E_FIL; } (void) strcat(buf, "\r\n"); DEBUG(("do_request() => remote header ready: (%s)", buf)); if (my_poll(cl, OUT) <= 0 || write(cl, buf, len) < 1) { (void) close(s); return -1; } } if (r->type == CONNECT) { char *con_est = "HTTP/1.0 200 Connection established\r\n\r\n"; int max, sel; struct timeval to; fd_set fdset; to.tv_sec = config.to_con; to.tv_usec = 0; if (write(cl, con_est, strlen(con_est)) < 1) goto c_break; if(cl >= s) max = cl + 1; else max = s + 1; i = 1; sel = 1; len = 1; while (len > 0 && sel > 0 && i > 0) { FD_ZERO(&fdset); FD_SET(cl, &fdset); FD_SET(s, &fdset); sel = select(max, &fdset, (fd_set*) 0, (fd_set*) 0, &to); if (FD_ISSET(cl, &fdset)) { len = read(cl, buf, sizeof(buf)); i = write(s, buf, len); } if (FD_ISSET(s, &fdset)) { len = read(s, buf, sizeof(buf)); i = write(cl, buf, len); } } c_break: (void) close(s); return 0; } else if (r->type != HEAD) { while (my_poll(s, IN) > 0 && (len = read(s, buf, sizeof(buf))) > 0) { if (my_poll(cl, OUT) <= 0 || write(cl, buf, len) < 1) { (void) close(s); return -1; } } (void) close(s); return 0; } return 0; } ffproxy-1.6.orig/request.h0000640000175000017500000000006607517766752014363 0ustar manumanuvoid handle_request(int, struct clinfo *); ffproxy-1.6.orig/Makefile.in0000640000175000017500000000666710167006262014556 0ustar manumanu# # $Id: Makefile.in,v 1.13 2005/01/05 15:50:08 niklas Exp niklas $ # #OPTIONS = -DDEBUG #OPTIONS = -W -Wall -Werror -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wbad-function-cast -pedantic-errors -O2 srcdir=@srcdir@ VPATH=@srcdir@ prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ mandir=@mandir@ DESTDIR= SHELL=@SHELL@ SRCS = main.c print.c socket.c request.c http.c alloc.c filter.c db.c file.c dns.c signals.c access.c regex.c msg.c poll.c number.c OBJS = $(SRCS:.c=.o) MANPAGES = ffproxy.8 ffproxy.conf.5 ffproxy.quick.7 SMANPAGES = ffproxy.8.s ffproxy.conf.5.s ffproxy.quick.7.s MY_DBFILES=db/access.dyndns db/access.host db/access.ip db/filter.header.add db/filter.header.drop db/filter.header.entry db/filter.header.match db/filter.host.match db/filter.rheader.drop db/filter.rheader.entry db/filter.rheader.match db/filter.url.match MY_HTMLFILES=html/connect html/filtered html/invalid html/post html/resolve sysconfdir=@sysconfdir@ datadir=@datadir@ pkgdatadir=$(datadir)/ffproxy CC=@CC@ CFLAGS=@CFLAGS@ -DCFGFILE="\"${sysconfdir}/ffproxy.conf\"" \ -DDATADIR="\"$(pkgdatadir)\"" $(OPTIONS) LDFLAGS=@LDFLAGS@ LIBS=@LIBS@ INSTALL=@INSTALL@ INSTALL_PROGRAM=@INSTALL_PROGRAM@ INSTALL_DATA=@INSTALL_DATA@ all: ffproxy man conf man: for i in $(MANPAGES); do \ sed -e 's|_BASE_|$(pkgdatadir)|g' -e 's|_CFGFILE_|$(sysconfdir)/ffproxy.conf|g' $$i.s > $$i; \ done || for i in $(MANPAGES); do \ cp $$i $$i.s; done conf: sed -e 's|_BASE_|$(pkgdatadir)|g' sample.config.s \ > sample.config || cp sample.config.s sample.config cp sample.config ffproxy.conf installdirs: mkinstalldirs $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) \ $(DESTDIR)$(datadir) \ $(DESTDIR)$(sysconfdir) \ $(DESTDIR)$(pkgdatadir) \ $(DESTDIR)$(pkgdatadir)/db \ $(DESTDIR)$(pkgdatadir)/html \ $(DESTDIR)$(mandir) \ $(DESTDIR)$(mandir)/man5 \ $(DESTDIR)$(mandir)/man7 \ $(DESTDIR)$(mandir)/man8 install: installdirs install_bin install_man install_config install_sample install_data install_bin: ffproxy $(INSTALL_PROGRAM) ffproxy $(DESTDIR)$(bindir) install_man: man $(INSTALL_DATA) ffproxy.conf.5 $(DESTDIR)$(mandir)/man5 $(INSTALL_DATA) ffproxy.quick.7 $(DESTDIR)$(mandir)/man7 $(INSTALL_DATA) ffproxy.8 $(DESTDIR)$(mandir)/man8 install_config: conf $(INSTALL_DATA) ffproxy.conf $(DESTDIR)$(sysconfdir) install_sample: conf $(INSTALL_DATA) sample.config $(DESTDIR)$(pkgdatadir) install_data: $(INSTALL_DATA) $(MY_DBFILES) $(DESTDIR)$(pkgdatadir)/db $(INSTALL_DATA) $(MY_HTMLFILES) $(DESTDIR)$(pkgdatadir)/html uninstall: uninstall_bin uninstall_man uninstall_sample uninstall_all: uninstall uninstall_config uninstall_data uninstall_bin: -rm -f $(DESTDIR)$(bindir)/ffproxy uninstall_man: -rm -f $(DESTDIR)$(mandir)/man5/ffproxy.conf.5 -rm -f $(DESTDIR)$(mandir)/man7/ffproxy.quick.7 -rm -f $(DESTDIR)$(mandir)/man8/ffproxy.8 uninstall_sample: -rm -f $(DESTDIR)$(pkgdatadir)/sample.config uninstall_config: -rm -f $(DESTDIR)$(sysconfdir)/ffproxy.conf uninstall_data: uninstall_sample -( cd $(DESTDIR)$(pkgdatadir) && rm -f $(MY_DBFILES) ) -( cd $(DESTDIR)$(pkgdatadir) && rm -f $(MY_HTMLFILES) ) -rmdir $(DESTDIR)$(pkgdatadir)/db -rmdir $(DESTDIR)$(pkgdatadir)/html -rmdir $(DESTDIR)$(pkgdatadir) ffproxy: $(OBJS) $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) clean: rm -f $(OBJS) $(MANPAGES) sample.config ffproxy.conf ffproxy distclean: clean rm -f Makefile configure.h config.cache config.log config.status ffproxy-1.6.orig/http.c0000640000175000017500000001761210165212412013616 0ustar manumanu/* * ffproxy (c) 2002-2004 Niklas Olmes * http://faith.eu.org * * $Id: http.c,v 2.1 2004/12/31 08:59:15 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include #include "req.h" #include "print.h" #include "cfg.h" #include "number.h" #include "http.h" #define my_isblank(c) ((c) == ' ' || (c) == '\t') static const char http_get[] = "GET "; static const char http_post[] = "POST "; static const char http_head[] = "HEAD "; static const char http_connect[] = "CONNECT "; static const char http[] = "http://"; static const char httpv[] = "HTTP/"; int http_url(struct req * r, const char *s) { extern struct cfg config; size_t i, k; char *p; if (strncmp(http_get, s, strlen(http_get)) == 0) { r->type = GET; s += strlen(http_get); } else if (strncmp(http_post, s, strlen(http_post)) == 0) { r->type = POST; s += strlen(http_post); } else if (strncmp(http_head, s, strlen(http_head)) == 0) { r->type = HEAD; s += strlen(http_head); } else if (strncmp(http_connect, s, strlen(http_connect)) == 0) { r->type = CONNECT; s += strlen(http_connect); } else { r->type = UNKNOWN; return -1; } while (*s == ' ') s++; DEBUG(("http_url() => got url part (%s)", s)); i = 0; if (config.accel) { r->relative = 0; DEBUG(("http_url() => using as accelerator proxy")); DEBUG(("http_url() => accelhost (%s) port %d", config.accelhost, config.accelport)); i = snprintf(r->url, sizeof(r->url), "%s%s:%d", http, config.accelhost, config.accelport); if (i < 1) fatal_n("http_url() => accelhost is too long, can't create r->url"); DEBUG(("http_url() => created url (%s) length (%d)", r->url, i)); } else if (strncmp(s, http, strlen(http)) != 0) { r->relative = 1; } else { r->relative = 0; while (i < strlen(http)) { r->url[i] = http[i]; i++, s++; } while (i < sizeof(r->url) - 1 && *s != '_' && (isalnum((int) *s) || *s == '-' || *s == '.' || *s == ':')) r->url[i++] = tolower((int) *(s++)); r->url[i] = '\0'; if (*s != '/' && *s != ' ') { r->type = UNKNOWN; return -1; } } if (config.accel && strncmp(s, http, strlen(http)) == 0) { r->url[i++] = '\0'; s += strlen(http); while (*s != ' ' && *s != '/' && *s != '\0' && isprint((int) *s)) s++; } k = 0; while (i < sizeof(r->url) - 1 && k < sizeof(r->urlpath) - 1 && *s != ' ' && *s != '\0' && isprint((int) *s)) { r->urlpath[k++] = *s; r->url[i++] = *(s++); } if (k == 0) r->urlpath[k++] = '/'; r->urlpath[k] = '\0'; r->url[i] = '\0'; if (*s != ' ') { r->type = UNKNOWN; return -1; } if (r->type == CONNECT) *r->url = '\0'; DEBUG(("http_url() => extracted urlpath (%s)", r->urlpath)); DEBUG(("http_url() => extracted url (%s)", r->url)); while (*s == ' ') s++; DEBUG(("http_url() => got version part (%s)", s)); if (strncasecmp(s, httpv, strlen(httpv)) != 0) return -1; s += strlen(httpv); r->vmajor = 0; r->vminor = 0; i = 0; while (i < 2 && *s != '\0' && isdigit((int) *s)) { r->vmajor = r->vmajor * 10 + my_ctoi(*(s++)); i++; } if (*s == '.') { s++; while (i < 4 && *s != '\0' && isdigit((int) *s)) { r->vminor = r->vminor * 10 + my_ctoi(*(s++)); i++; } } DEBUG(("http_url() => got type %d url (%s) version maj %d min %d", r->type, r->url, r->vmajor, r->vminor)); p = r->url; p += strlen(http); if(r->relative || r->type == CONNECT) return 0; i = 0; while ((isalnum((int) *p) || *p == '-' || *p == '.') && i < sizeof(r->host) - 1) r->host[i++] = tolower((int) *(p++)); r->host[i] = '\0'; if (i >= sizeof(r->host) - 1) { DEBUG(("http_url() => host: too long (%s)", r->host)); *r->host = '\0'; r->port = 0; return -1; } if (*p == ':') { p++; r->port = 0; while (isdigit((int) *p)) { r->port = r->port * 10 + my_ctoi(*(p++)); if (r->port >= 65534) { DEBUG(("http_url() => port: bad port number")); r->port = 0; return -1; } } if (*p != '\0' && *p != ' ' && *p != '/') { DEBUG(("http_url() => port: bad port")); r->port = 0; return -1; } DEBUG(("http_url() => port: %d", r->port)); } else { DEBUG(("http_url() => default port 80")); r->port = 80; } return 0; } static const char h_host[] = "Host: "; int http_rel(struct req * r, const char *s) { size_t i; i = 0; if (r->relative && strncmp(s, h_host, strlen(h_host)) == 0) { r->relative = 0; s += strlen(h_host); while (*s == ' ') s++; while ((isalnum((int) *s) || *s == '-' || *s == '.') && i < sizeof(r->host) - 1) r->host[i++] = tolower((int) *(s++)); r->host[i] = '\0'; if (i >= sizeof(r->host) || (*s != ':' && *s != '\0')) { DEBUG(("http_rel() => invalid host header (%s)", r->host)); r->host[0] = '\0'; return 1; } DEBUG(("http_rel() => extracted host (%s)", r->host)); if (*s == ':') { i = 0; r->port = 0; s++; while (isdigit((int) *s) && i++ < 6) r->port = r->port * 10 + my_ctoi(*(s++)); if (i > 5 && i == 0) { DEBUG(("http_rel() => bad port number")); r->port = 0; return 1; } DEBUG(("http_rel() => extracted port %d", r->port)); } else { if (r->type == CONNECT) r->port = 443; else r->port = 80; } if (strlen(r->url) + strlen(http) + strlen(r->host) + 7 >= sizeof(r->url)) { DEBUG(("http_rel() => URL will get too long")); return 1; } else { char o_url[sizeof(r->url)]; (void) strncpy(o_url, r->url, sizeof(o_url) - 1); o_url[sizeof(o_url) - 1] = '\0'; if (r->port == 80) (void) snprintf(r->url, sizeof(r->url), "http://%s%s", r->host, o_url); else (void) snprintf(r->url, sizeof(r->url), "http://%s:%d%s", r->host, r->port, o_url); DEBUG(("http_rel() => extracted URL (%s)", r->url)); } } return 0; } static const char http_clen[] = "Content-Length: "; static const char http_pkalive[] = "Proxy-Connection: keep-alive"; static const char http_kalive[] = "Connection: keep-alive"; #ifdef TSTAMP static const char http_tstamp[] = "Last-Modified: "; #endif int http_parse(struct req * r, const char *s) { size_t i; if (strncasecmp(http_clen, s, strlen(http_clen)) == 0) { DEBUG(("http_parse() => found clen header (%s)", s)); s += strlen(http_clen); while (my_isblank(*s)) s++; if (!isdigit((int) *s)) { DEBUG(("http_parse() => clen: no digit found (%s)", s)); return -1; } r->clen = 0L; i = 0; while (i < 10 && isdigit((int) *s)) r->clen = r->clen * 10L + (long) my_ctoi(*(s++)); if (*s != '\0') { r->clen = 0L; DEBUG(("http_parse() => clen: too long")); return -1; } DEBUG(("http_parse() => clen: %ld bytes", r->clen)); return 0; #ifdef TSTAMP } else if (strncasecmp(http_tstamp, s, strlen(http_tstamp)) == 0) { DEBUG(("http_parse() => found tstamp header (%s)", s)); s += strlen(http_tstamp); while (my_isblank(*s)) s++; i = 0; while (i < sizeof(r->tstamp) - 1 && *s != '\0') r->tstamp[i++] = *(s++); r->tstamp[i] = '\0'; if (*s != '\0') { r->tstamp[0] = '\0'; DEBUG(("http_parse()_ => tstamp: too long")); return -1; } DEBUG(("http_parse() => tstamp: extracted (%s)", r->tstamp)); return 0; #endif } else if (strncasecmp(http_pkalive, s, strlen(http_pkalive)) == 0 || strncasecmp(http_kalive, s, strlen(http_kalive)) == 0) { DEBUG(("http_parse() => keep alive header found")); r->kalive = 1; return 1; } return 1; } ffproxy-1.6.orig/http.h0000640000175000017500000000024407717571331013635 0ustar manumanuint http_url(struct req *, const char *); int http_rel(struct req *, const char *); int http_parse(struct req *, const char *); ffproxy-1.6.orig/main.c0000640000175000017500000002275310167001763013574 0ustar manumanu/* * ffproxy (c) 2002-2005 Niklas Olmes * http://faith.eu.org * * $Id: main.c,v 2.2 2005/01/05 15:12:49 niklas Exp niklas $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include "configure.h" #ifdef HAVE_SYS_TYPES_H # include #endif #include #ifdef HAVE_STDLIB_H # include #endif #include #ifdef HAVE_UNISTD_H # include #endif #include #include #include #include "cfg.h" #include "print.h" #include "socket.h" #include "db.h" #include "dns.h" #include "signals.h" #if !defined(HAVE_DAEMON) || defined(NEED_DAEMON) || defined(__sun__) #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_FCNTL_H # include #endif static int daemon(int, int); int daemon(int nochdir, int noclose) { int f; f = open("/dev/null", O_RDWR); (void) dup2(STDIN_FILENO, f); (void) dup2(STDERR_FILENO, f); (void) dup2(STDOUT_FILENO, f); if (fork()) _exit(0); return 0; } #endif static void usage(void); static void drop_privileges(void); static const char version[] = "1.6"; static const char rcsid[] = "$Id: main.c,v 2.2 2005/01/05 15:12:49 niklas Exp niklas $"; char loop_header[100]; struct cfg config; int main(int argc, char *argv[]) { int c, nowarn; char *prgname; prgname = argv[0]; nowarn = 0; (void) memset(&config, 0, sizeof(config)); *config.ipv4 = '\0'; *config.ipv6 = '\0'; config.port = 0; config.daemon = 0; config.childs = 10; config.ccount = 0; config.backlog = 4; config.uid = 0L; config.gid = 0L; *config.chroot = '\0'; (void) strncpy(config.dbdir, DATADIR, sizeof(config.dbdir) - 1); config.dbdir[sizeof(config.dbdir) - 1] = '\0'; (void) strncpy(config.file, CFGFILE, sizeof(config.file) - 1); config.file[sizeof(config.file) - 1] = '\0'; *config.proxyhost = '\0'; config.proxyport = 0; config.syslog = 1; config.logrequests = 0; config.use_ipv6 = 1; config.aux_proxy_ipv6 = 1; config.bind_ipv6 = 1; config.bind_ipv4 = 1; config.accel = 0; config.accelusrhost = 1; *config.accelhost = '\0'; config.accelport = 80; config.kalive = 1; config.unr_con = 0; config.to_con = 5; config.first = 1; while ((c = getopt(argc, argv, "vdbBc:C:p:x:X:l:u:g:r:D:F:f:s4a:A:h")) != -1) { switch (c) { case 'v': (void) printf("ffproxy version %s, %s\n", version, rcsid); exit(0); break; case 'd': config.daemon = 1; break; case 'b': config.bind_ipv4 = 0; break; case 'B': config.bind_ipv6 = 0; break; case 'c': (void) strncpy(config.ipv4, optarg, sizeof(config.ipv4) - 1); config.ipv4[sizeof(config.ipv4) - 1] = '\0'; break; case 'C': (void) strncpy(config.ipv6, optarg, sizeof(config.ipv6) - 1); config.ipv6[sizeof(config.ipv6) - 1] = '\0'; break; case 'p': config.port = atoi(optarg); if (config.port > MAX_PORTS || !config.port) { (void) fprintf(stderr, "Invalid port number (-p %s)\n", optarg); exit(1); } break; case 'x': if (strlen(optarg) > sizeof(config.proxyhost) - 1 ) { (void) fprintf(stderr, "Proxy host name too long\n"); exit(1); } (void) strncpy(config.proxyhost, optarg, sizeof(config.proxyhost) - 1); config.proxyhost[sizeof(config.proxyhost) - 1] = '\0'; break; case 'X': config.proxyport = atoi(optarg); if (config.proxyport > MAX_PORTS || !config.proxyport) { (void) fprintf(stderr, "Invalid port number (-X %s)\n", optarg); exit(1); } break; case 'l': config.childs = atoi(optarg); if (!config.childs || config.childs > MAX_CHILDS) { (void) fprintf(stderr, "Invalid limit of child processes (-l %s)\n", optarg); exit(1); } break; case 'u': if (!(config.uid = atoi(optarg))) { struct passwd *pwd; if ((pwd = getpwnam(optarg))) config.uid = (unsigned long) pwd->pw_uid; else { (void) fprintf(stderr, "UID %s not found\n", optarg); exit(1); } } break; case 'g': if (!(config.gid = atoi(optarg))) { struct group *grp; if ((grp = getgrnam(optarg))) config.gid = (unsigned long) grp->gr_gid; else { (void) fprintf(stderr, "GID %s not found\n", optarg); exit(1); } } break; case 'r': if (strlen(optarg) > sizeof(config.chroot) - 1 ) { (void) fprintf(stderr, "chroot directory too long\n"); exit(1); } (void) strncpy(config.chroot, optarg, sizeof(config.chroot) - 1); config.chroot[sizeof(config.chroot) - 1] = '\0'; break; case 'D': if (strlen(optarg) > sizeof(config.dbdir) - 1 ) { (void) fprintf(stderr, "dbdir directory too long\n"); exit(1); } (void) strncpy(config.dbdir, optarg, sizeof(config.dbdir) - 1); config.dbdir[sizeof(config.dbdir) - 1] = '\0'; break; case 'F': nowarn = 1; case 'f': if (strlen(optarg) > sizeof(config.file) - 1 ) { (void) fprintf(stderr, "config file name too long\n"); exit(1); } (void) strncpy(config.file, optarg, sizeof(config.file) - 1); config.file[sizeof(config.file) - 1] = '\0'; if (*config.file && !nowarn && strcmp(config.file, "/dev/null") != 0) (void) fprintf(stdout, "Using config file (%s).\nPlease note that due to design, config file overwrites command line options.\nUse -F instead of -f to omit this warning message.\n", config.file); break; case 's': config.syslog = 0; break; case '4': config.use_ipv6 = 0; break; case 'a': (void) strncpy(config.accelhost, optarg, sizeof(config.accelhost) - 1); config.accelhost[sizeof(config.accelhost) - 1] = '\0'; break; case 'A': config.accelport = atoi(optarg); break; case 'h': usage(); /* NOTREACHED */ break; default: (void) fprintf(stderr, "Error, type `%s -h' for help on usage\n", prgname); exit(1); break; } } argc -= optind; argv += optind; if (*argv) { (void) fprintf(stderr, "Unknown argument left (%s)\nType `%s -h' for usage\n", *argv, prgname); exit(1); } setup_log_master(); info("started, initializing"); load_databases(); (void) resolve("localhost"); drop_privileges(); if (config.daemon) { FILE *fp; if (daemon(1, 0) != 0) fatal("daemon() failed"); (void) close(0); (void) close(1); (void) close(2); (void) chdir(config.dbdir); if ((fp = fopen("ffproxy.pid", "w")) == NULL) fatal("cannot create pid file ffproxy.pid in %s", config.dbdir); (void) fprintf(fp, "%ld", (long) getpid()); (void) fclose(fp); } (void) snprintf(loop_header, sizeof(loop_header), "X-Loop-%d-%d: true", getpid(), (int) time(NULL)); init_sighandlers(); open_socket(); /* NOTREACHED */ return 0; } static void usage(void) { (void) fprintf(stderr, "ffproxy %s -- (c) 2002-2005 Niklas Olmes \n", version); (void) fprintf(stderr, " GNU GPL. Website: http://faith.eu.org/programs.html\n"); (void) fprintf(stderr, "usage: ffproxy [-vhds4bB] [-c host|ip] [-C host|ip] [-p port]\n" " [-x host|ip -X port] [-l max] [-u uid|usr -g gid|grp] [-r dir]\n" " [-D dir] [-f file] [-a host|ip] [-A port]\n" " -v print version number -h usage (this screen)\n" " -d become daemon -s silent. don't log to syslog.\n" " -4 use IPv4 only. don't try contacting via IPv6.\n" " -b do *not* bind to IPv4\n" " -B do *not* bind to IPv6\n" " -c host|ip bind to IPv4 address (default is any)\n"); (void) fprintf(stderr, " -C host|ip bind to IPv6 address (default is any)\n" " -p port bind to port\n" " -x host|ip auxiliary forward proxy\n" " -X port auxiliary forward proxy port\n" " -l max maximum number of concurrent requests\n" " -u uid|user change uid\n" " -g gid|group change gid\n" " -r dir chroot to dir\n" " -D dir databases are in dir (default is %s)\n" " -f file use config file (default is %s; *overwrites*)\n" " -a host|ip auxiliary forward server to use\n" " -A port auxiliary forward server port (default is 80)\n", DATADIR, CFGFILE); exit(1); } static void drop_privileges(void) { extern struct cfg config; struct passwd *pwd; if (config.uid == 0 || config.gid == 0) { info("not changing UID/GID"); } else { if ((pwd = getpwuid(config.uid)) == NULL) fatal("getpwuid() failed (non-existent UID entry?)"); if (*config.chroot != '\0') { if (chdir(config.chroot) != 0) fatal("chdir() failed"); if (chroot(config.chroot) != 0) fatal("chroot() failed"); info("chroot()ed to %s\n", config.chroot); } if (setgid(config.gid) != 0) fatal("setgid() failed"); if (initgroups(pwd->pw_name, config.gid) != 0) fatal("initgroups() failed"); if (setuid(config.uid) != 0) fatal("setuid() failed"); } info("=> UID(%d), EUID(%d), GID(%d), EGID(%d)", getuid(), geteuid(), getgid(), getegid()); } ffproxy-1.6.orig/ffproxy.conf.5.s0000640000175000017500000001356210167006677015463 0ustar manumanu.\" $Id: ffproxy.conf.5.s,v 2.3 2005/01/05 15:54:39 niklas Exp niklas $ .\" Copyright (c) 2002-2005 Niklas Olmes .\" See COPYING for license (GNU GPL) .\" http://faith.eu.org .Dd Jan 5, 2005 .Dt ffproxy.conf 5 .Sh NAME .Nm ffproxy.conf .Nd filtering HTTP/HTTPS proxy server configuration file .Sh DESCRIPTION .Nm ffproxy is a filtering HTTP/HTTPS proxy server. It is able to filter by host, URL, and header. Custom header entries can be filtered and added. It can even drop its privileges and optionally .Xr chroot 2 to some directory. Logging to .Xr syslog 3 is supported, as is using another auxiliary proxy server. An HTTP accelerator feature (acting as a front-end to an HTTP server) is included. Contacting IPv6 servers as well as binding to IPv6 is supported and allows transparent IPv6 over IPv4 browsing (and vice versa). .Pp This manual describes how to use configuration files with the program and documents the options. .Sh USING CONFIGURATION FILES .Ss Default ffproxy.conf If the command line parameters -f or -F are not used, the proxy tries to open .Pa _CFGFILE_ . If this file does not exist, the program continues execution. .Ss User Configuration File Use command line parameter -f to load a non-default configuration file. You will notice the warning at the program's startup. This is due to the programs implementation that allows to reload all configuration files. To disable the warning, use -F instead. .Ss Deactivating To use command line options only, use -f "". .Ss Reloading Configuration To let the proxy reload its configuration files, that is, besides the configuration file specified, the contents of db/ and html/, send the signal HUP to the program's master process. If ffproxy runs daemonized, the PID can be found in .Pa db_files_path/ffproxy.conf . Otherwise look into your system's syslog log files or process table. .Pp Options that can be successfully altered at runtime are .Bd -literal -offset indent child_processes use_ipv6 use_syslog log_all_requests forward_proxy forward_proxy_port forward_proxy_ipv6 accel_host accel_port accel_user_host use_keep_alive unrestricted_connect timeout_connect backlog_size .Ed .Pp Set `accel_port 0' or `forward_proxy_port 0' to explicitly disable acceleration or auxiliary proxy. Commenting out options is not sufficient, since configuration options may only overwritten. .Pp Changes to other options not mentioned above get silently ignored. .Sh CONFIGURATION OPTIONS .Bd -literal # # lines starting with '#' are comments # # run as daemon? # (default: no) #daemonize yes #daemonize no # number of child processes, # that is, the maximum number of concurrent requests # (default: 10) #child_processes 10 # ffproxy binds to any IPv4 address # and any IPv6 address by default # # bind to IPv4? (default: yes) #bind_ipv4 no #bind_ipv4 yes # bind to IPv6? (default: yes) #bind_ipv6 no #bind_ipv6 yes # # Hostname or IP to bind to # (default is any IP) # #bind_ipv4_host 192.168.10.1 #bind_ipv4_host martyr.burden.eu.org #bind_ipv6_host ::1 #bind_ipv6_host oz.burden.eu.org # listen on port # (default: 8080) #port 1111 #port 8080 # use IPv6 when contacting servers? # (default: yes) #use_ipv6 no #use_ipv6 yes # use syslog? # (default: yes) #use_syslog no #use_syslog yes # log all requests? # (default: no) # to use, set also use_syslog to yes #log_all_requests yes #log_all_requests no # change UID and GID # # to use, both uid and gid must be set # (disabled by default) #uid proxy #gid proxy #uid 37 #gid 38 # change root to (only in connection with uid and gid change) # /etc/resolv.conf might need to be copied # to chroot_dir/etc/resolv.conf # (disabled by default) #chroot_dir _BASE_ # forward to proxy (auxiliary proxy) # (set `forward_proxy_port 0' to explicitly disable feature # (i.e, when reloading configuration file via SIGHUP)) # (disabled by default) #forward_proxy blackness.burden.eu.org #forward_proxy 192.168.10.5 #forward_proxy ::1 #forward_proxy_port 8082 #forward_proxy_port 0 # try IPv6 for auxiliary proxy? # use_ipv6 must be set to yes, too # (default: yes) #forward_proxy_ipv6 no #forward_proxy_ipv6 yes # path to db/ and html/ directories # (default: _BASE_) # (Note: if ffproxy runs chrooted, # give a path name relative to new root, or, # if db_files_path is the same as root, use db_files_path ./ # You have to start ffproxy in the new root directory, # otherwise it won't find the database files. # Please keep in mind that ffproxy's config file has to # be within chroot directory, otherwise it will not find # its config file on reload) #db_files_path ./ #db_files_path _BASE_ # http accelerator # (disabled by default) # # if you want to use ffproxy as http accelerator (that is, connecting # to just one http server and beeing used as front-end to that, e.g. # in DMZ) uncomments options below (port is optional, defaults to 80) # (set `accel_port 0' to explicitly disable feature # (i.e, when reloading configuration file via SIGHUP)) #accel_host 10.254.1.2 #accel_host revelation.martyr.eu.org #accel_port 80 #accel_port 0 # # Omit Host: accel_host:accel_port in Header # to provide own Host: header via db/filter.header.add? # (default: yes) #accel_user_host no #accel_user_host yes # keep alive on client to proxy connections # (enabled by default) #use_keep_alive no #use_keep_alive yes # allow CONNECT request to other than port 443 (HTTPS) # (CONNECT enables HTTPS proxying) # (disabled by default for security) #unrestricted_connect yes #unrestricted_connect no # timeout for CONNECT requests in seconds # (default: 5) #timeout_connect 20 #timeout_connect 5 # backlog size for accept() # (default: 4) #backlog_size 16 #backlog_size 4 .Ed .Sh VERSION This manual documents ffproxy 1.6 (2005-01-05). .Sh FILES .Pa _CFGFILE_ default configuration file .Pp .Pa sample.config sample configuration file .Sh SEE ALSO .Xr ffproxy 8 , .Xr ffproxy.quick 7 , .Xr regex 7 , .Xr re_format 7 , .Xr syslogd 8 , .Xr chroot 2 , .Xr kill 1 ffproxy-1.6.orig/poll.c0000640000175000017500000000214410061271660013604 0ustar manumanu/* * ffproxy (c) 2002, 2003 Niklas Olmes * http://faith.eu.org * * $Id: poll.c,v 2.0 2004/06/08 06:39:51 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include #include "poll.h" int my_poll(int s, int in) { struct pollfd p; p.fd = s; p.events = (in == IN) ? POLLIN : POLLOUT; switch (poll(&p, 1, 1000 * 20)) { case 0: return 0; break; case -1: return -1; break; default: return 1; break; } } ffproxy-1.6.orig/poll.h0000640000175000017500000000010007517766752013626 0ustar manumanu#define IN 1 #define OUT 0 int my_poll(int, int); ffproxy-1.6.orig/ffproxy.quick.7.s0000640000175000017500000001113010167001743015626 0ustar manumanu.\" $Id: ffproxy.quick.7.s,v 2.2 2005/01/05 15:12:34 niklas Exp niklas $ .\" Copyright (c) 2002-2005 Niklas Olmes .\" See COPYING for license (GNU GPL) .\" http://faith.eu.org .Dd Jan 5, 2005 .Dt ffproxy.quick 7 .Sh NAME .Nm ffproxy.quick .Nd filtering HTTP/HTTPS proxy server quick introduction .Sh DESCRIPTION .Nm ffproxy is a filtering HTTP/HTTPS proxy server. It is able to filter by host, URL, and header. Custom header entries can be filtered and added. It can even drop its privileges and optionally .Xr chroot 2 to some directory. Logging to .Xr syslog 3 is supported, as is using another auxiliary proxy server. An HTTP accelerator feature (acting as a front-end to an HTTP server) is included. Contacting IPv6 servers as well as binding to IPv6 is supported and allows transparent IPv6 over IPv4 browsing (and vice versa). .Pp This manual describes how to set up a basic HTTP proxy installation. It is assumed that you already have compiled the program or installed it via port or package. .Sh COPYING FILES The program comes with default configuration files that contain both examples and suggested entries. You can simply copy them to a directory of your choice. This directory will become the program's working directory. .Bd -literal -offset indent mkdir /var/ffproxy tar cf - db/ html/ | ( cd /var/ffproxy ; tar xf - ) cp sample.config /var/ffproxy/ffproxy.conf .Ed .Pp Above example would install all needed files to .Pa /var/ffproxy , which is ffproxy's default working directory. .Sh SECURING The proxy now has its own working directory. By default, ffproxy does not change UID/GID after start. For security reasons we want to enable it. You have two choices know: Either use existing UID/GID or add custom UID/GID for ffproxy. See .Xr adduser 8 or .Xr useradd 8 , depending on your system, on how to create new IDs. .Pp Edit .Pa ffproxy.conf and change the lines containing uid and gid .Bd -literal -offset indent # change UID and GID # # to use, both uid and gid must be set # (disabled by default) #uid proxy #gid proxy uid _ffproxy gid _ffproxy .Ed .Pp In addition to changing UID and GID, ffproxy should be executed change-rooted to its working directory. So we change chroot_dir and db_files_path in the configuration file .Bd -literal -offset indent # change root to (only in connection with uid and gid change) # (disabled by default) chroot_dir /var/ffproxy # path to db/ and html/ directories # (default: /var/ffproxy) db_files_path . .Ed .Pp db_files_path must be changed, too, since that is relative to new root. Finally, we copy /etc/resolv.conf to ffproxy's home to enable DNS in chroot and chown /var/ffproxy so the proxy's master process can write its PID file .Bd -literal -offset indent mkdir /var/ffproxy/etc cp /etc/resolv.conf /var/ffproxy/etc/ chmod 750 /var/ffproxy chown _ffproxy._ffproxy /var/ffproxy .Ed .Sh ACCESS TO THE PROXY By default, nobody is allowed to connect to ffproxy. Let's say, we want to provide LAN users a filtering proxy to shut down malicous content coming from the Internet. So the proxy has to be listening on the local network interface only. We change bind_ipv4 and bind_ipv6 appropiately in .Pa ffproxy.conf .Bd -literal -offset indent bind_ipv4 martyr.burden.eu.org bind_ipv6 martyr.burden.eu.org .Ed .Pp Additionally, we have to change .Pa db/access.ip . By, for example, .Bd -literal -offset indent ^192\\.168\\.10\\. .Ed .Pp we allow 192.168.10.0/24 to use our proxy. .Sh STARTING THE PROXY Last step is starting ffproxy. Keep in mind that we run the program change-rooted to /var/ffproxy, so files are relative to new root. .Bd -literal -offset indent cd /var/ffproxy ; /usr/local/bin/ffproxy -f ffproxy.conf .Ed .Pp starts ffproxy. Now test if it works correctly. If not, change ffproxy.conf and/or read .Xr ffproxy 8 .Xr ffproxy.conf 5 .Pp ffproxy is not running as daemon right know. If everything seems to work, simply shut down the proxy by pressing CTRL-C, set `daemonize yes' in the configuration file and start ffproxy again. .Sh TRANSPARENT OPERATION The proxy allows transparent operation, that is, HTTP traffic is redirect to the proxy which simulates a HTTP server so that the users don't have to specify a proxy server. Consider forced usage of a proxy server as well. To do that, you will have to configure your NAT accordingly. On OpenBSD you'll want a line like .Bd -literal -offset indent rdr on rl0 proto tcp from any to any port 80 -> 127.0.0.1 port 8080 .Ed .Pp in .Pa /etc/pf.conf . See your NAT's documentation for details on how to do this. .Sh VERSION This manual documents ffproxy 1.6 (2005-01-05). .Sh SEE ALSO .Xr ffproxy 8 , .Xr ffproxy.conf 5 , .Xr pf.conf 5 ffproxy-1.6.orig/alloc.c0000640000175000017500000000221410165212411013720 0ustar manumanu/* * ffproxy (c) 2002, 2003 Niklas Olmes * http://faith.eu.org * * $Id: alloc.c,v 2.1 2004/12/31 08:59:15 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include #include "configure.h" #ifdef HAVE_STDLIB_H # include #endif #include #include "print.h" #include "alloc.h" void * my_alloc(size_t size) { void *p; if ((p = malloc(size)) == NULL) fatal("malloc() failed"); (void) memset(p, 0, size); return p; } ffproxy-1.6.orig/alloc.h0000640000175000017500000000004707512334167013746 0ustar manumanuvoid *my_alloc(size_t size); ffproxy-1.6.orig/INSTALL0000640000175000017500000000233610165204301013517 0ustar manumanuInstallation ============ (1) `$ ./configure', see `$ ./configure --help' for possible settings (2) `$ make' to compile ffproxy after succesful compilation: (3.a) `# make install' for a full install of ffproxy in ${PREFIX}/{bin,etc,man,share/ffproxy} (overwrites existing configuration files!) (3.b) `# make install_bin' to install ffproxy binary only (3.c) more install targets: install_man install manual pages install_conf install sample.conf to ${PREFIX}/etc/sample.conf install_sample install sample.conf to ${PREFIX}/share/ffproxy/ install_data install db/ and html/ to ${PREFIX}/share/ffproxy/ (4) consult manual pages for configuration and start ffproxy Documentation ============= * ffproxy.quick(7) - quick introduction to setting up ffproxy * ffproxy(8) - command line options; db/ and html/ description * ffproxy.conf(5) - description of configuration files Uninstalling ============ following uninstall-targets exist: uninstall safe uninstall, remove binary, sample.conf and manpages only uninstall_man manpages uninstall_conf ${PREFIX}/etc/ffproxy.conf uninstall_sample sample.conf uninstall_data db/, html/ uninstall_all all of above (removes your config!) ffproxy-1.6.orig/ChangeLog0000640000175000017500000001367310167002020014242 0ustar manumanuVersion 1.6 ============ * added CONNECT request method to support HTTPS proxying (see section HTTPS OPERATION in ffproxy(8)) * new configuration options unrestriced_connect and timeout_connect * updated documentation accordingly * now using autoconf configure scripts with new enhanced Makefile targets, see file INSTALL * fixed compiler warnings for some OSes * removed (unportable) `char - '0'' hacks to parse some numbers in http.c and introduced numbers.c * now using freshmeat.net's project description in README and manpages * updated file BUGS Version 1.5.1 ============= * allow transparent operation (see section TRANSPARENT OPERATION in ffproxy(8) or ffproxy.quick(7)) * allow client to proxy keep alive connections * new configuration option use_keep_alive * updated documentation accordingly Version 1.5 =========== * IPv6 bind() support * changed db/* You'll perhaps need to update files, also please take a look at ffproxy(8) * allow comments and empty lines in db/* * removed caching complety from code * changed debug() to macro DEBUG() * code cleanups * check on configuration errors * more documentation in manual pages ffproxy(8), ffproxy.conf(5), ffproxy.quick(7) * added HTTP Accelerator feature * more configuration file options, more command line options (for IPv6 and HTTP Accelerator) * allow non-numerical arguments to uid, gid, -u, and -g * more minor changes * allow ffproxy to be compiled under Solaris8 Version 1.4.1 ============= * HTTP fix: savannah.gnu.org (and possibly other hosts) does not understand a Host: header with port number correctly. Now :80 is omitted, port number is only added if needed. * implemented SYSCONFDIR and DATADIR, default location for ffproxy's working directory (db/ and html/ path) is now /var/ffproxy default location of ffproxy.conf is now /etc/ffproxy.conf Version 1.4 =========== * added IPv6 Support * new config options - use_ipv6 yes|no - forward_proxy_ipv6 yes|no * new command line option -4 (disable IPv6) * PLEASE NOTE: ffproxy is not yet able to *bind* to IPv6, this will be implemented soon after this release * removed config.proxyip and added config.proxyhost: now proxyhost is resolved on every access (was resolved only once on startup before) * changed copyright notice in every .c File (added new E-Mail Address and renewed (c)) * changed README and manpage (minor changes) * moved configuration settings in Makefile up to the top of the file Version 1.3p2 ============= * not using http://host/path style GET requests anymore when not contacting an auxiliary proxy * fixed command line option -v behaviour: ffproxy now terminates after displaying the version number * fixed wrong db_path comment in sample.config: path must be relative to new root but in no case absolute because at first time read of the config files ffproxy hasn't dropped its priviliges -- because *after* reading them it knows that it should do Version 1.3p1 ============= * off by one error (reported by Oliver Kurth) [ r->header[i] = (char *) my_alloc(len); in request.c ] fixed * (hopefully) fixed compiling issues under linux (take a look at Makefile) * manpage was installed in wrong location, fixed -------------------------------------------------- Forgot sample.config in tar.gz for version 1.3, fixed the tar.gz after report from Oliver Kurth and uploaded the fixed one instead of the old under the same file name on Fri, 2 Aug 2002 -------------------------------------------------- Version 1.3 =========== * complete rewrite * layout of db/ has changed. delimited string matching was abolished. * undocumented caching support Version 1.2 =========== * changed loop protection (now it is possible to connect through an arbitrary number of ffproxy proxy servers, previously LOOP_HEADER had to be edited, which is now abolished. The X-loop header is generated by the pid of the master process and seconds since the epoch at invocation time and therefore can be regarded as unique.) * added configuration file support. See file sample.config. System wide default configuration file is /etc/ffproxy.conf, but the user may use the new command line option -f to specify the configuration file to use. Note that command line options overwrite defaults from /etc/ffproxy.conf, but don't overwrite user file configurations. In other words: When using -f, other command line options are useless. * added a few new command line options. See manpage or ffproxy -h for details. * added HTTP HEAD method and changed code to recognize different protocol versions * added logging option to log every request. By default, only filtered and incorrect requests get logged, as before. * regular expressions are now pre-compiled to tune performance * fixed some nasty bugs (i.e. error while parsing optional host part in URLs. Request was generally blocked, or damaged headers under some circumstances) * Updated manpage and README. Version 1.1 =========== * added extended regular expression support * raised MAX_MSG_SIZE in log.c (longer URLs got truncated in log output) * drop_privileges() allocated memory twice (forgot to remove that, sorry) (Note that this had no effect at all) * added command line option -D to specify directory which contains db/ and html/ * added a manpage -- fproxy(1) * improved logging * modified the html/* error files * updated README file * URL host is preferred from host in Host header (previously host header could overwrite hostname found in URL, so using another proxy server through this proxy server) * fixed compiling issues: o changed Makefile (users got confused with MY_CFLAGS, removed that completely) o changed resolve() to return unsigned long since in_addr_t is not supported on all systems Version 1.0 =========== Initial release ffproxy-1.6.orig/number.c0000640000175000017500000000207410165217067014136 0ustar manumanu/* * ffproxy (c) 2002-2004 Niklas Olmes * http://faith.eu.org * * $Id: number.c,v 1.1 2004/12/31 09:36:09 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include "number.h" static const char *my_numbers = "0123456789"; #define LEN 10 int my_ctoi(const char c) { int value = 0; while(value < LEN && my_numbers[value] != c) value++; if(value == LEN) value = 0; return value; } ffproxy-1.6.orig/number.h0000640000175000017500000000003110165132751014126 0ustar manumanuint my_ctoi(const char); ffproxy-1.6.orig/signals.c0000640000175000017500000000350610165212412014274 0ustar manumanu/* * ffproxy (c) 2002, 2003 Niklas Olmes * http://faith.eu.org * * $Id: signals.c,v 2.1 2004/12/31 08:59:15 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include "configure.h" #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #include #include "cfg.h" #include "print.h" #include "db.h" #include "signals.h" #include "configure.h" static RETSIGTYPE sigchld(int); static RETSIGTYPE sighup(int); static RETSIGTYPE sigterm(int); static RETSIGTYPE sigint(int); extern struct cfg config; static RETSIGTYPE sigchld(int dummy) { int status; pid_t pid; (void) dummy; while ((pid = waitpid(-1, &status, WNOHANG)) > 0) config.ccount--; } static RETSIGTYPE sighup(int dummy) { (void) dummy; info("SIGHUP received, reloading databases"); reload_databases(); } static RETSIGTYPE sigterm(int dummy) { (void) dummy; fatal_n("SIGTERM received"); } static RETSIGTYPE sigint(int dummy) { (void) dummy; fatal_n("SIGINT received"); } void init_sighandlers(void) { signal(SIGCHLD, sigchld); signal(SIGHUP, sighup); signal(SIGTERM, sigterm); signal(SIGINT, sigint); } ffproxy-1.6.orig/signals.h0000640000175000017500000000005007512334167014306 0ustar manumanuvoid init_sighandlers(void); ffproxy-1.6.orig/COPYING0000640000175000017500000004307607517770072013553 0ustar manumanu GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ffproxy-1.6.orig/sample.config.s0000640000175000017500000000634410165160024015405 0ustar manumanu# # sample configuration file for ffproxy(8) # (version 1.6) # # lines starting with '#' are comments # run as daemon? # (default: no) #daemonize yes #daemonize no # number of child processes, # that is, the maximum number of concurrent requests # (default: 10) #child_processes 10 # ffproxy binds to any IPv4 address # and any IPv6 address by default # # bind to IPv4? (default: yes) #bind_ipv4 no #bind_ipv4 yes # bind to IPv6? (default: yes) #bind_ipv6 no #bind_ipv6 yes # # Hostname or IP to bind to # (default is any IP) # #bind_ipv4_host 192.168.10.1 #bind_ipv4_host martyr.burden.eu.org #bind_ipv6_host ::1 #bind_ipv6_host oz.burden.eu.org # listen on port # (default: 8080) #port 1111 #port 8080 # use IPv6 when contacting servers? # (default: yes) #use_ipv6 no #use_ipv6 yes # use syslog? # (default: yes) #use_syslog no #use_syslog yes # log all requests? # (default: no) # to use, set also use_syslog to yes #log_all_requests yes #log_all_requests no # change UID and GID # # to use, both uid and gid must be set # (disabled by default) #uid proxy #gid proxy #uid 37 #gid 38 # change root to (only in connection with uid and gid change) # /etc/resolv.conf might need to be copied # to chroot_dir/etc/resolv.conf # (disabled by default) #chroot_dir _BASE_ # forward to proxy (auxiliary proxy) # (set `forward_proxy_port 0' to explicitly disable feature # (i.e, when reloading configuration file via SIGHUP)) # (disabled by default) #forward_proxy blackness.burden.eu.org #forward_proxy 192.168.10.5 #forward_proxy ::1 #forward_proxy_port 8082 #forward_proxy_port 0 # try IPv6 for auxiliary proxy? # use_ipv6 must be set to yes, too # (default: yes) #forward_proxy_ipv6 no #forward_proxy_ipv6 yes # path to db/ and html/ directories # (default: _BASE_) # (Note: if ffproxy runs chrooted, # give a path name relative to new root, or, # if db_files_path is the same as root, use db_files_path ./ # You have to start ffproxy in the new root directory, # otherwise it won't find the database files. # Please keep in mind that ffproxy's config file has to # be within chroot directory, otherwise it will not find # its config file on reload) #db_files_path ./ #db_files_path _BASE_ # http accelerator # (disabled by default) # # if you want to use ffproxy as http accelerator (that is, connecting # to just one http server and beeing used as front-end to that, e.g. # in DMZ) uncomments options below (port is optional, defaults to 80) # (set `accel_port 0' to explicitly disable feature # (i.e, when reloading configuration file via SIGHUP)) #accel_host 10.254.1.2 #accel_host revelation.martyr.eu.org #accel_port 80 #accel_port 0 # # Omit Host: accel_host:accel_port in Header # to provide own Host: header via db/filter.header.add? # (default: yes) #accel_user_host no #accel_user_host yes # keep alive on client to proxy connections # (enabled by default) #use_keep_alive no #use_keep_alive yes # allow CONNECT request to other than port 443 (HTTPS) # (CONNECT enables HTTPS proxying) # (disabled by default for security) #unrestricted_connect yes #unrestricted_connect no # timeout for CONNECT requests in seconds # (default: 5) #timeout_connect 20 #timeout_connect 5 # backlog size for accept() # (default: 4) #backlog_size 16 #backlog_size 4 # end of file ffproxy-1.6.orig/print.c0000640000175000017500000000452110165212412013766 0ustar manumanu/* * ffproxy (c) 2002, 2003 Niklas Olmes * http://faith.eu.org * * $Id: print.c,v 2.1 2004/12/31 08:59:15 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include "configure.h" #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_SYSLOG_H # include #endif #include "cfg.h" #include "print.h" extern struct cfg config; void setup_log_master(void) { if (config.syslog) openlog("FFPROXY(master)", LOG_PID, 0); } void setup_log_slave(void) { if (config.syslog) openlog("ffproxy(slave)", LOG_PID, 0); } void fatal(const char *fmt,...) { va_list ap; char buf[2048]; va_start(ap, fmt); (void) vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); if (config.syslog) syslog(LOG_ERR, "%s, terminating\n", buf); perror(buf); exit(1); } void fatal_n(const char *fmt,...) { va_list ap; char buf[2048]; va_start(ap, fmt); (void) vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); if (config.syslog) syslog(LOG_NOTICE, "%s, terminating\n", buf); (void) fprintf(stderr, "%s, terminating\n", buf); exit(1); } void warn(const char *fmt,...) { va_list ap; char buf[2048]; va_start(ap, fmt); (void) vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); if (config.syslog) syslog(LOG_WARNING, "%s, continuing\n", buf); (void) fprintf(stderr, "%s, continuing\n", buf); } void info(const char *fmt,...) { va_list ap; char buf[2048]; va_start(ap, fmt); (void) vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); if (config.syslog) syslog(LOG_INFO, "%s\n", buf); #ifdef USE_DEBUG (void) fprintf(stdout, "%s\n", buf); #endif } ffproxy-1.6.orig/print.h0000640000175000017500000000054707714727524014024 0ustar manumanu#ifdef USE_DEBUG #define DEBUG(args) (void) printf args , (void) printf("\n");; #else #define DEBUG(args) ; #endif void setup_log_master(void); void setup_log_slave(void); void fatal(const char *,...); void fatal_n(const char *,...); void warn(const char *,...); void info(const char *,...); ffproxy-1.6.orig/socket.c0000640000175000017500000001273410165212412014127 0ustar manumanu/* * ffproxy (c) 2002, 2003 Niklas Olmes * http://faith.eu.org * * $Id: socket.c,v 2.1 2004/12/31 08:59:15 niklas Exp $ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 675 * Mass Ave, Cambridge, MA 02139, USA. */ #include "configure.h" #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #include #ifdef HAVE_STDLIB_H # include #endif #include #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_NETDB_H # include #endif #include #include "req.h" #include "cfg.h" #include "print.h" #include "request.h" #include "dns.h" #include "access.h" #include "socket.h" #define DFLT_PORT 8080 #ifndef INFTIM #define INFTIM -1 #endif void open_socket(void) { extern struct cfg config; struct sockaddr claddr; struct addrinfo hints[2], *res; struct clinfo *clinfo; struct pollfd s[2]; socklen_t claddr_len; pid_t pid; void *foo; char strport[6]; char *ip_add; int st, cl, i; int num_fd; int isipv4; if (config.port == 0) config.port = DFLT_PORT; (void) snprintf(strport, sizeof(strport), "%d", config.port); num_fd = 0; if (config.bind_ipv4) num_fd++; if (config.bind_ipv6) num_fd++; i = 0; (void) memset(s, 0, sizeof(s)); s[0].fd = s[1].fd = 0; while (i < num_fd) { (void) memset(&hints[i], 0, sizeof(struct addrinfo)); hints[i].ai_family = (i == 0 && config.bind_ipv4) ? PF_INET : PF_INET6; hints[i].ai_socktype = SOCK_STREAM; hints[i].ai_flags = AI_PASSIVE; if (i == 0 && config.bind_ipv4) { if (*config.ipv4 == '\0') ip_add = NULL; else ip_add = config.ipv4; } else { if (*config.ipv6 == '\0') ip_add = NULL; else ip_add = config.ipv6; } if (getaddrinfo(ip_add, strport, &hints[i], &res)) fatal("getaddrinfo() failed for (%s) %s", ip_add, (i == 0 && config.bind_ipv4) ? "IPv4" : "IPv6"); if ((s[i].fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) < 0) { if (i == 1 || (config.ipv6 && !config.ipv4)) fatal("socket() failed for IPv6, perhaps your system does not support IPv6.\nTry -B or `bind_ipv6 no' to disable IPv6 binding.\nError message"); else fatal("socket() failed for IPv4"); } if (setsockopt(s[i].fd, SOL_SOCKET, SO_REUSEADDR, &foo, sizeof(foo)) != 0) { (void) close(s[i].fd); fatal("setsockopt() failed for (%s) %s", ip_add, (i == 0 && config.bind_ipv4) ? "IPv4" : "IPv6"); } if (bind(s[i].fd, (struct sockaddr *) res->ai_addr, res->ai_addrlen) < 0) { (void) close(s[i].fd); #if defined(__linux__) if (i == 1) fatal("could not bind to IPv6, possibly because of\nLinux's ``feature'' to bind to IPv4 also.\nTry -b or binding to specific IPv6 address via -C\nif you're using IPv6 with Linux 2.4\nError message"); #endif /* __linux__ */ fatal("bind() failed for (%s) %s", ip_add, (i == 0 && config.bind_ipv4) ? "IPv4" : "IPv6"); } if (listen(s[i].fd, config.backlog) != 0) { (void) close(s[i].fd); fatal("listen() failed for (%s) %s",ip_add, (i == 0 && config.bind_ipv4) ? "IPv4" : "IPv6"); } freeaddrinfo(res); s[i].events = POLLIN; i++; } if (config.bind_ipv4) info("waiting for requests on %s port %d (IPv4)", *config.ipv4 ? config.ipv4 : "(any)", config.port); if (config.bind_ipv6) info("waiting for requests on %s port %d (IPv6)", *config.ipv6 ? config.ipv6 : "(any)", config.port); claddr_len = sizeof(claddr); config.ccount = 0; cl = 0; isipv4 = config.bind_ipv4; for (;;) { if (config.ccount >= config.childs) { (void) usleep(50000); continue; } if (num_fd == 2) { i = poll(s, 2, INFTIM); if (i < 1) { continue; } else { if (s[0].revents == POLLIN) { st = s[0].fd; isipv4 = 1; } else { st = s[1].fd; isipv4 = 0; } } } else st = s[0].fd; if ((cl = accept(st, (struct sockaddr *) & claddr, &claddr_len)) == -1) { DEBUG(("open_socket() => accept() failed")); continue; } DEBUG(("open_socket() => connection, checking access")); clinfo = identify(&claddr, (socklen_t) isipv4 ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6)); if (check_access(clinfo) != 0) { DEBUG(("open_socket() => no access")); if (config.logrequests) info("connection attempt from (%s) [%s], ACCESS DENIED", clinfo->name, clinfo->ip); free(clinfo); (void) close(cl); continue; } if (config.logrequests) info("connection attempt from (%s) [%s], access granted", clinfo->name, clinfo->ip); if ((pid = fork()) == -1) { DEBUG(("open_socket() => fork() failed")); free(clinfo); (void) close(cl); continue; } else if (pid == 0) { (void) close(s[0].fd); if (num_fd == 2) (void) close(s[1].fd); setup_log_slave(); handle_request(cl, clinfo); free(clinfo); (void) close(cl); exit(0); } else { free(clinfo); config.ccount++; (void) close(cl); } } /* NOTREACHED */ } ffproxy-1.6.orig/socket.h0000640000175000017500000000004307517766752014156 0ustar manumanuvoid open_socket(void);