[COMMITTERS] pgsql: Do ScalarArrayOp estimation correctly when array is a stable exp

2014-02-21 Thread Tom Lane
Do ScalarArrayOp estimation correctly when array is a stable expression. Most estimation functions apply estimate_expression_value to see if they can reduce an expression to a constant; the key difference is that it allows evaluation of stable as well as immutable functions in hopes of ending up w

[COMMITTERS] pgsql: Do ScalarArrayOp estimation correctly when array is a stable exp

2014-02-21 Thread Tom Lane
Do ScalarArrayOp estimation correctly when array is a stable expression. Most estimation functions apply estimate_expression_value to see if they can reduce an expression to a constant; the key difference is that it allows evaluation of stable as well as immutable functions in hopes of ending up w

[COMMITTERS] pgsql: Fix handling of wide datetime input/output.

2014-02-21 Thread Noah Misch
Fix handling of wide datetime input/output. Many server functions use the MAXDATELEN constant to size a buffer for parsing or displaying a datetime value. It was much too small for the longest possible interval output and slightly too small for certain valid timestamp input, particularly input wi

[COMMITTERS] pgsql: Shore up ADMIN OPTION restrictions.

2014-02-21 Thread Noah Misch
Shore up ADMIN OPTION restrictions. Granting a role without ADMIN OPTION is supposed to prevent the grantee from adding or removing members from the granted role. Issuing SET ROLE before the GRANT bypassed that, because the role itself had an implicit right to add or remove members. Plug that ho

[COMMITTERS] pgsql: Predict integer overflow to avoid buffer overruns.

2014-02-21 Thread Noah Misch
Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size such that the calculation wrapped to a small positive value when arguments implied a sufficiently-large requirement. Writes past the end of the inadvertent small alloca

[COMMITTERS] pgsql: Fix handling of wide datetime input/output.

2014-02-21 Thread Noah Misch
Fix handling of wide datetime input/output. Many server functions use the MAXDATELEN constant to size a buffer for parsing or displaying a datetime value. It was much too small for the longest possible interval output and slightly too small for certain valid timestamp input, particularly input wi

[COMMITTERS] pgsql: Predict integer overflow to avoid buffer overruns.

2014-02-21 Thread Noah Misch
Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size such that the calculation wrapped to a small positive value when arguments implied a sufficiently-large requirement. Writes past the end of the inadvertent small alloca

[COMMITTERS] pgsql: Last-minute updates for release notes.

2014-02-21 Thread Tom Lane
Last-minute updates for release notes. Add entries for security issues. Security: CVE-2014-0060 through CVE-2014-0067 Branch -- REL9_1_STABLE Details --- http://git.postgresql.org/pg/commitdiff/c09f340eb35bdfcbecf4606a7fcbd6369c4bb9e0 Modified Files -- doc/src/sgml/release-

[COMMITTERS] pgsql: Last-minute updates for release notes.

2014-02-21 Thread Tom Lane
Last-minute updates for release notes. Add entries for security issues. Security: CVE-2014-0060 through CVE-2014-0067 Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/7b1fab3fd2e17063fb1ec98e8ff5512a6b3da9b6 Modified Files -- doc/src/sgml/release-8.4.sgm

[COMMITTERS] pgsql: Prevent privilege escalation in explicit calls to PL validators.

2014-02-21 Thread Noah Misch
Prevent privilege escalation in explicit calls to PL validators. The primary role of PL validators is to be called implicitly during CREATE FUNCTION, but they are also normal functions that a user can call explicitly. Add a permissions check to each validator to ensure that a user cannot use expl

[COMMITTERS] pgsql: Document risks of "make check" in the regression testing instruc

2014-02-21 Thread Tom Lane
Document risks of "make check" in the regression testing instructions. Since the temporary server started by "make check" uses "trust" authentication, another user on the same machine could connect to it as database superuser, and then potentially exploit the privileges of the operating-system use

[COMMITTERS] pgsql: Predict integer overflow to avoid buffer overruns.

2014-02-21 Thread Noah Misch
Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size such that the calculation wrapped to a small positive value when arguments implied a sufficiently-large requirement. Writes past the end of the inadvertent small alloca

[COMMITTERS] pgsql: Last-minute updates for release notes.

2014-02-21 Thread Tom Lane
Last-minute updates for release notes. Add entries for security issues. Security: CVE-2014-0060 through CVE-2014-0067 Branch -- REL9_2_STABLE Details --- http://git.postgresql.org/pg/commitdiff/4bde115e7e5177abcee018b136716e69f90738b5 Modified Files -- doc/src/sgml/release-

[COMMITTERS] pgsql: Last-minute updates for release notes.

2014-02-21 Thread Tom Lane
Last-minute updates for release notes. Add entries for security issues. Security: CVE-2014-0060 through CVE-2014-0067 Branch -- REL8_4_STABLE Details --- http://git.postgresql.org/pg/commitdiff/56e55cfd265a5e675e99fb67b0d55d78e018076c Modified Files -- doc/src/sgml/release-

[COMMITTERS] pgsql: Prevent potential overruns of fixed-size buffers.

2014-02-21 Thread Tom Lane
Prevent potential overruns of fixed-size buffers. Coverity identified a number of places in which it couldn't prove that a string being copied into a fixed-size buffer would fit. We believe that most, perhaps all of these are in fact safe, or are copying data that is coming from a trusted source

[COMMITTERS] pgsql: Document risks of "make check" in the regression testing instruc

2014-02-21 Thread Tom Lane
Document risks of "make check" in the regression testing instructions. Since the temporary server started by "make check" uses "trust" authentication, another user on the same machine could connect to it as database superuser, and then potentially exploit the privileges of the operating-system use

[COMMITTERS] pgsql: Document risks of "make check" in the regression testing instruc

2014-02-21 Thread Tom Lane
Document risks of "make check" in the regression testing instructions. Since the temporary server started by "make check" uses "trust" authentication, another user on the same machine could connect to it as database superuser, and then potentially exploit the privileges of the operating-system use

[COMMITTERS] pgsql: Document risks of "make check" in the regression testing instruc

2014-02-21 Thread Tom Lane
Document risks of "make check" in the regression testing instructions. Since the temporary server started by "make check" uses "trust" authentication, another user on the same machine could connect to it as database superuser, and then potentially exploit the privileges of the operating-system use

[COMMITTERS] pgsql: Prevent potential overruns of fixed-size buffers.

2014-02-21 Thread Tom Lane
Prevent potential overruns of fixed-size buffers. Coverity identified a number of places in which it couldn't prove that a string being copied into a fixed-size buffer would fit. We believe that most, perhaps all of these are in fact safe, or are copying data that is coming from a trusted source

[COMMITTERS] pgsql: Document risks of "make check" in the regression testing instruc

2014-02-21 Thread Tom Lane
Document risks of "make check" in the regression testing instructions. Since the temporary server started by "make check" uses "trust" authentication, another user on the same machine could connect to it as database superuser, and then potentially exploit the privileges of the operating-system use

[COMMITTERS] pgsql: Prevent potential overruns of fixed-size buffers.

2014-02-21 Thread Tom Lane
Prevent potential overruns of fixed-size buffers. Coverity identified a number of places in which it couldn't prove that a string being copied into a fixed-size buffer would fit. We believe that most, perhaps all of these are in fact safe, or are copying data that is coming from a trusted source

[COMMITTERS] pgsql: Document risks of "make check" in the regression testing instruc

2014-02-21 Thread Tom Lane
Document risks of "make check" in the regression testing instructions. Since the temporary server started by "make check" uses "trust" authentication, another user on the same machine could connect to it as database superuser, and then potentially exploit the privileges of the operating-system use

[COMMITTERS] pgsql: Prevent potential overruns of fixed-size buffers.

2014-02-21 Thread Tom Lane
Prevent potential overruns of fixed-size buffers. Coverity identified a number of places in which it couldn't prove that a string being copied into a fixed-size buffer would fit. We believe that most, perhaps all of these are in fact safe, or are copying data that is coming from a trusted source

[COMMITTERS] pgsql: Prevent potential overruns of fixed-size buffers.

2014-02-21 Thread Tom Lane
Prevent potential overruns of fixed-size buffers. Coverity identified a number of places in which it couldn't prove that a string being copied into a fixed-size buffer would fit. We believe that most, perhaps all of these are in fact safe, or are copying data that is coming from a trusted source

[COMMITTERS] pgsql: Last-minute updates for release notes.

2014-02-21 Thread Tom Lane
Last-minute updates for release notes. Add entries for security issues. Security: CVE-2014-0060 through CVE-2014-0067 Branch -- REL9_3_STABLE Details --- http://git.postgresql.org/pg/commitdiff/4239753338c8ef36d26615beb9b567bdd1814f73 Modified Files -- doc/src/sgml/release-

[COMMITTERS] pgsql: Last-minute updates for release notes.

2014-02-21 Thread Tom Lane
Last-minute updates for release notes. Add entries for security issues. Security: CVE-2014-0060 through CVE-2014-0067 Branch -- REL9_0_STABLE Details --- http://git.postgresql.org/pg/commitdiff/8f979e789347d3dec15d020945a7c6e1b416f759 Modified Files -- doc/src/sgml/release-

[COMMITTERS] pgsql: Shore up ADMIN OPTION restrictions.

2014-02-21 Thread Noah Misch
Shore up ADMIN OPTION restrictions. Granting a role without ADMIN OPTION is supposed to prevent the grantee from adding or removing members from the granted role. Issuing SET ROLE before the GRANT bypassed that, because the role itself had an implicit right to add or remove members. Plug that ho

[COMMITTERS] pgsql: Avoid repeated name lookups during table and index DDL.

2014-02-21 Thread Robert Haas
Avoid repeated name lookups during table and index DDL. If the name lookups come to different conclusions due to concurrent activity, we might perform some parts of the DDL on a different table than other parts. At least in the case of CREATE INDEX, this can be used to cause the permissions check

[COMMITTERS] pgsql: Prevent privilege escalation in explicit calls to PL validators.

2014-02-21 Thread Noah Misch
Prevent privilege escalation in explicit calls to PL validators. The primary role of PL validators is to be called implicitly during CREATE FUNCTION, but they are also normal functions that a user can call explicitly. Add a permissions check to each validator to ensure that a user cannot use expl

[COMMITTERS] pgsql: Fix handling of wide datetime input/output.

2014-02-21 Thread Noah Misch
Fix handling of wide datetime input/output. Many server functions use the MAXDATELEN constant to size a buffer for parsing or displaying a datetime value. It was much too small for the longest possible interval output and slightly too small for certain valid timestamp input, particularly input wi

[COMMITTERS] pgsql: Fix handling of wide datetime input/output.

2014-02-21 Thread Noah Misch
Fix handling of wide datetime input/output. Many server functions use the MAXDATELEN constant to size a buffer for parsing or displaying a datetime value. It was much too small for the longest possible interval output and slightly too small for certain valid timestamp input, particularly input wi

[COMMITTERS] pgsql: Avoid repeated name lookups during table and index DDL.

2014-02-21 Thread Robert Haas
Avoid repeated name lookups during table and index DDL. If the name lookups come to different conclusions due to concurrent activity, we might perform some parts of the DDL on a different table than other parts. At least in the case of CREATE INDEX, this can be used to cause the permissions check

[COMMITTERS] pgsql: Prevent privilege escalation in explicit calls to PL validators.

2014-02-21 Thread Noah Misch
Prevent privilege escalation in explicit calls to PL validators. The primary role of PL validators is to be called implicitly during CREATE FUNCTION, but they are also normal functions that a user can call explicitly. Add a permissions check to each validator to ensure that a user cannot use expl

[COMMITTERS] pgsql: Predict integer overflow to avoid buffer overruns.

2014-02-21 Thread Noah Misch
Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size such that the calculation wrapped to a small positive value when arguments implied a sufficiently-large requirement. Writes past the end of the inadvertent small alloca

[COMMITTERS] pgsql: Shore up ADMIN OPTION restrictions.

2014-02-21 Thread Noah Misch
Shore up ADMIN OPTION restrictions. Granting a role without ADMIN OPTION is supposed to prevent the grantee from adding or removing members from the granted role. Issuing SET ROLE before the GRANT bypassed that, because the role itself had an implicit right to add or remove members. Plug that ho

[COMMITTERS] pgsql: Shore up ADMIN OPTION restrictions.

2014-02-21 Thread Noah Misch
Shore up ADMIN OPTION restrictions. Granting a role without ADMIN OPTION is supposed to prevent the grantee from adding or removing members from the granted role. Issuing SET ROLE before the GRANT bypassed that, because the role itself had an implicit right to add or remove members. Plug that ho

[COMMITTERS] pgsql: Avoid repeated name lookups during table and index DDL.

2014-02-21 Thread Robert Haas
Avoid repeated name lookups during table and index DDL. If the name lookups come to different conclusions due to concurrent activity, we might perform some parts of the DDL on a different table than other parts. At least in the case of CREATE INDEX, this can be used to cause the permissions check

[COMMITTERS] pgsql: Prevent privilege escalation in explicit calls to PL validators.

2014-02-21 Thread Noah Misch
Prevent privilege escalation in explicit calls to PL validators. The primary role of PL validators is to be called implicitly during CREATE FUNCTION, but they are also normal functions that a user can call explicitly. Add a permissions check to each validator to ensure that a user cannot use expl

[COMMITTERS] pgsql: Predict integer overflow to avoid buffer overruns.

2014-02-21 Thread Noah Misch
Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size such that the calculation wrapped to a small positive value when arguments implied a sufficiently-large requirement. Writes past the end of the inadvertent small alloca

[COMMITTERS] pgsql: Avoid repeated name lookups during table and index DDL.

2014-02-21 Thread Robert Haas
Avoid repeated name lookups during table and index DDL. If the name lookups come to different conclusions due to concurrent activity, we might perform some parts of the DDL on a different table than other parts. At least in the case of CREATE INDEX, this can be used to cause the permissions check

[COMMITTERS] pgsql: Prevent privilege escalation in explicit calls to PL validators.

2014-02-21 Thread Noah Misch
Prevent privilege escalation in explicit calls to PL validators. The primary role of PL validators is to be called implicitly during CREATE FUNCTION, but they are also normal functions that a user can call explicitly. Add a permissions check to each validator to ensure that a user cannot use expl

[COMMITTERS] pgsql: Fix handling of wide datetime input/output.

2014-02-21 Thread Noah Misch
Fix handling of wide datetime input/output. Many server functions use the MAXDATELEN constant to size a buffer for parsing or displaying a datetime value. It was much too small for the longest possible interval output and slightly too small for certain valid timestamp input, particularly input wi

[COMMITTERS] pgsql: Prevent potential overruns of fixed-size buffers.

2014-02-21 Thread Tom Lane
Prevent potential overruns of fixed-size buffers. Coverity identified a number of places in which it couldn't prove that a string being copied into a fixed-size buffer would fit. We believe that most, perhaps all of these are in fact safe, or are copying data that is coming from a trusted source

[COMMITTERS] pgsql: Shore up ADMIN OPTION restrictions.

2014-02-21 Thread Noah Misch
Shore up ADMIN OPTION restrictions. Granting a role without ADMIN OPTION is supposed to prevent the grantee from adding or removing members from the granted role. Issuing SET ROLE before the GRANT bypassed that, because the role itself had an implicit right to add or remove members. Plug that ho

[COMMITTERS] pgsql: Avoid repeated name lookups during table and index DDL.

2014-02-21 Thread Robert Haas
Avoid repeated name lookups during table and index DDL. If the name lookups come to different conclusions due to concurrent activity, we might perform some parts of the DDL on a different table than other parts. At least in the case of CREATE INDEX, this can be used to cause the permissions check

[COMMITTERS] pgsql: Predict integer overflow to avoid buffer overruns.

2014-02-21 Thread Noah Misch
Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size such that the calculation wrapped to a small positive value when arguments implied a sufficiently-large requirement. Writes past the end of the inadvertent small alloca

[COMMITTERS] pgsql: Avoid repeated name lookups during table and index DDL.

2014-02-21 Thread Robert Haas
Avoid repeated name lookups during table and index DDL. If the name lookups come to different conclusions due to concurrent activity, we might perform some parts of the DDL on a different table than other parts. At least in the case of CREATE INDEX, this can be used to cause the permissions check

[COMMITTERS] pgsql: Fix handling of wide datetime input/output.

2014-02-21 Thread Noah Misch
Fix handling of wide datetime input/output. Many server functions use the MAXDATELEN constant to size a buffer for parsing or displaying a datetime value. It was much too small for the longest possible interval output and slightly too small for certain valid timestamp input, particularly input wi

[COMMITTERS] pgsql: Shore up ADMIN OPTION restrictions.

2014-02-21 Thread Noah Misch
Shore up ADMIN OPTION restrictions. Granting a role without ADMIN OPTION is supposed to prevent the grantee from adding or removing members from the granted role. Issuing SET ROLE before the GRANT bypassed that, because the role itself had an implicit right to add or remove members. Plug that ho

[COMMITTERS] pgsql: Prevent privilege escalation in explicit calls to PL validators.

2014-02-21 Thread Noah Misch
Prevent privilege escalation in explicit calls to PL validators. The primary role of PL validators is to be called implicitly during CREATE FUNCTION, but they are also normal functions that a user can call explicitly. Add a permissions check to each validator to ensure that a user cannot use expl

[COMMITTERS] pgsql: Avoid integer overflow in hstore_to_json().

2014-02-21 Thread Heikki Linnakangas
Avoid integer overflow in hstore_to_json(). The length of the output buffer was calculated based on the size of the argument hstore. On a sizeof(int) == 4 platform and a huge argument, it could overflow, causing a too small buffer to be allocated. Refactor the function to use a StringInfo instead