1. 14 5月, 2010 5 次提交
    • A
      Fix MSVC builds for recent plperl changes. Go back to version 8.2, which is · 06d09a51
      Andrew Dunstan 提交于
      where we started supporting MSVC builds.
      
      Security: CVE-2010-1169
      06d09a51
    • T
      Update release notes with security issues. · 405f02b0
      Tom Lane 提交于
      Security: CVE-2010-1169, CVE-2010-1170
      405f02b0
    • T
      Use an entity instead of non-ASCII letter. Thom Brown · 36b4b365
      Tom Lane 提交于
      36b4b365
    • T
      Prevent PL/Tcl from loading the "unknown" module from pltcl_modules unless · 6a358de1
      Tom Lane 提交于
      that is a regular table or view owned by a superuser.  This prevents a
      trojan horse attack whereby any unprivileged SQL user could create such a
      table and insert code into it that would then get executed in other users'
      sessions whenever they call pltcl functions.
      
      Worse yet, because the code was automatically loaded into both the "normal"
      and "safe" interpreters at first use, the attacker could execute unrestricted
      Tcl code in the "normal" interpreter without there being any pltclu functions
      anywhere, or indeed anyone else using pltcl at all: installing pltcl is
      sufficient to open the hole.  Change the initialization logic so that the
      "unknown" code is only loaded into an interpreter when the interpreter is
      first really used.  (That doesn't add any additional security in this
      particular context, but it seems a prudent change, and anyway the former
      behavior violated the principle of least astonishment.)
      
      Security: CVE-2010-1170
      6a358de1
    • A
      Abandon the use of Perl's Safe.pm to enforce restrictions in plperl, as it is · 58dd2648
      Andrew Dunstan 提交于
      fundamentally insecure. Instead apply an opmask to the whole interpreter that
      imposes restrictions on unsafe operations. These restrictions are much harder
      to subvert than is Safe.pm, since there is no container to be broken out of.
      Backported to release 7.4.
      
      In releases 7.4, 8.0 and 8.1 this also includes the necessary backporting of
      the two interpreters model for plperl and plperlu adopted in release 8.2.
      
      In versions 8.0 and up, the use of Perl's POSIX module to undo its locale
      mangling on Windows has become insecure with these changes, so it is
      replaced by our own routine, which is also faster.
      
      Nice side effects of the changes include that it is now possible to use perl's
      "strict" pragma in a natural way in plperl, and that perl's $a and
      $b variables now work as expected in sort routines, and that function
      compilation is significantly faster.
      
      Tim Bunce and Andrew Dunstan, with reviews from Alex Hunsaker and
      Alexey Klyukin.
      
      Security: CVE-2010-1169
      58dd2648
  2. 13 5月, 2010 3 次提交
  3. 12 5月, 2010 3 次提交
  4. 11 5月, 2010 1 次提交
  5. 09 5月, 2010 1 次提交
    • T
      Work around a subtle portability problem in use of printf %s format. · db01ccc0
      Tom Lane 提交于
      Depending on which spec you read, field widths and precisions in %s may be
      counted either in bytes or characters.  Our code was assuming bytes, which
      is wrong at least for glibc's implementation, and in any case libc might
      have a different idea of the prevailing encoding than we do.  Hence, for
      portable results we must avoid using anything more complex than just "%s"
      unless the string to be printed is known to be all-ASCII.
      
      This patch fixes the cases I could find, including the psql formatting
      failure reported by Hernan Gonzalez.  In HEAD only, I also added comments
      to some places where it appears safe to continue using "%.*s".
      db01ccc0
  6. 06 5月, 2010 1 次提交
    • T
      Fix psql to not go into infinite recursion when expanding a variable that · 944cae5f
      Tom Lane 提交于
      refers to itself (directly or indirectly).  Instead, print a message when
      recursion is detected, and don't expand the repeated reference.  Per bug
      #5448 from Francis Markham.
      
      Back-patch to 8.0.  Although the issue exists in 7.4 as well, it seems
      impractical to fix there because of the lack of any state stack that
      could be used to track active expansions.
      944cae5f
  7. 05 5月, 2010 1 次提交
  8. 02 5月, 2010 1 次提交
    • T
      Add code to InternalIpcMemoryCreate() to handle the case where shmget() · 5b6a6962
      Tom Lane 提交于
      returns EINVAL for an existing shared memory segment.  Although it's not
      terribly sensible, that behavior does meet the POSIX spec because EINVAL
      is the appropriate error code when the existing segment is smaller than the
      requested size, and the spec explicitly disclaims any particular ordering of
      error checks.  Moreover, it does in fact happen on OS X and probably other
      BSD-derived kernels.  (We were able to talk NetBSD into changing their code,
      but purging that behavior from the wild completely seems unlikely to happen.)
      We need to distinguish collision with a pre-existing segment from invalid size
      request in order to behave sensibly, so it's worth some extra code here to get
      it right.  Per report from Gavin Kistner and subsequent investigation.
      
      Back-patch to all supported versions, since any of them could get used
      with a kernel having the debatable behavior.
      5b6a6962
  9. 01 5月, 2010 1 次提交
    • T
      Fix multiple memory leaks in PLy_spi_execute_fetch_result: it would leak · 80dc8a8f
      Tom Lane 提交于
      memory if the result had zero rows, and also if there was any sort of error
      while converting the result tuples into Python data.  Reported and partially
      fixed by Andres Freund.
      
      Back-patch to all supported versions.  Note: I haven't tested the 7.4 fix.
      7.4's configure check for python is so obsolete it doesn't work on my
      current machines :-(.  The logic change is pretty straightforward though.
      80dc8a8f
  10. 19 4月, 2010 1 次提交
    • R
      Provide better guidance for adjusting shared_buffers. · 750503ce
      Robert Haas 提交于
      This change was previously committed to HEAD, but the consensus seems to be
      in favor of back-patching it.  I'm only backpatching as far as 8.3.X, however,
      because it's not clear to me to what degree this advice applies to older
      branches, and in any case our first advice to anyone attempting to tune those
      versions is likely to be "upgrade".
      750503ce
  11. 16 4月, 2010 3 次提交
  12. 15 4月, 2010 1 次提交
    • T
      Fix a problem introduced by my patch of 2010-01-12 that revised the way · 32616fb1
      Tom Lane 提交于
      relcache reload works.  In the patched code, a relcache entry in process of
      being rebuilt doesn't get unhooked from the relcache hash table; which means
      that if a cache flush occurs due to sinval queue overrun while we're
      rebuilding it, the entry could get blown away by RelationCacheInvalidate,
      resulting in crash or misbehavior.  Fix by ensuring that an entry being
      rebuilt has positive refcount, so it won't be seen as a target for removal
      if a cache flush occurs.  (This will mean that the entry gets rebuilt twice
      in such a scenario, but that's okay.)  It appears that the problem can only
      arise within a transaction that has previously reassigned the relfilenode of
      a pre-existing table, via TRUNCATE or a similar operation.  Per bug #5412
      from Rusty Conover.
      
      Back-patch to 8.2, same as the patch that introduced the problem.
      I think that the failure can't actually occur in 8.2, since it lacks the
      rd_newRelfilenodeSubid optimization, but let's make it work like the later
      branches anyway.
      
      Patch by Heikki, slightly editorialized on by me.
      32616fb1
  13. 09 4月, 2010 2 次提交
  14. 08 4月, 2010 1 次提交
  15. 07 4月, 2010 1 次提交
  16. 04 4月, 2010 1 次提交
  17. 03 4月, 2010 1 次提交
  18. 02 4月, 2010 1 次提交
    • H
      Don't pass an invalid file handle to dup2(). That causes a crash on · 292934de
      Heikki Linnakangas 提交于
      Windows, thanks to a feature in CRT called Parameter Validation.
      
      Backpatch to 8.2, which is the oldest version supported on Windows. In
      8.2 and 8.3 also backpatch the earlier change to use DEVNULL instead of
      NULL_DEV #define for a /dev/null-like device. NULL_DEV was hard-coded to
      "/dev/null" regardless of platform, which didn't work on Windows, while
      DEVNULL works on all platforms. Restarting syslogger didn't work on
      Windows on versions 8.3 and below because of that.
      292934de
  19. 25 3月, 2010 2 次提交
  20. 20 3月, 2010 1 次提交
    • T
      Clear error_context_stack and debug_query_string at the beginning of proc_exit, · e1eb7c81
      Tom Lane 提交于
      so that we won't try to attach any context printouts to messages that get
      emitted while exiting.  Per report from Dennis Koegel, the context functions
      won't necessarily work after we've started shutting down the backend, and it
      seems possible that debug_query_string could be pointing at freed storage
      as well.  The context information doesn't seem particularly relevant to
      such messages anyway, so there's little lost by suppressing it.
      
      Back-patch to all supported branches.  I can only demonstrate a crash with
      log_disconnections messages back to 8.1, but the risk seems real in 8.0 and
      before anyway.
      e1eb7c81
  21. 18 3月, 2010 1 次提交
  22. 12 3月, 2010 1 次提交
  23. 10 3月, 2010 2 次提交
  24. 09 3月, 2010 2 次提交
  25. 08 3月, 2010 2 次提交