~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/bin/pg_basebackup/pg_basebackup.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt, CVE-2013-1899
  • Date: 2013-04-02 12:24:32 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20130402122432-whgoxuhc5tqte9v4
Tags: 9.1.9-0ubuntu11.10
* New upstream security/bug fix release: (LP: #1163184)
  - Fix insecure parsing of server command-line switches.
    A connection request containing a database name that begins with
    "-" could be crafted to damage or destroy files within the server's
    data directory, even if the request is eventually rejected.
    [CVE-2013-1899]
  - Reset OpenSSL randomness state in each postmaster child process.
    This avoids a scenario wherein random numbers generated by
    "contrib/pgcrypto" functions might be relatively easy for another
    database user to guess. The risk is only significant when the
    postmaster is configured with ssl = on but most connections don't
    use SSL encryption. [CVE-2013-1900]
  - Make REPLICATION privilege checks test current user not
    authenticated user.
    An unprivileged database user could exploit this mistake to call
    pg_start_backup() or pg_stop_backup(), thus possibly interfering
    with creation of routine backups. [CVE-2013-1901]
  - Fix GiST indexes to not use "fuzzy" geometric comparisons when it's
    not appropriate to do so.
    The core geometric types perform comparisons using "fuzzy"
    equality, but gist_box_same must do exact comparisons, else GiST
    indexes using it might become inconsistent. After installing this
    update, users should "REINDEX" any GiST indexes on box, polygon,
    circle, or point columns, since all of these use gist_box_same.
  - Fix erroneous range-union and penalty logic in GiST indexes that
    use "contrib/btree_gist" for variable-width data types, that is
    text, bytea, bit, and numeric columns.
    These errors could result in inconsistent indexes in which some
    keys that are present would not be found by searches, and also in
    useless index bloat. Users are advised to "REINDEX" such indexes
    after installing this update.
  - Fix bugs in GiST page splitting code for multi-column indexes.
    These errors could result in inconsistent indexes in which some
    keys that are present would not be found by searches, and also in
    indexes that are unnecessarily inefficient to search. Users are
    advised to "REINDEX" multi-column GiST indexes after installing
    this update.
  - See HISTORY/changelog.gz for details about the other bug fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
816
816
        int                     i;
817
817
        char            xlogstart[64];
818
818
        char            xlogend[64];
 
819
        int                     minServerMajor,
 
820
                                maxServerMajor;
 
821
        int                     serverMajor;
819
822
 
820
823
        /*
821
824
         * Connect in replication mode to the server
823
826
        conn = GetConnection();
824
827
 
825
828
        /*
 
829
         * Check server version. BASE_BACKUP command was introduced in 9.1, so
 
830
         * we can't work with servers older than 9.1. We don't officially support
 
831
         * servers newer than the client, but the 9.1 version happens to work with
 
832
         * a 9.2 server. This version check was added to 9.1 branch in a minor
 
833
         * release, so allow connecting to a 9.2 server, to avoid breaking
 
834
         * environments that worked before this version check was added.
 
835
         */
 
836
        minServerMajor = 901;
 
837
        maxServerMajor = 902;
 
838
        serverMajor = PQserverVersion(conn) / 100;
 
839
        if (serverMajor < minServerMajor || serverMajor > maxServerMajor)
 
840
        {
 
841
                fprintf(stderr, _("%s: unsupported server version %s\n"),
 
842
                                progname, PQparameterStatus(conn, "server_version"));
 
843
                disconnect_and_exit(1);
 
844
        }
 
845
 
 
846
        /*
826
847
         * Start the actual backup
827
848
         */
828
849
        PQescapeStringConn(conn, escaped_label, label, sizeof(escaped_label), &i);