socat stable port information

Package: socat
Version: 2.0.0
Revision: b4
Description: Multipurp. relay for bidirect. data transfer
License: GPL
Maintainer: Andreas Gockel
Depends: readline5-shlibs
BuildDepends: fink (>= 0.24.12), readline5, system-openssl-dev
Replaces: %n, %n-ssl
Conflicts: %n, %n-ssl
Source: http://www.dest-unreach.org/%n/download/%n-%v-%r.tar.bz2
Source-MD5: b51a00937d0a56fc8eccd36175e9d068
PatchFile: %n.patch
PatchFile-MD5: bc4859df85b03832df770c38c1627a19
SetCPPFLAGS: -I%p/lib/system-openssl/include -D__APPLE_USE_RFC_2292
SetLDFLAGS: -L%p/lib/system-openssl/lib
DocFiles: BUGREPORTS COPYING EXAMPLES FAQ README SECURITY
Homepage: http://www.dest-unreach.org/socat/
Descdetail: <<
%n (for SOcket CAT) establishes two bidirectional byte streams
and transfers data between them. Data channels may be files, pipes,
devices (terminal or modem, etc.), or sockets (Unix, IPv4, IPv6, raw,
UDP, TCP, SSL). It provides forking, logging and tracing, different
modes for interprocess communication and many more options.
.
It can be used, for example, as a TCP relay (one-shot or daemon),
as an external socksifier, as a shell interface to Unix sockets,
as an IPv6 relay, as a netcat and rinetd replacement, to redirect
TCP-oriented programs to a serial line, or to establish a relatively
secure environment (su and chroot) for running client or server shell
scripts inside network connections. %n supports sctp as of 1.7.0.
<<
DescPort: <<
This build includes debian patches
.
Initial port by Pepe Barbe
<<

socat stable port .patch

diff -rauN socat-2.0.0-b4/doc/socat.1 socat-2.0.0-b4-p1/doc/socat.1
--- socat-2.0.0-b4/doc/socat.1 2010-07-06 07:59:41.000000000 +0200
+++ socat-2.0.0-b4-p1/doc/socat.1 2011-09-04 22:38:29.000000000 +0200
@@ -7,9 +7,9 @@
.SH "SYNOPSIS"
\f(CWsocat [options] \fP
.br
-\f(CWsocat -V\fP
+\f(CWsocat \-V\fP
.br
-\f(CWsocat -h[h[h]] | -?[?[?]]\fP
+\f(CWsocat \-h[h[h]] | \-?[?[?]]\fP
.br
\f(CWfilan\fP
.br
@@ -27,7 +27,7 @@
.PP
\fBFilan\fP is a utility that prints information about its active file
descriptors to stdout\&. It has been written for debugging \fBsocat\fP, but might be
-useful for other purposes too\&. Use the -h option to find more infos\&.
+useful for other purposes too\&. Use the \-h option to find more infos\&.
.PP
\fBProcan\fP is a utility that prints information about process parameters to
stdout\&. It has been written to better understand
@@ -72,11 +72,11 @@
Print a help text to stdout describing command line options and available address
types, and exit\&.
.IP "\fB\f(CW-hh | -??\fP\fP"
-Like -h, plus a list of the short names of all available address options\&. Some options are
+Like \-h, plus a list of the short names of all available address options\&. Some options are
platform dependend, so this output is helpful for checking the particular
implementation\&.
.IP "\fB\f(CW-hhh | -???\fP\fP"
-Like -hh, plus a list of all available address option names\&.
+Like \-hh, plus a list of all available address option names\&.
.IP "\fB\f(CW-d\fP\fP"
Without this option, only fatal and error messages are generated; applying
this option also prints warning messages\&. See DIAGNOSTICS
@@ -91,7 +91,7 @@
.IP "\fB\f(CW-D\fP\fP"
Logs information about file descriptors before starting the transfer phase\&.
.IP "\fB\f(CW-ly[]\fP\fP"
-Writes messages to syslog instead of stderr; severity as defined with -d
+Writes messages to syslog instead of stderr; severity as defined with \-d
option\&. With optional , the syslog type can
be selected, default is "daemon"\&.
.IP "\fB\f(CW-lf\fP\fP\f(CW \fP"
@@ -223,7 +223,7 @@
Some keywords are overloaded with multiple \fIaddress forms\fP that may differ in
the following properties: Endpoint or inter address; number of
parameters; supported transfer directions on the left side\&. To see all
-address forms available invoke socat with option -h\&. The first
+address forms available invoke socat with option \-h\&. The first
set of rwb flags describes the transfer directions on the address\&'s
left side (read, write, and bidirectional, as seen by this address)\&. The second
set describes the required direction on the right side; empty means it is an
@@ -232,7 +232,7 @@
When parsing the addresses within an address chain \fBsocat\fP takes care of the
data transfer directions between consecutive addresses\&. For the first address
the directions are bidirectional per default, or unidirectional when when
-option -u or -U is used\&. For the following
+option \-u or \-U is used\&. For the following
addresses, the required directions are derived from the right side directions
of the left neighbor\&.
.PP
@@ -243,7 +243,7 @@
For filtering the options that are useful with an address
type, each option is member of one option group\&. For
each address type there is a set of option groups allowed\&. Only options
-belonging to one of these address groups may be used (except with option -g)\&.
+belonging to one of these address groups may be used (except with option \-g)\&.
.PP
Address specifications following the above schema are also called \fIsingle\fP
address specifications\&.
@@ -772,7 +772,7 @@
Listens on [TCP service] and accepts a
TCP/IP connection\&. The IP version is 4 or the one specified with
address option pf, \fBsocat\fP option
-(-4, -6), or environment variable SOCAT_DEFAULT_LISTEN_IP\&.
+(\-4, \-6), or environment variable SOCAT_DEFAULT_LISTEN_IP\&.
Note that opening
this address usually blocks until a client connects\&.
.br
@@ -821,7 +821,7 @@
.br
Please note that you can - beyond the options of the specified groups - also
use options of higher level protocols when you apply \fBsocat\fP option
--g\&.
+\-g\&.
.br
Option groups: FD,SOCKET,CHILD,RETRY
.br
@@ -848,7 +848,7 @@
.br
Please note that you can - beyond the options of the specified groups - also
use options of higher level protocols when you apply \fBsocat\fP option
--g\&.
+\-g\&.
.br
Option groups: FD,SOCKET,RANGE
.br
@@ -876,7 +876,7 @@
.br
Please note that you can - beyond the options of the specified groups - also
use options of higher level protocols when you apply \fBsocat\fP option
--g\&.
+\-g\&.
.br
Option groups: FD,SOCKET,LISTEN,RANGE,CHILD,RETRY
.br
@@ -1108,7 +1108,7 @@
Listens on [TCP service] and accepts a
TCP/IP connection\&. The IP version is 4 or the one specified with
address option pf, \fBsocat\fP option
-(-4, -6), or environment variable SOCAT_DEFAULT_LISTEN_IP\&.
+(\-4, \-6), or environment variable SOCAT_DEFAULT_LISTEN_IP\&.
Note that opening
this address usually blocks until a client connects\&.
.br
@@ -1445,7 +1445,7 @@
.IP "\fB\f(CWUNIX-SENDTO:\fP\fP"
Communicates with the specified peer socket, defined by [] assuming it is a UNIX domain datagram socket\&.
It sends packets to and receives packets from that peer socket only\&.
-Please note that it might be neccessary to bind the
+Please note that it might be necessary to bind the
local socket to an address (e\&.g\&. \f(CW/tmp/sock1\fP, which must not exist
before)\&.
This address type works well with \fBsocat\fP UNIX-RECVFROM and UNIX-RECV address
@@ -1540,7 +1540,7 @@
will fail\&. To catch most useless combinations as early as in the open phase,
the concept of \fIoption groups\fP was introduced\&. Each option belongs to one
or more option groups\&. Options can be used only with address types that support
-at least one of their option groups (but see option -g)\&.
+at least one of their option groups (but see option \-g)\&.
.PP
Address options have data types that their values must conform to\&.
Every address option consists of just a keyword or a keyword followed by
@@ -1603,7 +1603,7 @@
options may be applied to any address\&.
.br
Note: Some of these options are also member of another option group, that
-provides an other, non-fd based mechanism\&.
+provides another, non-fd based mechanism\&.
For these options, it depends on the actual address type and its option groups
which mechanism is used\&. The second, non-fd based mechanism is prioritized\&.
.IP "\fB\f(CWcloexec=\fP\fP"
@@ -1788,7 +1788,7 @@
long as there are still links from other processes\&.
.br
Similarly, when an address of type EXEC or SYSTEM is ended, \fBsocat\fP usually
-will explicitely kill the sub process\&. With this option, it will just close
+will explicitly kill the sub process\&. With this option, it will just close
the file descriptors\&.
.IP "\fB\f(CWshut-none\fP\fP"
Changes the (address dependent) method of shutting down the write part of a
@@ -1812,7 +1812,7 @@
.IP "\fB\f(CWioctl-void=\fP\fP"
Calls \f(CWioctl()\fP with the request value as second argument and NULL as
third argument\&. This option allows to utilize ioctls that are not
-explicitely implemented in socat\&.
+explicitly implemented in socat\&.
.IP "\fB\f(CWioctl-int=:\fP\fP"
Calls \f(CWioctl()\fP with the request value as second argument and the integer
value as third argument\&.
@@ -2092,7 +2092,7 @@
Note: \fBsocat\fP simply strips all CR characters\&.
.IP "\fB\f(CWignoreeof\fP\fP"
When EOF occurs on this channel, \fBsocat\fP ignores it and tries to read more
-data (like "tail -f") (example)\&.
+data (like "tail \-f") (example)\&.
.IP "\fB\f(CWreadbytes=\fP\fP"
\fBsocat\fP reads only so many bytes from this address (the address provides
only so many bytes for transfer and pretends to be at EOF afterwards)\&.
@@ -2626,7 +2626,7 @@
.IP o
the first \fBsocat\fP address cannot be OPENSSL or READLINE
.IP o
-\fBsocat\fP options -b, -t, -D, -l, -v, -x become useless
+\fBsocat\fP options \-b, \-t, \-D, \-l, \-v, \-x become useless
.IP o
for both addresses, options ignoreeof, cr, and crnl become useless
.IP o
@@ -2693,7 +2693,7 @@
Disconnects the terminal\&.
.IP "\fB\f(CWb19200\fP\fP"
Sets the serial line speed to 19200 baud\&. Some other rates are possible; use
-something like \f(CWsocat -hh |grep \&' b[1-9]\&'\fP to find all speeds supported by
+something like \f(CWsocat \-hh |grep \&' b[1-9]\&'\fP to find all speeds supported by
your implementation\&.
.br
Note: On some operating systems, these options may not be
@@ -3207,14 +3207,14 @@
.IP
\.LP
\.nf
-\fBsocat -d -d READLINE,history=$HOME/.http_history \\
+\fBsocat \-d \-d READLINE,history=$HOME/.http_history \\
TCP4:www.domain.org:www,crnl\fP
\.fi
.IP
this is similar to the previous example, but you can edit the current line in a
bash like manner (READLINE) and use the
history file \&.http_history; \fBsocat\fP prints messages about
-progress (-d -d)\&. The port is specified by service name
+progress (\-d \-d)\&. The port is specified by service name
(www), and correct network line termination characters
(crnl) instead of NL are used\&.
.IP
@@ -3229,7 +3229,7 @@
.IP
\.LP
\.nf
-\fBsocat -d -d -lmlocal2 \\
+\fBsocat \-d \-d \-lmlocal2 \\
TCP4-LISTEN:80,bind=myaddr1,reuseaddr,fork,su=nobody,range=10.0.0.0/8 \\
TCP4:www.domain.org:80,bind=myaddr2\fP
\.fi
@@ -3246,7 +3246,7 @@
(range); due to reuseaddr, it
allows immediate restart after master process\&'s termination, even if some child
sockets are not completely shut down\&.
-With -lmlocal2, \fBsocat\fP logs to stderr until successfully
+With \-lmlocal2, \fBsocat\fP logs to stderr until successfully
reaching the accept loop\&. Further logging is directed to syslog with facility
local2\&.
.IP
@@ -3323,18 +3323,18 @@

.IP
this is an example for unidirectional data transfer
-(-u)\&. \fBSocat\fP transfers data
+(\-u)\&. \fBSocat\fP transfers data
from file /tmp/readdata (implicit address GOPEN), starting
at its current end (seek-end=0 lets \fBsocat\fP start
reading at current end of file; use seek=0 or no
-seek option to first read the existing data) in a "tail -f" like mode
+seek option to first read the existing data) in a "tail \-f" like mode
(ignoreeof)\&. The "file"
might also be a listening UNIX domain socket (do not use a seek option then)\&.
.IP
\.LP
\.nf
\fB(sleep 5; echo PASSWORD; sleep 5; echo ls; sleep 1) |
-socat - EXEC:'ssh -l user server',pty,setsid,ctty\fP
+socat - EXEC:'ssh \-l user server',pty,setsid,ctty\fP
\.fi
.IP
EXEC\&'utes an ssh session to server\&. Uses a pty for communication between \fBsocat\fP and
@@ -3344,7 +3344,7 @@
.IP
\.LP
\.nf
-\fBsocat -u TCP4-LISTEN:3334,reuseaddr,fork \\
+\fBsocat \-u TCP4-LISTEN:3334,reuseaddr,fork \\
OPEN:/tmp/in.log,creat,append\fP
\.fi
.IP
@@ -3431,7 +3431,7 @@
connected to the TCP socket (nofork)\&. The shell starts filan and lets it print the socket addresses to
stderr (your terminal window)\&.
.IP
-.IP "\fB\f(CWecho -e "\e0\e14\e0\e0\ec" |socat -u - file:/usr/bin/squid\&.exe,seek=0x00074420\fP\fP"
+.IP "\fB\f(CWecho -e \(dq\e0\e14\e0\e0\ec\(dq |socat -u - file:/usr/bin/squid\&.exe,seek=0x00074420\fP\fP"

.IP
functions as primitive binary editor: it writes the 4 bytes 000 014 000 000 to
@@ -3459,8 +3459,9 @@
sends a broadcast to the network 192\&.168\&.1\&.0/24 and receives the replies of the
timeservers there\&. Ignores NTP packets from hosts outside this network\&.
.IP
-.IP "\fB\f(CWsocat - SOCKET-DATAGRAM:2:2:17:x007bxc0a80100x0000000000000000,bind=x007bx00000000x0000000000000000,setsockopt-int=1:6:1,range=x0000xc0a80100x0000000000000000:x0000xffffff00x0000000000000000\fP\fP"
-
+.ad l
+.IP "\fB\f(CWsocat - SOCKET-DATAGRAM:2:2:17:x007bxc0a80100x0000000000000000,b\%ind=x007bx00000000x0000000000000000,setsockopt-int=1:6:1,r\%ange=x0000xc0a80100x0000000000000000:x0000xffffff00x0000000000000000\fP\fP"
+.na
.IP
is semantically equivalent to the previous
example, but all parameters are
@@ -3503,9 +3504,10 @@
\fBsocat\fP creates a PTY to make pppd happy, binds to the network
interface \f(CWhdlc0\fP, and can transfer data between
both devices\&. Use pppd on device \f(CW/var/run/ppp\fP then\&.
-.IP
-.IP "\fB\f(CWsocat -T 1 -d -d TCP-L:10081,reuseaddr,fork,crlf SYSTEM:"echo -e \e"\e\e\e"HTTP/1\&.0 200 OK\e\e\enDocumentType: text/plain\e\e\en\e\e\endate: \e$\e(date\e)\e\e\enserver:\e$SOCAT_SOCKADDR:\e$SOCAT_SOCKPORT\e\e\enclient: \e$SOCAT_PEERADDR:\e$SOCAT_PEERPORT\e\e\en\e\e\e"\e"; cat; echo -e \e"\e\e\e"\e\e\en\e\e\e"\e""\fP\fP"
-
+.IP
+.ad l
+.IP "\fB\f(CWsocat -T 1 -d -d TCP-L:10081,reuseaddr,fork,crlf SYSTEM:\(dqecho -e \e\(dq\e\e\e\(dqHTTP/1\&.0 200 OK\e\e\enDocumentType: text/plain\e\e\en\e\e\endate: \e$\e(date\e)\e\e\enserver:\e$SOCAT_SOCKADDR:\e$SOCAT_SOCKPORT\e\e\enclient: \e$SOCAT_PEERADDR:\e$SOCAT_PEERPORT\e\e\en\e\e\e\(dq\e\(dq; cat; echo -e \e\(dq\e\e\e\(dq\e\e\en\e\e\e\(dq\e\(dq\(dq \fP\fP"
+.na
.IP
creates a simple HTTP echo server: each HTTP client that connects gets a valid
HTTP reply that contains information about the client address and port as it is
@@ -3538,7 +3540,7 @@
.PP
\fBSocat\fP uses a logging mechanism that allows to filter messages by severity\&. The
severities provided are more or less compatible to the appropriate syslog
-priority\&. With one or up to four occurrences of the -d command line option, the
+priority\&. With one or up to four occurrences of the \-d command line option, the
lowest priority of messages that are issued can be selected\&. Each message
contains a single uppercase character specifying the messages severity (one of
F, E, W, N, I, or D)
@@ -3547,7 +3549,7 @@
Conditions that require unconditional and immediate program termination\&.
.IP "ERROR:"
Conditions that prevent proper program processing\&. Usually the
-program is terminated (see option -s)\&.
+program is terminated (see option \-s)\&.
.IP "WARNING:"
Something did not function correctly or is in a state where
correct further processing cannot be guaranteed, but might be possible\&.
@@ -3583,13 +3585,13 @@
.PP
In the output variables beginning with "SOCAT" this prefix is actually replaced
by the upper case name of the executable or the value of option
--lp\&.
+\-lp\&.
.PP
.IP "\fBSOCAT_DEFAULT_LISTEN_IP\fP (input)"
(Values 4 or 6) Sets the IP version to
be used for listen, recv, and recvfrom addresses if no
pf (protocol-family) option is given\&. Is
-overridden by \fBsocat\fP options -4 or -6\&.
+overridden by \fBsocat\fP options \-4 or \-6\&.
.IP
.IP "\fBSOCAT_PREFERRED_RESOLVE_IP\fP (input)"
(Values 0, 4, or 6) Sets the IP
@@ -3701,7 +3703,7 @@
.IP
.IP "\fBHOSTNAME\fP (input)"
Is used to determine the hostname for logging (see
--lh)\&.
+\-lh)\&.
.IP
.IP "\fBLOGNAME\fP (input)"
Is used as name for the socks client user name if no
@@ -3760,11 +3762,11 @@
.PP
Address option ftruncate without value uses default 1 instead of 0\&.
.PP
-Verbose modes (-x and/or -v) display line termination characters inconsistently
+Verbose modes (\-x and/or \-v) display line termination characters inconsistently
when address options cr or crnl are used: They show the data \fIafter\fP
conversion in either direction\&.
.PP
-The data transfer blocksize setting (-b) is ignored with address readline\&.
+The data transfer blocksize setting (\-b) is ignored with address readline\&.
.PP
Send bug reports to
.PP
diff -rauN socat-2.0.0-b4/xioopts.c socat-2.0.0-b4-p1/xioopts.c
--- socat-2.0.0-b4/xioopts.c 2010-06-20 12:04:54.000000000 +0200
+++ socat-2.0.0-b4-p1/xioopts.c 2011-09-04 22:39:18.000000000 +0200
@@ -3995,10 +3995,10 @@
opt->desc = ODESC_ERROR; continue;
}
#else
- if (Setsockopt(xfd->fd1, opt->desc->major, opt->desc->minor,
+ if (Setsockopt(xfd->rfd, opt->desc->major, opt->desc->minor,
&ip4_mreqn.mreq, sizeof(ip4_mreqn.mreq)) < 0) {
Error7("setsockopt(%d, %d, %d, {0x%08x,0x%08x}, "F_Zu"): %s",
- xfd->fd1, opt->desc->major, opt->desc->minor,
+ xfd->rfd, opt->desc->major, opt->desc->minor,
ip4_mreqn.mreq.imr_multiaddr,
ip4_mreqn.mreq.imr_interface,
sizeof(ip4_mreqn.mreq),

socat _unstable_ port .patch