~ubuntu-branches/ubuntu/trusty/postgresql-9.3/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/patches/60-pg_regress_socketdir.patch

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-07-24 16:13:59 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20140724161359-uk325qfv03euxuuh
Tags: 9.3.5-0ubuntu0.14.04.1
* New upstream bug fix release: (LP: #1348176)
  - pg_upgrade: Users who upgraded to version 9.3 using pg_upgrade may have
    an issue with transaction information which causes VACUUM to eventually
    fail. These users should run the script provided in the release notes to
    determine if their installation is affected, and then take the remedy
    steps outlined there.
  - Various data integrity and other bug fixes.
  - Secure Unix-domain sockets of temporary postmasters started during make
    check.
    Any local user able to access the socket file could connect as the
    server's bootstrap superuser, then proceed to execute arbitrary code as
    the operating-system user running the test, as we previously noted in
    CVE-2014-0067. This change defends against that risk by placing the
    server's socket in a temporary, mode 0700 subdirectory of /tmp.
  - See release notes for details:
    http://www.postgresql.org/about/news/1534/
* Remove pg_regress patches to support --host=/path, obsolete with above
  upstream changes and not applicable any more.
* Drop tcl8.6 patch, applied upstream.
* Add missing logrotate test dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
2
 
index 1980fd6..683d4c6 100644
3
 
--- a/src/test/regress/pg_regress.c
4
 
+++ b/src/test/regress/pg_regress.c
5
 
@@ -835,6 +835,7 @@ initialize_environment(void)
6
 
        {
7
 
                const char *pghost;
8
 
                const char *pgport;
9
 
+               char       pgportstr[32];
10
 
 
11
 
                /*
12
 
                 * When testing an existing install, we honor existing environment
13
 
@@ -865,14 +866,18 @@ initialize_environment(void)
14
 
                        pghost = "localhost";
15
 
 #endif
16
 
 
17
 
-               if (pghost && pgport)
18
 
-                       printf(_("(using postmaster on %s, port %s)\n"), pghost, pgport);
19
 
-               if (pghost && !pgport)
20
 
-                       printf(_("(using postmaster on %s, default port)\n"), pghost);
21
 
-               if (!pghost && pgport)
22
 
-                       printf(_("(using postmaster on Unix socket, port %s)\n"), pgport);
23
 
-               if (!pghost && !pgport)
24
 
-                       printf(_("(using postmaster on Unix socket, default port)\n"));
25
 
+               /* Precompute the "port xxx" part so we don't have 6 printf()s below */
26
 
+               if (pgport)
27
 
+                       snprintf(pgportstr, sizeof(pgportstr), _("port %s"), pgport);
28
 
+               else
29
 
+                       snprintf(pgportstr, sizeof(pgportstr), _("default port"));
30
 
+
31
 
+               if (pghost && *pghost != '/')
32
 
+                       printf(_("(using postmaster on %s, %s)\n"), pghost, pgportstr);
33
 
+               else if (pghost)
34
 
+                       printf(_("(using postmaster on Unix socket %s, %s)\n"), pghost, pgportstr);
35
 
+               else
36
 
+                       printf(_("(using postmaster on Unix socket, %s)\n"), pgportstr);
37
 
        }
38
 
 
39
 
        convert_sourcefiles();
40
 
@@ -2246,7 +2251,9 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
41
 
                 */
42
 
                header(_("starting postmaster"));
43
 
                snprintf(buf, sizeof(buf),
44
 
-                                SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s -c \"listen_addresses=%s\" > \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE,
45
 
+                                hostname && *hostname == '/'
46
 
+                                        ? SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s -k \"%s\" > \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE
47
 
+                                        : SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s -c \"listen_addresses=%s\" > \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE,
48
 
                                 bindir, temp_install,
49
 
                                 debug ? " -d 5" : "",
50
 
                                 hostname ? hostname : "",