Bug 234879 - databases/postgresql10-server: Add 'promote' as a command to rc.d script
Summary: databases/postgresql10-server: Add 'promote' as a command to rc.d script
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: pgsql
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-11 18:53 UTC by Trix Farrar
Modified: 2019-05-13 10:58 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (pgsql)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Trix Farrar 2019-01-11 18:53:11 UTC
In /usr/local/etc/rc.d/postgresql, adding a line:

promote_cmd="postgresql_command promote"

would allow scripts, like from databases/pgpool-II-40, to use the service(8) command to promote a replica rather than calling pg_ctl(1) directly and having to know the values of variables postgresql_data, etc.

The rc script already supports most of the other commonly used pg_ctl(1) commands.
Comment 1 Palle Girgensohn freebsd_committer 2019-01-12 14:13:05 UTC
Good idea! Thanks, I will look into it!
Comment 2 Palle Girgensohn freebsd_committer 2019-05-09 22:32:30 UTC
Committed. Thanks!
Comment 3 commit-hook freebsd_committer 2019-05-09 22:32:58 UTC
A commit references this bug:

Author: girgen
Date: Thu May  9 22:32:14 UTC 2019
New revision: 501149
URL: https://svnweb.freebsd.org/changeset/ports/501149

Log:
  The PostgreSQL Global Development Group has released an update to all
  supported versions of our database system, including 11.3, 10.8, 9.6.13,
  9.5.17, and 9.4.22. This release fixes two security issues in the
  PostgreSQL server, a security issue found in two of the PostgreSQL
  Windows installers, and over 60 bugs reported over the last three months.

  Security:	CVE-2019-10129: Memory disclosure in partition routing

  Prior to this release, a user running PostgreSQL 11 can read arbitrary
  bytes of server memory by executing a purpose-crafted INSERT statement
  to a partitioned table.

  Security:	CVE-2019-10130: Selectivity estimators bypass row security policies

  PostgreSQL maintains statistics for tables by sampling data available in
  columns; this data is consulted during the query planning process. Prior
  to this release, a user able to execute SQL queries with permissions to
  read a given column could craft a leaky operator that could read
  whatever data had been sampled from that column.  If this happened to
  include values from rows that the user is forbidden to see by a row
  security policy, the user could effectively bypass the policy.  This is
  fixed by only allowing a non-leakproof operator to use this data if
  there are no relevant row security policies for the table.

  This issue is present in PostgreSQL 9.5, 9.6, 10, and 11. The PostgreSQL
  project thanks Dean Rasheed for reporting this problem.

  Also fix a FreeBSD port problem with LLVM [1] and add promote command
  to `service postgresql` [2]

  PR:	236100, 234879
  Submitted by:	tomonori.usaka@ubin.jp [1], Trix Farrar [2]

Changes:
  head/databases/postgresql10-server/Makefile
  head/databases/postgresql10-server/distinfo
  head/databases/postgresql10-server/files/postgresql.in
  head/databases/postgresql10-server/pkg-plist-server
  head/databases/postgresql11-server/Makefile
  head/databases/postgresql11-server/distinfo
  head/databases/postgresql11-server/files/postgresql.in
  head/databases/postgresql11-server/pkg-plist-server
  head/databases/postgresql94-server/Makefile
  head/databases/postgresql94-server/distinfo
  head/databases/postgresql94-server/files/postgresql.in
  head/databases/postgresql95-server/Makefile
  head/databases/postgresql95-server/distinfo
  head/databases/postgresql95-server/files/postgresql.in
  head/databases/postgresql96-server/Makefile
  head/databases/postgresql96-server/distinfo
  head/databases/postgresql96-server/files/postgresql.in
Comment 4 commit-hook freebsd_committer 2019-05-13 10:58:29 UTC
A commit references this bug:

Author: girgen
Date: Mon May 13 10:57:32 UTC 2019
New revision: 501551
URL: https://svnweb.freebsd.org/changeset/ports/501551

Log:
  MFH: r501149

  The PostgreSQL Global Development Group has released an update to all
  supported versions of our database system, including 11.3, 10.8, 9.6.13,
  9.5.17, and 9.4.22. This release fixes two security issues in the
  PostgreSQL server, a security issue found in two of the PostgreSQL
  Windows installers, and over 60 bugs reported over the last three months.

  Security:	CVE-2019-10129: Memory disclosure in partition routing

  Prior to this release, a user running PostgreSQL 11 can read arbitrary
  bytes of server memory by executing a purpose-crafted INSERT statement
  to a partitioned table.

  Security:	CVE-2019-10130: Selectivity estimators bypass row security policies

  PostgreSQL maintains statistics for tables by sampling data available in
  columns; this data is consulted during the query planning process. Prior
  to this release, a user able to execute SQL queries with permissions to
  read a given column could craft a leaky operator that could read
  whatever data had been sampled from that column.  If this happened to
  include values from rows that the user is forbidden to see by a row
  security policy, the user could effectively bypass the policy.  This is
  fixed by only allowing a non-leakproof operator to use this data if
  there are no relevant row security policies for the table.

  This issue is present in PostgreSQL 9.5, 9.6, 10, and 11. The PostgreSQL
  project thanks Dean Rasheed for reporting this problem.

  Also fix a FreeBSD port problem with LLVM [1] and add promote command
  to `service postgresql` [2]

  PR:	236100, 234879
  Submitted by:	tomonori.usaka@ubin.jp [1], Trix Farrar [2]

  Approved by:	ports-secteam (joneum)

Changes:
_U  branches/2019Q2/
  branches/2019Q2/databases/postgresql10-server/Makefile
  branches/2019Q2/databases/postgresql10-server/distinfo
  branches/2019Q2/databases/postgresql10-server/files/postgresql.in
  branches/2019Q2/databases/postgresql10-server/pkg-plist-server
  branches/2019Q2/databases/postgresql11-server/Makefile
  branches/2019Q2/databases/postgresql11-server/distinfo
  branches/2019Q2/databases/postgresql11-server/files/postgresql.in
  branches/2019Q2/databases/postgresql11-server/pkg-plist-server
  branches/2019Q2/databases/postgresql94-server/Makefile
  branches/2019Q2/databases/postgresql94-server/distinfo
  branches/2019Q2/databases/postgresql94-server/files/postgresql.in
  branches/2019Q2/databases/postgresql95-server/Makefile
  branches/2019Q2/databases/postgresql95-server/distinfo
  branches/2019Q2/databases/postgresql95-server/files/postgresql.in
  branches/2019Q2/databases/postgresql96-server/Makefile
  branches/2019Q2/databases/postgresql96-server/distinfo
  branches/2019Q2/databases/postgresql96-server/files/postgresql.in