summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeroy Hopson <git@leroy.geek.nz>2015-06-28 22:34:44 +1200
committerLeroy Hopson <git@leroy.geek.nz>2015-06-28 23:08:10 +1200
commitd0633a28ffddb78f6a1e7340f67e3aad663c87d0 (patch)
tree61a9f7b943bfbec8cf9bdd74c6b520fb93a1563b
parentc45b5aba92cc6b7d7e3602335c97a084f2ed0144 (diff)
downloadnixlib-d0633a28ffddb78f6a1e7340f67e3aad663c87d0.tar
nixlib-d0633a28ffddb78f6a1e7340f67e3aad663c87d0.tar.gz
nixlib-d0633a28ffddb78f6a1e7340f67e3aad663c87d0.tar.bz2
nixlib-d0633a28ffddb78f6a1e7340f67e3aad663c87d0.tar.lz
nixlib-d0633a28ffddb78f6a1e7340f67e3aad663c87d0.tar.xz
nixlib-d0633a28ffddb78f6a1e7340f67e3aad663c87d0.tar.zst
nixlib-d0633a28ffddb78f6a1e7340f67e3aad663c87d0.zip
Fix SSL/TLS support for shellinaboxd
shellinboxd was not finding libssl.so in it's library path, so it was
falling back to ssl disabled mode. Also, the path to openssl was
hardcoded to /usr/bin/openssl, so shellinaboxd could not generate SSL
certificates once libssl.so was added to LD_LIBRARY_PATH.
-rw-r--r--pkgs/servers/shellinabox/default.nix31
1 files changed, 20 insertions, 11 deletions
diff --git a/pkgs/servers/shellinabox/default.nix b/pkgs/servers/shellinabox/default.nix
index 2d827c737d8b..5d870c7e6bd8 100644
--- a/pkgs/servers/shellinabox/default.nix
+++ b/pkgs/servers/shellinabox/default.nix
@@ -1,29 +1,38 @@
-{ stdenv, fetchurl, pam, openssl, openssh, shadow }:
+{ stdenv, fetchurl, pam, openssl, openssh, shadow, makeWrapper }:
 
-stdenv.mkDerivation {
-  name = "shellinabox-2.14";
+stdenv.mkDerivation rec {
+  version = "2.14";
+  name = "shellinabox-${version}";
 
   src = fetchurl {
-    url = "https://shellinabox.googlecode.com/files/shellinabox-2.14.tar.gz";
+    url = "https://shellinabox.googlecode.com/files/shellinabox-${version}.tar.gz";
     sha1 = "9e01f58c68cb53211b83d0f02e676e0d50deb781";
   };
 
-  buildInputs = [pam openssl openssh];
+  buildInputs = [ pam openssl openssh makeWrapper ];
 
   patches = [ ./shellinabox-minus.patch ];
 
-  # Disable GSSAPIAuthentication errors as well as correct hardcoded path. Take /usr/games's place. 
+  # Disable GSSAPIAuthentication errors. Also, paths in certain source files are
+  # hardcoded. Replace the hardcoded paths with correct paths.
   preConfigure = ''
     substituteInPlace ./shellinabox/service.c --replace "-oGSSAPIAuthentication=no" ""
     substituteInPlace ./shellinabox/launcher.c --replace "/usr/games" "${openssh}/bin"
     substituteInPlace ./shellinabox/service.c --replace "/bin/login" "${shadow}/bin/login"
     substituteInPlace ./shellinabox/launcher.c --replace "/bin/login" "${shadow}/bin/login"
-    '';
-  meta = {
+    substituteInPlace ./libhttp/ssl.c --replace "/usr/bin" "${openssl}/bin"
+  '';
+
+  postInstall = ''
+    wrapProgram $out/bin/shellinaboxd \
+      --prefix LD_LIBRARY_PATH : ${openssl}/lib
+  '';
+
+  meta = with stdenv.lib; {
     homepage = https://code.google.com/p/shellinabox;
     description = "Web based AJAX terminal emulator";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [stdenv.lib.maintainers.tomberek];
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ tomberek lihop ];
+    platforms = platforms.linux;
   };
 }