Security Advisories (9)
CVE-2020-14393 (2020-09-16)

A buffer overflow was found in perl-DBI < 1.643 in DBI.xs. A local attacker who is able to supply a string longer than 300 characters could cause an out-of-bounds write, affecting the availability of the service or integrity of data.

CVE-2020-14392 (2020-06-17)

An untrusted pointer dereference flaw was found in Perl-DBI < 1.643. A local attacker who is able to manipulate calls to dbd_db_login6_sv() could cause memory corruption, affecting the service's availability.

CVE-2019-20919 (2020-09-17)

An issue was discovered in the DBI module before 1.643 for Perl. The hv_fetch() documentation requires checking for NULL and the code does that. But, shortly thereafter, it calls SvOK(profile), causing a NULL pointer dereference.

CPANSA-DBI-2014-01 (2014-10-15)

DBD::File drivers open files from folders other than specifically passed using the f_dir attribute.

CVE-2005-0077 (2005-05-02)

Allows local users to overwrite arbitrary files via a symlink attack on a temporary PID file.

CVE-2014-10402 (2020-09-16)

An issue was discovered in the DBI module through 1.643 for Perl. DBD::File drivers can open files from folders other than those specifically passed via the f_dir attribute in the data source name (DSN). NOTE: this issue exists because of an incomplete fix for CVE-2014-10401.

CVE-2014-10401 (2020-09-11)

An issue was discovered in the DBI module before 1.632 for Perl. DBD::File drivers can open files from folders other than those specifically passed via the f_dir attribute.

CVE-2013-7491 (2020-09-11)

An issue was discovered in the DBI module before 1.628 for Perl. Stack corruption occurs when a user-defined function requires a non-trivial amount of memory and the Perl stack gets reallocated.

CVE-2013-7490 (2020-09-11)

An issue was discovered in the DBI module before 1.632 for Perl. Using many arguments to methods for Callbacks may lead to memory corruption.

NAME

DBI::Format - A package for displaying result tables

SYNOPSIS

# create a new result object
$r = DBI::Format->new('var1' => 'val1', ...);

# Prepare it for output by creating a header
$r->header($sth, $fh);

# In a loop, display rows
while ($ref = $sth->fetchrow_arrayref()) {
  $r->row($ref);
}

# Finally create a trailer
$r->trailer();

DESCRIPTION

THIS PACKAGE IS STILL VERY EXPERIMENTAL. THINGS WILL CHANGE.

This package is used for making the output of DBI::Shell configurable. The idea is to derive a subclass for any kind of output table you might create. Examples are

  • a very simple output format as offered by DBI::neat_list(). "AVAILABLE SUBCLASSES".

  • a box format, as offered by the Data::ShowTable module.

  • HTML format, as used in CGI binaries

  • postscript, to be piped into lpr or something similar

In the future the package should also support interactive methods, for example tab completion.

These are the available methods:

new(@attr)
new(\%attr)

(Class method) This is the constructor. You'd rather call a subclass constructor. The construcor is accepting either a list of key/value pairs or a hash ref.

header($sth, $fh)

(Instance method) This is called when a new result table should be created to display the results of the statement handle $sth. The (optional) argument $fh is an IO handle (or any object supporting a print method), usually you use an IO::Wrap object for STDIN.

The method will query the $sth for its NAME, NUM_OF_FIELDS, TYPE, SCALE and PRECISION attributes and typically print a header. In general you should not assume that $sth is indeed a DBI statement handle and better treat it as a hash ref with the above attributes.

row($ref)

(Instance method) Prints the contents of the array ref $ref. Usually you obtain this array ref by calling $sth->fetchrow_arrayref().

trailer

(Instance method) Once you have passed all result rows to the result package, you should call the trailer method. This method can, for example print the number of result rows.

AVAILABLE SUBCLASSES

First of all, you can use the DBI::Format package itself: It's not an abstract base class, but a very simple default using DBI::neat_list().

Ascii boxes

This subclass is using the Box mode of the Data::ShowTable module internally. Data::ShowTable(3).

Raw

Row is written without formating. Columns returned in comma or user defined separated list.

String

Row is written using a string format. Future releases may include the ability set the string format, if someone contributes it.

AUTHOR AND COPYRIGHT

This module is Copyright (c) 1997, 1998

Jochen Wiedmann
Am Eisteich 9
72555 Metzingen
Germany

Email: joe@ispsoft.de
Phone: +49 7123 14887

The DBD::Proxy module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

DBI::Shell(3), DBI(3), dbish(1)