-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdccserver.mdoc
178 lines (178 loc) · 5 KB
/
dccserver.mdoc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
.\" $NiH: dccserver.mdoc,v 1.19 2003/11/02 11:44:47 wiz Exp $
.\"
.\" Copyright (c) 2002, 2003, 2012 Thomas Klausner.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above
.\" copyright notice, this list of conditions and the following
.\" disclaimer in the documentation and/or other materials provided
.\" with the distribution.
.\" 3. The name of the author may not be used to endorse or promote
.\" products derived from this software without specific prior
.\" written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THOMAS KLAUSNER ``AS IS'' AND ANY
.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.Dd January 20, 2012
.Dt DCCSERVER 1
.Os
.Sh NAME
.Nm dccserver
.Nd simulate mIRC's /dccserver command
.Sh SYNOPSIS
.Nm
.Op Fl ehiv
.Op Fl n Ar nickname
.Op Fl p Ar port
.Sh DESCRIPTION
.Nm
aims to provide the functions of mIRC's /dccserver command.
.Pp
Currently, Chat and Send (including resume) modes are supported.
Fserve and Get mode are not yet supported.
.Pp
All connections are accepted; some simple checks on allowed file names
are done.
During connectione establishment, there is a 15 seconds timeout; during
transfers, it is 2 minutes.
Chats have no timeout.
.Pp
Supported options:
.Bl -tag -width XnXnicknameXX
.It Fl e
Echo lines input by the user.
Useful e.g. if you are using dccserver in an
.Xr irssi 1
window (see also the
.Fl i
option and the
.Sx EXAMPLES
section).
.It Fl h
Display a short help message.
.It Fl i
Do not filter out control characters for color, bold, reverse, and
underlined text.
Useful if your terminal or wrapper can interpret them.
.It Fl n Ar nickname
Set nickname used in handshake to
.Ar nickname .
Should be the same nickname that you use on IRC, otherwise most
clients will complain and close the connection.
Defaults to
.Dq dccserver .
.It Fl p Ar port
Listen for connections on port
.Ar port .
You can specify this argument multiple times to listen on more than
one port.
If no
.Fl p
is given,
.Nm
will listen on port 59, since that is mIRC's default port.
Please note that you have to have root privileges to bind to ports
below 1024.
See
.Sx SECURITY CONSIDERATIONS
below.
.It Fl v
Display program name and version number.
.El
.Pp
After a client has connected, you can send commands to it manually.
This is useful for chats or fserves.
The syntax is
.Dq <nn>: <text>
where
.Dq <nn>
is the number of the child, and
.Dq <text>
the text you want to send.
For example:
.Dq 0:\ dir .
Please note that the
.Dq \&:
and the space are necessary.
.Pp
Text coming from the remote clients will be shown prepended by their
nickname and child ID.
.Pp
You can give
.Nm
commands by entering one of the following keywords without a child ID
in front:
.Bl -tag -width xclosexIDx
.It Ic close X
to close the connection with ID X, e.g.,
.Ic close 3 .
.It Ic info
to get an overview of the current connection state.
.It Ic quit
to close all connections and exit the program.
.El
.Sh EXAMPLES
Listen on ports 59 and 37334 as user
.Dq yournick :
.Pp
.Bd -literal -offset indent
dccserver -n yournick -p 59 -p 37334
.Ed
.Pp
With
.Xr irssi 1 ,
you could create the following alias (one line):
.Pp
.Bd -literal -offset indent
/alias DCCSERVER
window new hidden;
window name dccserver$0;
echo dccserver for $N on port $0;
exec -name dccserver$0 -nosh -interactive -window dccserver -n $N -p $0 -i -e
.Ed
.Pp
and then open a new window with a dccserver inside with
.Dq /dccserver 59
for port 59.
.Sh SEE ALSO
.Xr dccsend 1
.Sh AUTHORS
.Nm
was written by
.An Thomas Klausner Aq Mt [email protected] .
.Sh BUGS
Get and Fserve modes are not yet supported.
.Sh SECURITY CONSIDERATIONS
mIRC's default port is 59.
To bind to ports below 1024, one needs root privileges; for this reason
.Nm
is installed setuid root.
To limit damage done in case of trouble,
.Nm
.Xr chroot 2 Ns s
itself in the current directory and drops the setuid privileges as soon
as possible.
.Pp
Alternatively, you can remove the setuid bit from
.Nm
with
.Dq Ic chmod u-s /path/to/dccserver
with the limitation that you will only be able to use
.Nm
on ports above 1024, and you won't get the effect of
.Xr chroot 2 .