Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / DBI::ProxyServer.3
CommitLineData
86530b38
AT
1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "DBI::ProxyServer 3"
132.TH DBI::ProxyServer 3 "2002-10-01" "perl v5.8.0" "User Contributed Perl Documentation"
133.SH "NAME"
134DBI::ProxyServer \- a server for the DBD::Proxy driver
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137.Vb 2
138\& use DBI::ProxyServer;
139\& DBI::ProxyServer::main(@ARGV);
140.Ve
141.SH "DESCRIPTION"
142.IX Header "DESCRIPTION"
143DBI::Proxy Server is a module for implementing a proxy for the \s-1DBI\s0 proxy
144driver, DBD::Proxy. It allows access to databases over the network if the
145\&\s-1DBMS\s0 does not offer networked operations. But the proxy server might be
146usefull for you, even if you have a \s-1DBMS\s0 with integrated network
147functionality: It can be used as a \s-1DBI\s0 proxy in a firewalled environment.
148.PP
149DBI::ProxyServer runs as a daemon on the machine with the \s-1DBMS\s0 or on the
150firewall. The client connects to the agent using the \s-1DBI\s0 driver DBD::Proxy,
151thus in the exactly same way than using DBD::mysql, DBD::mSQL or any other
152\&\s-1DBI\s0 driver.
153.PP
154The agent is implemented as a RPC::PlServer application. Thus you have
155access to all the possibilities of this module, in particular encryption
156and a similar configuration file. DBI::ProxyServer adds the possibility of
157query restrictions: You can define a set of queries that a client may
158execute and restrict access to those. (Requires a \s-1DBI\s0 driver that supports
159parameter binding.) See \*(L"\s-1CONFIGURATION\s0 \s-1FILE\s0\*(R".
160.SH "OPTIONS"
161.IX Header "OPTIONS"
162When calling the \fIDBI::ProxyServer::main()\fR function, you supply an
163array of options. (@ARGV, the array of command line options is used,
164if you don't.) These options are parsed by the Getopt::Long module.
165The ProxyServer inherits all of RPC::PlServer's and hence Net::Daemon's
166options and option handling, in particular the ability to read
167options from either the command line or a config file. See
168\&\fIRPC::PlServer\fR\|(3). See \fINet::Daemon\fR\|(3). Available options include
169.IP "\fIchroot\fR (\fB\-\-chroot=dir\fR)" 4
170.IX Item "chroot (--chroot=dir)"
171(\s-1UNIX\s0 only) After doing a \fIbind()\fR, change root directory to the given
172directory by doing a \fIchroot()\fR. This is usefull for security, but it
173restricts the environment a lot. For example, you need to load \s-1DBI\s0
174drivers in the config file or you have to create hard links to Unix
175sockets, if your drivers are using them. For example, with MySQL, a
176config file might contain the following lines:
177.Sp
178.Vb 9
179\& my $rootdir = '/var/dbiproxy';
180\& my $unixsockdir = '/tmp';
181\& my $unixsockfile = 'mysql.sock';
182\& foreach $dir ($rootdir, "$rootdir$unixsockdir") {
183\& mkdir 0755, $dir;
184\& }
185\& link("$unixsockdir/$unixsockfile",
186\& "$rootdir$unixsockdir/$unixsockfile");
187\& require DBD::mysql;
188.Ve
189.Sp
190.Vb 4
191\& {
192\& 'chroot' => $rootdir,
193\& ...
194\& }
195.Ve
196.Sp
197If you don't know \fIchroot()\fR, think of an \s-1FTP\s0 server where you can see a
198certain directory tree only after logging in. See also the \-\-group and
199\&\-\-user options.
200.IP "\fIclients\fR" 4
201.IX Item "clients"
202An array ref with a list of clients. Clients are hash refs, the attributes
203\&\fIaccept\fR (0 for denying access and 1 for permitting) and \fImask\fR, a Perl
204regular expression for the clients \s-1IP\s0 number or its host name. See
205\&\*(L"Access control\*(R" below.
206.IP "\fIconfigfile\fR (\fB\-\-configfile=file\fR)" 4
207.IX Item "configfile (--configfile=file)"
208Config files are assumed to return a single hash ref that overrides the
209arguments of the new method. However, command line arguments in turn take
210precedence over the config file. See the \*(L"\s-1CONFIGURATION\s0 \s-1FILE\s0\*(R" section
211below for details on the config file.
212.IP "\fIdebug\fR (\fB\-\-debug\fR)" 4
213.IX Item "debug (--debug)"
214Turn debugging mode on. Mainly this asserts that logging messages of
215level \*(L"debug\*(R" are created.
216.IP "\fIfacility\fR (\fB\-\-facility=mode\fR)" 4
217.IX Item "facility (--facility=mode)"
218(\s-1UNIX\s0 only) Facility to use for \*(L"Sys::Syslog (3)\*(R". The default is
219\&\fBdaemon\fR.
220.IP "\fIgroup\fR (\fB\-\-group=gid\fR)" 4
221.IX Item "group (--group=gid)"
222After doing a \fIbind()\fR, change the real and effective \s-1GID\s0 to the given.
223This is usefull, if you want your server to bind to a privileged port
224(<1024), but don't want the server to execute as root. See also
225the \-\-user option.
226.Sp
227\&\s-1GID\s0's can be passed as group names or numeric values.
228.IP "\fIlocaladdr\fR (\fB\-\-localaddr=ip\fR)" 4
229.IX Item "localaddr (--localaddr=ip)"
230By default a daemon is listening to any \s-1IP\s0 number that a machine
231has. This attribute allows to restrict the server to the given
232\&\s-1IP\s0 number.
233.IP "\fIlocalport\fR (\fB\-\-localport=port\fR)" 4
234.IX Item "localport (--localport=port)"
235This attribute sets the port on which the daemon is listening. It
236must be given somehow, as there's no default.
237.IP "\fIlogfile\fR (\fB\-\-logfile=file\fR)" 4
238.IX Item "logfile (--logfile=file)"
239Be default logging messages will be written to the syslog (Unix) or
240to the event log (Windows \s-1NT\s0). On other operating systems you need to
241specify a log file. The special value \*(L"\s-1STDERR\s0\*(R" forces logging to
242stderr. See \fINet::Daemon::Log\fR\|(3) for details.
243.IP "\fImode\fR (\fB\-\-mode=modename\fR)" 4
244.IX Item "mode (--mode=modename)"
245The server can run in three different modes, depending on the environment.
246.Sp
247If you are running Perl 5.005 and did compile it for threads, then the
248server will create a new thread for each connection. The thread will
249execute the server's \fIRun()\fR method and then terminate. This mode is the
250default, you can force it with \*(L"\-\-mode=threads\*(R".
251.Sp
252If threads are not available, but you have a working \fIfork()\fR, then the
253server will behave similar by creating a new process for each connection.
254This mode will be used automatically in the absence of threads or if
255you use the \*(L"\-\-mode=fork\*(R" option.
256.Sp
257Finally there's a single-connection mode: If the server has accepted a
258connection, he will enter the \fIRun()\fR method. No other connections are
259accepted until the \fIRun()\fR method returns (if the client disconnects).
260This operation mode is usefull if you have neither threads nor \fIfork()\fR,
261for example on the Macintosh. For debugging purposes you can force this
262mode with \*(L"\-\-mode=single\*(R".
263.IP "\fIpidfile\fR (\fB\-\-pidfile=file\fR)" 4
264.IX Item "pidfile (--pidfile=file)"
265(\s-1UNIX\s0 only) If this option is present, a \s-1PID\s0 file will be created at the
266given location.
267.IP "\fIuser\fR (\fB\-\-user=uid\fR)" 4
268.IX Item "user (--user=uid)"
269After doing a \fIbind()\fR, change the real and effective \s-1UID\s0 to the given.
270This is usefull, if you want your server to bind to a privileged port
271(<1024), but don't want the server to execute as root. See also
272the \-\-group and the \-\-chroot options.
273.Sp
274\&\s-1UID\s0's can be passed as group names or numeric values.
275.IP "\fIversion\fR (\fB\-\-version\fR)" 4
276.IX Item "version (--version)"
277Supresses startup of the server; instead the version string will
278be printed and the program exits immediately.
279.SH "CONFIGURATION FILE"
280.IX Header "CONFIGURATION FILE"
281The configuration file is just that of \fIRPC::PlServer\fR or \fINet::Daemon\fR
282with some additional attributes in the client list.
283.PP
284The config file is a Perl script. At the top of the file you may include
285arbitraty Perl source, for example load drivers at the start (usefull
286to enhance performance), prepare a chroot environment and so on.
287.PP
288The important thing is that you finally return a hash ref of option
289name/value pairs. The possible options are listed above.
290.PP
291All possibilities of Net::Daemon and RPC::PlServer apply, in particular
292.IP "Host and/or User dependent access control" 4
293.IX Item "Host and/or User dependent access control"
294.PD 0
295.IP "Host and/or User dependent encryption" 4
296.IX Item "Host and/or User dependent encryption"
297.IP "Changing \s-1UID\s0 and/or \s-1GID\s0 after binding to the port" 4
298.IX Item "Changing UID and/or GID after binding to the port"
299.IP "Running in a \fIchroot()\fR environment" 4
300.IX Item "Running in a chroot() environment"
301.PD
302.PP
303Additionally the server offers you query restrictions. Suggest the
304following client list:
305.PP
306.Vb 14
307\& 'clients' => [
308\& { 'mask' => '^admin\e.company\e.com$',
309\& 'accept' => 1,
310\& 'users' => [ 'root', 'wwwrun' ],
311\& },
312\& {
313\& 'mask' => '^admin\e.company\e.com$',
314\& 'accept' => 1,
315\& 'users' => [ 'root', 'wwwrun' ],
316\& 'sql' => {
317\& 'select' => 'SELECT * FROM foo',
318\& 'insert' => 'INSERT INTO foo VALUES (?, ?, ?)'
319\& }
320\& }
321.Ve
322.PP
323then only the users root and wwwrun may connect from admin.company.com,
324executing arbitrary queries, but only wwwrun may connect from other
325hosts and is restricted to
326.PP
327.Vb 1
328\& $sth->prepare("select");
329.Ve
330.PP
331or
332.PP
333.Vb 1
334\& $sth->prepare("insert");
335.Ve
336.PP
337which in fact are \*(L"\s-1SELECT\s0 * \s-1FROM\s0 foo\*(R" or \*(L"\s-1INSERT\s0 \s-1INTO\s0 foo \s-1VALUES\s0 (?, ?, ?)\*(R".
338.SH "AUTHOR"
339.IX Header "AUTHOR"
340.Vb 4
341\& Copyright (c) 1997 Jochen Wiedmann
342\& Am Eisteich 9
343\& 72555 Metzingen
344\& Germany
345.Ve
346.PP
347.Vb 2
348\& Email: joe@ispsoft.de
349\& Phone: +49 7123 14881
350.Ve
351.PP
352The DBI::ProxyServer module is free software; you can redistribute it
353and/or modify it under the same terms as Perl itself. In particular
354permission is granted to Tim Bunce for distributing this as a part of
355the \s-1DBI\s0.
356.SH "SEE ALSO"
357.IX Header "SEE ALSO"
358\&\fIdbiproxy\fR\|(1), \fIDBD::Proxy\fR\|(3), \s-1\fIDBI\s0\fR\|(3), \fIRPC::PlServer\fR\|(3),
359\&\fIRPC::PlClient\fR\|(3), \fINet::Daemon\fR\|(3), \fINet::Daemon::Log\fR\|(3),
360\&\fISys::Syslog\fR\|(3), \fIWin32::EventLog\fR\|(3), \fIsyslog\fR\|(2)