about summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorOliver Charles <ollie@ocharles.org.uk>2013-06-27 14:08:42 +0100
committerOliver Charles <ollie@ocharles.org.uk>2013-06-27 14:09:39 +0100
commit912a825d1e9c41d596e43d7440667a1882a0cb6d (patch)
tree23c321acfbd307eba615540ef71d2a557e12bcb0 /pkgs/servers
parentb38308553b00424bf859f8c60699c4a5c044f3f6 (diff)
downloadnixlib-912a825d1e9c41d596e43d7440667a1882a0cb6d.tar
nixlib-912a825d1e9c41d596e43d7440667a1882a0cb6d.tar.gz
nixlib-912a825d1e9c41d596e43d7440667a1882a0cb6d.tar.bz2
nixlib-912a825d1e9c41d596e43d7440667a1882a0cb6d.tar.lz
nixlib-912a825d1e9c41d596e43d7440667a1882a0cb6d.tar.xz
nixlib-912a825d1e9c41d596e43d7440667a1882a0cb6d.tar.zst
nixlib-912a825d1e9c41d596e43d7440667a1882a0cb6d.zip
Disable exec symlink resolution for PostgreSQL 9.2
When building PostgreSQL with plugins under NixOS, NixOS will create a
postgresql-and-plugins directory which symlinks PostgreSQL and all the plugins
into a single directory. Unfortunately, the plugins will not actually be usable
by PostgreSQL because it will still try and locate them in the original
PostgreSQL share directory, not postgresql-and-plugins.

In this commit, I have patched resolve_symlinks to always return success, which
matches the behavior if HAVE_READLINK is false (so presumably invalid paths are
never passed to this function).
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/sql/postgresql/9.2.x.nix2
-rw-r--r--pkgs/servers/sql/postgresql/disable-resolve_symlinks.patch14
2 files changed, 16 insertions, 0 deletions
diff --git a/pkgs/servers/sql/postgresql/9.2.x.nix b/pkgs/servers/sql/postgresql/9.2.x.nix
index 46a6aa0c032c..ada8ee7a4f3e 100644
--- a/pkgs/servers/sql/postgresql/9.2.x.nix
+++ b/pkgs/servers/sql/postgresql/9.2.x.nix
@@ -16,6 +16,8 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "world" ];
 
+  patches = [ ./disable-resolve_symlinks.patch ];
+
   installTargets = [ "install-world" ];
 
   LC_ALL = "C";
diff --git a/pkgs/servers/sql/postgresql/disable-resolve_symlinks.patch b/pkgs/servers/sql/postgresql/disable-resolve_symlinks.patch
new file mode 100644
index 000000000000..3e6fd5e838a2
--- /dev/null
+++ b/pkgs/servers/sql/postgresql/disable-resolve_symlinks.patch
@@ -0,0 +1,14 @@
+diff --git a/src/port/exec.c b/src/port/exec.c
+index c79e8ba..42c4091 100644
+--- a/src/port/exec.c
++++ b/src/port/exec.c
+@@ -216,6 +216,9 @@ find_my_exec(const char *argv0, char *retpath)
+ static int
+ resolve_symlinks(char *path)
+ {
++    // On NixOS we *want* stuff relative to symlinks.
++    return 0;
++
+ #ifdef HAVE_READLINK
+ 	struct stat buf;
+ 	char		orig_wd[MAXPGPATH],