--- proxycheck-0.45a/event.3.j 2003-02-01 23:53:40.000000000 +0000 +++ proxycheck-0.45a/event.3 2003-11-29 09:54:41.000000000 +0000 @@ -27,7 +27,7 @@ passed back to the callback routine when the routine is executed. .PP Module works with relatively high resolution of time: all timeouts -expressed in millisecounds. A \fImstimeout\fR argument for all routines +expressed in milliseconds. A \fImstimeout\fR argument for all routines may be set to 0 to mean \fBnow\fR, or to a negative value to mean no timeout at all. .PP @@ -46,25 +46,25 @@ .fi .PP where \fIevent\fR is the type of event occured (see below), \fIfd\fR -is an assotiated filedescriptor if any, \fIctx\fR is an application-supplied +is an associated file descriptor if any, \fIctx\fR is an application-supplied context passed by module unchanged, and \fIec\fR is internal event context for thread-safe version. .SS "Event Types" The following is a list of event types defined by this module. .IP \fBEV_READ\fR -wait for read can be pefrormed on a given filedescriptor. Note that in case -of end\-of\-file condition on the filedescriptor, this event will be +wait for read can be performed on a given file descriptor. Note that in case +of end\-of\-file condition on the file descriptor, this event will be delivered but \fBread\fR(2) call will typically return 0. .IP \fBEV_WRITE\fR -write can be performed on a given filedescriptor. +write can be performed on a given file descriptor. .IP \fBEV_RDWR\fR a shorthand for EV_READ|EV_WRITE. .IP \fBEV_EXCPT\fR -some exceptional situation occured with a filedescriptor. +some exceptional situation occured with a file descriptor. .IP \fBEV_ERRNO\fR error condition. Global variable \fBerrno\fR will be set appropriately. .IP \fBEV_TIMER\fR -timer event, typically not assotiated with any filedescriptor. +timer event, typically not associated with any file descriptor. .SS Routines @@ -83,7 +83,7 @@ .fi .RS frees resources consumed by a module for internal structures. This -routine is optional but provided for convience. +routine is optional but provided for convenience. .RE .nf @@ -97,7 +97,7 @@ time_t value or as pointer to struct timeval value. This internal "cached" value updated every time \fBev_wait\fR() or \fBev_updtime\fR() gets called. Usually, when \fBev_updtime\fR() is not called, the value -corresponds to time when current event was occured. +corresponds to the time when the current event occured. .RE .nf @@ -116,9 +116,9 @@ int \fBevr_hasevents\fR(const \fIec\fR) .fi .RS -checke whenever there is any events configured. Returns 0 if no -filedescriptors was requested to be monitored and/or any timer event -was requested, and non-0 overwise. +checks whenever there are any events configured. Returns zero if no +file descriptors were requested to be monitored and/or any timer event +was requested, and non-zero otherwise. .RE .nf @@ -126,26 +126,26 @@ int \fBevr_wait\fR(\fIec\fR, \fImstimeout\fR) .fi .RS -Wait for any events, process them and returns. Routine will wait for +waits for any events, processes them and returns. Routine will wait for any requested I/O condition and/or any timer event requested, but not -longer than \fImstimeout\fR millisecounds. It when call any callbacks -and returns. If \fImstimeout\fR is zero, routine will only process all -pending events and will return immediately. If \fImstimeout\fR is -negative, routine will wait for any event until it arrives, possible -forewer. +longer than \fImstimeout\fR milliseconds. It then calls any callbacks +and returns. If \fImstimeout\fR is zero, routine will process all +pending events and will then return immediately. If \fImstimeout\fR is +negative, routine will wait for any event until it arrives, possibly +forever. -Please note that \fImstimeout\fR and all timers currently set interpreted -relative to time stored by this module internally. This stored value +Please note that \fImstimeout\fR and all timers currently set are interpreted +relative to time stored by this module internally. This stored value is updated every time \fBev_wait\fR() routine is called, \fIjust before\fR starting to deliver all pending events. In order to repeatedly handle any I/O events and timers, one may call -this routine again until no more events to monitor will be left (i.e. +this routine again until no more events to monitor are left (i.e. when this routine, or \fBev_hasevents\fR() returns true). Returns non-negative value on success, or a negative value (and sets errno variable) on error (the only error condition checked now is -failed select() call). In case of successeful completion, return +failed select() call). In case of successful completion, return value will be the same as of \fBev_hasevents\fR(). .RE @@ -154,22 +154,22 @@ int \fBevr_reqio\fR(\fIec\fR, \fIfd\fR, \fIevent\fR, \fIcbckr\fR, \fIctx\fR) .fi .RS -request that a filedescriptor \fIfd\fR should be monitored for any +request that a file descriptor \fIfd\fR should be monitored for any events specified in \fIevent\fR parameter. \fIevent\fR may be any combination of EV_READ (wait for read-ready condition, i.e. when \fIfd\fR will become readable), EV_WRITE (wait for write-ready condition) or EV_EXCPT (wait for any exceptional condition), logically ORed if necessary. -When one of requested types of I/O will be available, \fIcbck\fR -callback will be called by \fBev_wait\fR() with the \fIfd\fR, -actual event occured, and a given \fIctx\fR context. +When one of requested types of I/O is available, \fIcbck\fR +callback will be called by \fBev_wait\fR() with the \fIfd\fR of the +actual event that occured, and a given \fIctx\fR context. Note that actual event will be one of EV_READ, EV_WRITE, EV_EXCPT or EV_ERRNO, but not a combination. This routine overwrites any previously set application callback and context -assotiated with this filedescriptor, and replace monitoring events. If +assotiated with this file descriptor, and replaces monitoring events. If \fBcbck\fR is NULL, any monitoring of this \fIfd\fR will be cancelled instead (in this case, \fIevent\fR and \fIctx\fR arguments are ignored). @@ -184,7 +184,7 @@ evr_cbck_fn \fBevr_io_cbck\fR(const \fIec\fR, \fIfd\fR) .fi .RS -returns a callback assotiated with a given \fIfd\fR or NULL if none. +returns a callback associated with a given \fIfd\fR or NULL if none. .RE .nf @@ -192,7 +192,7 @@ void *\fBevr_io_ctx\fR(const \fIec\fR, \fIfd\fR) .fi .RS -returns a context assotiated with a given \fIfd\fR or NULL if none. +returns a context associated with a given \fIfd\fR or NULL if none. .RE .nf @@ -205,7 +205,7 @@ Routine returns 0 if callback was called, or a negative value indicating that \fIfd\fR is out of range or no callback was -assotiated with it. +associated with it. .RE .nf @@ -213,21 +213,21 @@ int \fBevr_settimer\fR(\fIec\fR, \fImstimeout\fR, \fIcbckr\fR, \fIctx\fR) .fi .RS -request a new timer to ring after \fImstimeout\fR millisecound, +request a new timer to ring after \fImstimeout\fR milliseconds, calling \fIcbck\fR callback with \fIevent\fR argument set to EV_TIMER. -There may be only one timer assotiated with any given (\fIcbck\fR,\fIctx\fR) -pair. If there was other timer assotiated with the same pair, old timer +There may be only one timer associated with any given (\fIcbck\fR,\fIctx\fR) +pair. If there was other timer associated with the same pair, the old timer will be replaced by a new one. If \fImstimeout\fR is negative, any timer that was set set for given (\fIcbck\fR,\fIctx\fR) will be removed instead. Zero \fImstimeout\fR means that this event will be triggered immediately on next \fBev_wait\fR() call. -When callback routine will be called, \fIfd\fR argument will always be -1 -(since time event isn't assotiated with any filedescriptor). Timer callback +When the callback routine is called, \fIfd\fR argument will always be -1 +(since time event isn't associated with any file descriptor). Timer callback will receive ONLY events of type EV_TIMER from this module. -When a timer will ring, the event will be cleared automatically -- so timer +When a timer rings, the event will be cleared automatically -- so timer events are once-only events. If repeated timer is needed, call \fBev_settimer\fR() from within a callback again. @@ -250,6 +250,6 @@ None known yet. Note that poll() mechanism is not tested heavily. .SH AUTHOR -This software was written by Michael Tokarev, , +This software was written by Michael Tokarev , with help of ideas from work by Wietse Venema. --- proxycheck-0.45a/event.c.j 2003-02-01 23:53:40.000000000 +0000 +++ proxycheck-0.45a/event.c 2003-11-29 09:57:09.000000000 +0000 @@ -237,13 +237,13 @@ return 0; } -/* return a callback assotiated with fd */ +/* return a callback associated with fd */ ev_cbck *efn1(io_cbck, const ev_ctx *ec, int fd) { checkfd(fd, (ev_cbck*)NULL); return ec->io[fd].cbck; } -/* return a context assotiated with fd */ +/* return a context associated with fd */ void *efn1(io_ctx, const ev_ctx *ec, int fd) { checkfd(fd, (void*)NULL); return ec->io[fd].ctx; @@ -324,13 +324,13 @@ return 0; } -/* return a callback assotiated with fd */ +/* return a callback associated with fd */ ev_cbck *efn1(iocbck, const ev_ctx *ec, int fd) { checkfd(fd, fd, NULL); return ec->io[fd].cbck; } -/* return a context assotiated with fd */ +/* return a context associated with fd */ void *efn1(ioctx, const ev_ctx *ec, int fd) { checkfd(fd, fd, NULL); return ec->io[fd].ctx; --- proxycheck-0.45a/proxycheck.1.j 2003-05-11 15:47:38.000000000 +0100 +++ proxycheck-0.45a/proxycheck.1 2003-11-29 10:22:33.000000000 +0000 @@ -12,25 +12,25 @@ .SH DESCRIPTION -\fBproxycheck\fR is a simple open proxy checking tool which is -capable to quickly discovery open proxy servers on many hosts. -It's primary goal is to detect an open proxy server in order -to prevent it's abuse by various "bad guys", mostly spammers. -Having a wide-open proxy service running on a publicaly accessible +\fBproxycheck\fR is a simple open proxy checking tool, which is +capable of quickly discovering open proxy servers on many hosts. +Its primary goal is to detect an open proxy server in order +to prevent its abuse by various "bad guys", mostly spammers. +Having a wide-open proxy service running on a publicly accessible network is a very bad idea nowadays, and \fBproxycheck\fR may be used to find such system in order to be able to either secure -a system, or to refuse servicing it until it will be secured +the system, or to refuse service to it until it is secured properly. In order to determine if a given host is running an open proxy service, \fBproxycheck\fR tries to connect to a given destination system via a host and perform some actions, trying to talk with the -destination system. If a talk is successeful, \fBproxycheck\fR +destination system. If a talk is successful, \fBproxycheck\fR assumes the proxy service is running and wide-open. \fBproxycheck\fR supports all commonly used proxy protocols, -namely, HTTP CONNECT method, SOCKS versions 4 and 5, and Wingate -"telnet"-style proxies. In future, support for more protocols +namely, HTTP CONNECT method, SOCKS versions 4 and 5, Wingate +"telnet"-style proxies, and FTP proxies. In future, support for more protocols may be added. .SH OPTIONS @@ -67,20 +67,20 @@ to the remote system. Proxy assumed to be open if \fIexpectstr\fR is found. .IP "\fBdsbl\fR (no parameters accepted)" -try to submit all found proxies to the DSBL.org\-like system, see +try to submit all found proxies to a DSBL.org\-like system; see http://dsbl.org/ for more details. All the parameters required (username, password, recipient address, cookie server, ...) are expected to be found in environment variables. Run \fBproxycheck\fR with \fB\-h\fR option to see a list of recognized variables and -their default values. By default, \fBproxycheck\fR will anonimously +their default values. By default, \fBproxycheck\fR will anonymously submit all found proxies to unconfirmed.dsbl.org (which isn't very -useful). For trusted DSBL user, at least DSBL_USER and DSBL_PASS +useful). For trusted DSBL user, at least the DSBL_USER and DSBL_PASS variables should be set properly. .RE .IP "\fB\-p\fR \fIproto_port_spec\fR" specifies protocol and ports to connect to. If not given, \fBproxycheck\fR -will try it's built-in default list. This option may be specified more +will try its built-in default list. This option may be specified more than once. See below for \fIproto_port_spec\fR. If \fIproto_port_spec\fR is specified for a single host to check, it applies to that host only, and no protocols/ports in default list will be checked for that host. @@ -95,7 +95,7 @@ and their level, execute \fBproxycheck\fR with \fB\-h\fR option. .IP "\fB\-t\fR \fItimeout\fR" -a timeout, in secounds, for every operation. Default value is 30 secounds. +a timeout, in seconds, for every operation. Default value is 30 secounds. The timer starts at the connection attempt to the proxy itself, after sending the "connect" command to the proxy and so on. @@ -157,13 +157,13 @@ .SH USAGE Simplest usage of \fBproxycheck\fR is to try to connect to e.g. -your own mailserver with \fBchat\fR check method. First, connect -to your mailserver on port 25 to see which line it outputs upon -connection (SMTP greething line), and use it with \fBchat\fR: +your own mail server with \fBchat\fR check method. First, connect +to your mail server on port 25 to see what it outputs upon +connection (SMTP greeting line), and use it with \fBchat\fR: .nf proxycheck -d yourmailserver.example.org:25 \\ - -c chat::\fIgreething\fR ip.add.re.ss... + -c chat::\fIgreeting\fR ip.add.re.ss... .fi \fBproxycheck\fR will write a single line for every proto:port @@ -189,18 +189,18 @@ .fi where \fI127.0.0.3\fR is \fIoutgoing\fR IP addres of a multihomed/cascaded proxy as reported by the destination system. This IP address is hint only, -there is no simple and reliable way currently exists for \fBproxycheck\fR +there is currently no simple and reliable way that exists for \fBproxycheck\fR to determine that information. \fBProxycheck\fR is able to parse a line sent by remote system in \fB\-c chat\fR mode \- in this mode, \fBproxycheck\fR -skips all printable characters after \fIexpstr\fR it found and searches for -opening `[', when tries to find closing ']' and interpret digits and dots -in between as an IP address which gets printed like above. If your -mailserver's initial reply contains remote system's IP, or if your -mailserver replies with remote system's IP address to HELO/EHLO command, +skips all printable characters after \fIexpstr\fR it found and searches for an +opening `[', then tries to find a closing ']' and interprets digits and dots +between them as an IP address, which gets printed as above. If your +mail server's initial reply contains the remote system's IP, or if your +mail server replies with the remote system's IP address to HELO/EHLO command, this feature may be useful (in the last case, HELO command should be specified in chat). -When \fB\-n\fR option is specified, for proto:ports which aren't running +When \fB\-n\fR option is specified, for proto:ports that aren't running open proxy service, and for which \fBproxycheck\fR is able to strongly determine this, a line in the following format will be written: .br @@ -208,10 +208,10 @@ 127.0.0.4 hc:80 closed .br .fi -Note however that in most cases there is no way to reliable determine +Note though that in most cases there is no way to reliably determine whenever a given service is \fInot\fR open: for example, an open proxy server may be overloaded and refusing connections. In most -cases, \fBproxycheck\fR assumes proxy is in unknown state, only a +cases, \fBproxycheck\fR assumes proxy is in an unknown state; only a few codes are recognized as real indication of "closed" state. When \fB\-x\fR option is specified, there will be additional proxy info @@ -224,7 +224,7 @@ .br .fi -One may see some detail of \fBproxycheck\fR's operations giving +One may see some detail of \fBproxycheck\fR's operations by giving a sufficient number of \fB\-v\fR options in the command line. Verbosity level of 5 (\fB\-vvvvv\fR) will show almost everything. All the debugging output will go to the standard error stream and thus will @@ -234,7 +234,7 @@ .SH "EXIT CODE" \fBproxycheck\fR will exit with code 100 if at least one open proxy server was found. In case of incorrect usage, it will exit -with code 1. If no open proxies where found, \fBproxycheck\fR +with code 1. If no open proxies were found, \fBproxycheck\fR will return 0. .SH LICENSE --- proxycheck-0.45a/proxycheck.c.j 2003-08-07 15:21:53.000000000 +0100 +++ proxycheck-0.45a/proxycheck.c 2003-11-29 14:16:46.000000000 +0000 @@ -31,7 +31,7 @@ struct in_addr addr; /* IP address of proxy */ pxyprotoport_t *pps; /* array of proto:ports to test */ pxyprotoport_t *cpp; /* next proto:port to test */ - int nopen; /* numbef of open ports found */ + int nopen; /* number of open ports found */ int nactive; /* number of active connections */ struct pxyhost *next; /* next host to test */ } pxyhost_t; @@ -39,7 +39,7 @@ static char *progname; static int verbose; /* verbosity level */ static int maxconn; /* max number of connections */ -static int maxhconn; /* max number of connection to one host */ +static int maxhconn; /* max number of connections to one host */ static int stopfound; /* stop searching on first open port */ struct sockaddr_in baddr; /* bind address */ static pxyhost_t *hosts; /* host list */ @@ -449,14 +449,14 @@ " -M maxhconn - maximum number of parallel connections to one host\n" " -s - stop probing a host after first found open proxy\n" " -b bindaddr - bind to specified address\n" -" -x - print extended info (proxy software etc) if known\n" +" -x - print extended info (proxy software etc.) if known\n" " -n - also print a line about definitely closed proxies\n" "\n" "proto_port_spec is in the form [proto:][port,port,...].\n" "If portlist is omitted, default ports for given protocols\n" "will be tried; if proto is omitted, either all protocols will\n" -"be tried (if port is not known), or the protocols which are\n" -"assotiated with this port.\n" +"be tried (if port is not known), or the protocols that are\n" +"associated with this port.\n" "\n" "The following protocols are recognized:\n" , progname, progname, pxytimeout / 1000); @@ -661,7 +661,7 @@ /*XXX abort active connections: need a list of * all connections for this host, and a state of * each: in case of e.g. dsbl, connection may be - * in final stage and it isn't a good idea to simple + * in final stage and it isn't a good idea to simply * abort connection in this case. * Here, we just will not do any more *new* connections. */ @@ -974,7 +974,7 @@ dstspec = strdup(pxybuf); } - dsbluser = egetenv("DSBL_USER", "anonimous"); + dsbluser = egetenv("DSBL_USER", "anonymous"); dsblpass = egetenv("DSBL_PASS", ""); dsblfrom = egetenv("DSBL_FROM", dsbluser); dsblrcpt = egetenv("DSBL_RCPT", "listme@listme.dsbl.org"); @@ -1015,7 +1015,7 @@ { "dsbl", dsblh, dsbld, dsble, dsbli, "[:smtpserver[:port]]", "attempt to submit proxy to DSBL-like system\n" " DSBL settings are expected to be in environment:\n" - "\t$DSBL_USER - username (anonimous)\n" + "\t$DSBL_USER - username (anonymous)\n" "\t$DSBL_PASS - password (default is empty)\n" "\t$DSBL_COOKIE_HOST - cookie server (cookie.dsbl.org)\n" "\t$DSBL_COOKIE - already obtained DSBL cookie\n" --- proxycheck-0.45a/proxylogger.c.j 2003-05-01 01:37:18.000000000 +0100 +++ proxycheck-0.45a/proxylogger.c 2003-11-29 14:17:56.000000000 +0000 @@ -36,7 +36,7 @@ struct in_addr pxyaddr; unsigned short pxyport; char *logfile; -char *say = "550 open proxy cheking service"; +char *say = "550 open proxy checking service"; char *saylast = "550 ESMTP_unwelcome"; char buf[2048]; --- proxycheck-0.45a/pxy.c.j 2003-05-11 15:47:38.000000000 +0100 +++ proxycheck-0.45a/pxy.c 2003-11-30 10:39:15.000000000 +0000 @@ -267,7 +267,7 @@ return 1; } else { - pxyinfo(c, 2, "HTTP request successeful (%d)", r); + pxyinfo(c, 2, "HTTP request successful (%d)", r); return 0; } } @@ -281,7 +281,7 @@ */ if (!pxynoerr(e, c)) return; if (c->pxystate == 0) { - /* some proxies requires \r\n in separate packet - doh */ + /* some proxies require \r\n in separate packet - doh */ if (pxyprintf(c, 3, "CONNECT %s:%d HTTP/1.0\r\n", inet_ntoa(c->dstaddr), c->dstport) && pxywrite(c, "\r\n", 2, 3) && @@ -291,7 +291,7 @@ else /* todo: read headers if any here. * requires some logic change: upper-level protocol - * routines should deal with already read data */ + * routines should deal with already-read data */ pxyaction(c, 0); } @@ -306,7 +306,7 @@ if (!r) return 0; if (r < 0) return 1; /*if (r / 100 == 2)*/ { - pxyinfo(c, 2, "HTTP request successeful (%d)", r); + pxyinfo(c, 2, "HTTP request successful (%d)", r); return 0; } } @@ -572,12 +572,12 @@ static void fuh(int UNUSED fd, ev_t e, pxyconn_t *c) { - /* FTP proxy. Wait for initial FTP greething and + /* FTP proxy. Wait for initial FTP greeting and * issue a command: * USER dummy@targethost:targetport\r\n * After this, target receives * USER dummy - * and transparent connection begun. + * and transparent connection begins. * There is no way to use such proxy with protocols * dependant on first line from client (e.g. http). */ --- proxycheck-0.45a/pxy.h.j 2003-04-30 23:52:41.000000000 +0100 +++ proxycheck-0.45a/pxy.h 2003-11-30 12:12:48.000000000 +0000 @@ -81,7 +81,7 @@ /* allocate new connection structure */ pxyconn_t *pxynew(); -/* free connection resources, timers etc */ +/* free connection resources, timers etc. */ void pxyfree(pxyconn_t *c); /* start new connection attempt */