~ubuntu-branches/ubuntu/utopic/postgresql-9.1/utopic

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Christoph Berg, Martin Pitt, Christoph Berg
  • Date: 2013-02-05 14:15:33 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130205141533-vkoy7oaxb0wehjv6
[ Martin Pitt ]
* Add autopkgtest, moved from postgresql-common.
* debian/rules: Only build the error codes and the plpython subtree for the
  "python3" flavor, to cut down build time.
* Add missing docbook build dependency. (Closes: #697618)

[ Christoph Berg ]
* New upstream version.
  + Prevent execution of enum_recv from SQL
    The function was misdeclared, allowing a simple SQL command to crash the
    server.  In principle an attacker might be able to use it to examine the
    contents of server memory.  Our thanks to Sumit Soni (via Secunia SVCRP)
    for reporting this issue. (CVE-2013-0255)

Show diffs side-by-side

added added

removed removed

Lines of Context:
653
653
                no_security_labels = 1;
654
654
 
655
655
        /*
 
656
         * When running against 9.0 or later, check if we are in recovery mode,
 
657
         * which means we are on a hot standby.
 
658
         */
 
659
        if (g_fout->remoteVersion >= 90000)
 
660
        {
 
661
                PGresult *res;
 
662
                const char *query = "SELECT pg_catalog.pg_is_in_recovery()";
 
663
                int ntups;
 
664
 
 
665
                res = PQexec(g_conn, query);
 
666
                check_sql_result(res, g_conn, query, PGRES_TUPLES_OK);
 
667
                ntups = PQntuples(res);
 
668
 
 
669
                if (ntups != 1)
 
670
                {
 
671
                        write_msg(NULL, ngettext("query returned %d row instead of one: %s\n",
 
672
                                                                         "query returned %d rows instead of one: %s\n",
 
673
                                                                         ntups),
 
674
                                          ntups, query);
 
675
                        exit_nicely();
 
676
                }
 
677
 
 
678
                if (strcmp(PQgetvalue(res, 0, 0), "t") == 0)
 
679
                {
 
680
                        /*
 
681
                         * On hot standby slaves, never try to dump unlogged table data,
 
682
                         * since it will just throw an error.
 
683
                         */
 
684
                        no_unlogged_table_data = true;
 
685
                }
 
686
                PQclear(res);
 
687
        }
 
688
 
 
689
        /*
656
690
         * Start transaction-snapshot mode transaction to dump consistent data.
657
691
         */
658
692
        do_sql_command(g_conn, "BEGIN");