1. 10 May, 2017 6 commits
  2. 09 May, 2017 6 commits
  3. 08 May, 2017 11 commits
    • Tom Lane's avatar
      Further patch rangetypes_selfuncs.c's statistics slot management. · da075960
      Tom Lane authored
      Values in a STATISTIC_KIND_RANGE_LENGTH_HISTOGRAM slot are float8,
      not of the type of the column the statistics are for.
      
      This bug is at least partly the fault of sloppy specification comments
      for get_attstatsslot()/free_attstatsslot(): the type OID they want is that
      of the stavalues entries, not of the underlying column.  (I double-checked
      other callers and they seem to get this right.)  Adjust the comments to be
      more correct.
      
      Per buildfarm.
      
      Security: CVE-2017-7484
      da075960
    • Peter Eisentraut's avatar
      Check connection info string in ALTER SUBSCRIPTION · fe974cc5
      Peter Eisentraut authored
      Previously it would allow an invalid connection string to be set.
      
      Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
      Reported-by: default avatartushar <tushar.ahuja@enterprisedb.com>
      fe974cc5
    • Tom Lane's avatar
      Last-minute updates for release notes. · c89d2d02
      Tom Lane authored
      Security: CVE-2017-7484, CVE-2017-7485, CVE-2017-7486
      c89d2d02
    • Peter Eisentraut's avatar
      Fix statistics reporting in logical replication workers · 9a591c1b
      Peter Eisentraut authored
      This new arrangement ensures that statistics are reported right after
      commit of transactions.  The previous arrangement didn't get this quite
      right and could lead to assertion failures.
      
      Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
      Reported-by: default avatarErik Rijkers <er@xs4all.nl>
      9a591c1b
    • Tom Lane's avatar
      Fix possibly-uninitialized variable. · b6576e59
      Tom Lane authored
      Oversight in e2d4ef8d et al (my fault not Peter's).  Per buildfarm.
      
      Security: CVE-2017-7484
      b6576e59
    • Noah Misch's avatar
      Match pg_user_mappings limits to information_schema.user_mapping_options. · 3eefc510
      Noah Misch authored
      Both views replace the umoptions field with NULL when the user does not
      meet qualifications to see it.  They used different qualifications, and
      pg_user_mappings documented qualifications did not match its implemented
      qualifications.  Make its documentation and implementation match those
      of user_mapping_options.  One might argue for stronger qualifications,
      but these have long, documented tenure.  pg_user_mappings has always
      exhibited this problem, so back-patch to 9.2 (all supported versions).
      
      Michael Paquier and Feike Steenbergen.  Reviewed by Jeff Janes.
      Reported by Andrew Wheelwright.
      
      Security: CVE-2017-7486
      3eefc510
    • Noah Misch's avatar
      Restore PGREQUIRESSL recognition in libpq. · 0170b10d
      Noah Misch authored
      Commit 65c3bf19 moved handling of the,
      already then, deprecated requiressl parameter into conninfo_storeval().
      The default PGREQUIRESSL environment variable was however lost in the
      change resulting in a potentially silent accept of a non-SSL connection
      even when set.  Its documentation remained.  Restore its implementation.
      Also amend the documentation to mark PGREQUIRESSL as deprecated for
      those not following the link to requiressl.  Back-patch to 9.3, where
      commit 65c3bf19 first appeared.
      
      Behavior has been more complex when the user provides both deprecated
      and non-deprecated settings.  Before commit 65c3bf19, libpq operated
      according to the first of these found:
      
        requiressl=1
        PGREQUIRESSL=1
        sslmode=*
        PGSSLMODE=*
      
      (Note requiressl=0 didn't override sslmode=*; it would only suppress
      PGREQUIRESSL=1 or a previous requiressl=1.  PGREQUIRESSL=0 had no effect
      whatsoever.)  Starting with commit 65c3bf19, libpq ignored PGREQUIRESSL,
      and order of precedence changed to this:
      
        last of requiressl=* or sslmode=*
        PGSSLMODE=*
      
      Starting now, adopt the following order of precedence:
      
        last of requiressl=* or sslmode=*
        PGSSLMODE=*
        PGREQUIRESSL=1
      
      This retains the 65c3bf19 behavior for connection strings that contain
      both requiressl=* and sslmode=*.  It retains the 65c3bf19 change that
      either connection string option overrides both environment variables.
      For the first time, PGSSLMODE has precedence over PGREQUIRESSL; this
      avoids reducing security of "PGREQUIRESSL=1 PGSSLMODE=verify-full"
      configurations originating under v9.3 and later.
      
      Daniel Gustafsson
      
      Security: CVE-2017-7485
      0170b10d
    • Bruce Momjian's avatar
      doc: add Simon Riggs to VACUUM VERBOSE PG 10 release note item · 74cadeaa
      Bruce Momjian authored
      Reported-by: Masahiko Sawada
      74cadeaa
    • Peter Eisentraut's avatar
      Add security checks to selectivity estimation functions · e2d4ef8d
      Peter Eisentraut authored
      Some selectivity estimation functions run user-supplied operators over
      data obtained from pg_statistic without security checks, which allows
      those operators to leak pg_statistic data without having privileges on
      the underlying tables.  Fix by checking that one of the following is
      satisfied: (1) the user has table or column privileges on the table
      underlying the pg_statistic data, or (2) the function implementing the
      user-supplied operator is leak-proof.  If neither is satisfied, planning
      will proceed as if there are no statistics available.
      
      At least one of these is satisfied in most cases in practice.  The only
      situations that are negatively impacted are user-defined or
      not-leak-proof operators on a security-barrier view.
      Reported-by: default avatarRobert Haas <robertmhaas@gmail.com>
      Author: Peter Eisentraut <peter_e@gmx.net>
      Author: Tom Lane <tgl@sss.pgh.pa.us>
      
      Security: CVE-2017-7484
      e2d4ef8d
    • Heikki Linnakangas's avatar
      Remove support for password_encryption='off' / 'plain'. · eb61136d
      Heikki Linnakangas authored
      Storing passwords in plaintext hasn't been a good idea for a very long
      time, if ever. Now seems like a good time to finally forbid it, since we're
      messing with this in PostgreSQL 10 anyway.
      
      Remove the CREATE/ALTER USER UNENCRYPTED PASSSWORD 'foo' syntax, since
      storing passwords unencrypted is no longer supported. ENCRYPTED PASSWORD
      'foo' is still accepted, but ENCRYPTED is now just a noise-word, it does
      the same as just PASSWORD 'foo'.
      
      Likewise, remove the --unencrypted option from createuser, but accept
      --encrypted as a no-op for backward compatibility. AFAICS, --encrypted was
      a no-op even before this patch, because createuser encrypted the password
      before sending it to the server even if --encrypted was not specified. It
      added the ENCRYPTED keyword to the SQL command, but since the password was
      already in encrypted form, it didn't make any difference. The documentation
      was not clear on whether that was intended or not, but it's moot now.
      
      Also, while password_encryption='on' is still accepted as an alias for
      'md5', it is now marked as hidden, so that it is not listed as an accepted
      value in error hints, for example. That's not directly related to removing
      'plain', but it seems better this way.
      
      Reviewed by Michael Paquier
      
      Discussion: https://www.postgresql.org/message-id/16e9b768-fd78-0b12-cfc1-7b6b7f238fde@iki.fi
      eb61136d
    • Simon Riggs's avatar
      Remove poorly worded and duplicated comment · 1f30295e
      Simon Riggs authored
      Move line of code to avoid need for duplicated comment
      
      Brought to attention by Masahiko Sawada
      1f30295e
  4. 07 May, 2017 10 commits
  5. 06 May, 2017 3 commits
  6. 05 May, 2017 4 commits
    • Tom Lane's avatar
      First-draft release notes for 9.6.3. · 54dbd4dc
      Tom Lane authored
      As usual, the release notes for other branches will be made by cutting
      these down, but put them up for community review first.  Note there
      are some entries that really only apply to pre-9.6 branches.
      54dbd4dc
    • Tom Lane's avatar
      Suppress compiler warning about unportable pointer value. · b3a47cdf
      Tom Lane authored
      Setting a pointer value to "0xdeadbeef" draws a warning from some
      compilers, and for good reason.  Be less cute and just set it to NULL.
      
      In passing make some other cosmetic adjustments nearby.
      
      Discussion: https://postgr.es/m/CAJrrPGdW3EkU-CRobvVKYf3fJuBdgWyuGeAbNzAQ4yBh+bfb_Q@mail.gmail.com
      b3a47cdf
    • Alvaro Herrera's avatar
      Allow MSVC to build with Tcl 8.6. · 14722c69
      Alvaro Herrera authored
      Commit eaba54c2 added support for Tcl 8.6 for configure-supported
      platforms after verifying that pltcl works without further changes, but
      the MSVC tooling wasn't updated accordingly.  Update MSVC to match,
      restructuring the code to avoid duplicating the logic for every Tcl
      version supported.
      
      Backpatch to all live branches, like eaba54c2.  In 9.4 and previous,
      change the patch to use backslashes rather than forward, as in the rest
      of the file.
      
      Reported by Paresh More, who also tested the patch I provided.
      Discussion: https://postgr.es/m/CAAgiCNGVw3ssBtSi3ZNstrz5k00ax=UV+_ZEHUeW_LMSGL2sew@mail.gmail.com
      14722c69
    • Peter Eisentraut's avatar
      Prevent panic during shutdown checkpoint · 086221cf
      Peter Eisentraut authored
      When the checkpointer writes the shutdown checkpoint, it checks
      afterwards whether any WAL has been written since it started and throws
      a PANIC if so.  At that point, only walsenders are still active, so one
      might think this could not happen, but walsenders can also generate WAL,
      for instance in BASE_BACKUP and certain variants of
      CREATE_REPLICATION_SLOT.  So they can trigger this panic if such a
      command is run while the shutdown checkpoint is being written.
      
      To fix this, divide the walsender shutdown into two phases.  First, the
      postmaster sends a SIGUSR2 signal to all walsenders.  The walsenders
      then put themselves into the "stopping" state.  In this state, they
      reject any new commands.  (For simplicity, we reject all new commands,
      so that in the future we do not have to track meticulously which
      commands might generate WAL.)  The checkpointer waits for all walsenders
      to reach this state before proceeding with the shutdown checkpoint.
      After the shutdown checkpoint is done, the postmaster sends
      SIGINT (previously unused) to the walsenders.  This triggers the
      existing shutdown behavior of sending out the shutdown checkpoint record
      and then terminating.
      
      Author: Michael Paquier <michael.paquier@gmail.com>
      Reported-by: default avatarFujii Masao <masao.fujii@gmail.com>
      086221cf