2019-11-03 16:44:17 +01:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pam, openssl, openssh, shadow, makeWrapper }:
|
2013-12-07 06:13:35 +01:00
|
|
|
|
2015-06-28 12:34:44 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2016-12-28 16:41:29 +01:00
|
|
|
version = "2.20";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "shellinabox";
|
2013-12-07 06:13:35 +01:00
|
|
|
|
2015-08-07 08:31:11 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "shellinabox";
|
|
|
|
repo = "shellinabox";
|
2016-12-28 16:41:29 +01:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1hmfayh21cks2lyj572944ll0mmgsxbnj981b3hq3nhdg8ywzjfr";
|
2013-12-07 06:13:35 +01:00
|
|
|
};
|
2014-03-28 11:51:41 +01:00
|
|
|
|
2019-11-03 16:44:17 +01:00
|
|
|
patches = [
|
|
|
|
./shellinabox-minus.patch
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2018-16789.patch";
|
|
|
|
url = "https://github.com/shellinabox/shellinabox/commit/4f0ecc31ac6f985e0dd3f5a52cbfc0e9251f6361.patch";
|
|
|
|
sha256 = "1mpm6acxdb0fms9pa2b88fx6hp07ph87ahxi82yyqj2m7p79jx7a";
|
|
|
|
})
|
|
|
|
];
|
2014-03-28 11:51:41 +01:00
|
|
|
|
2019-11-03 16:44:17 +01:00
|
|
|
nativeBuildInputs = [ autoreconfHook makeWrapper ];
|
|
|
|
buildInputs = [ pam openssl openssh ];
|
2015-08-07 08:31:11 +02:00
|
|
|
|
2015-06-28 12:34:44 +02:00
|
|
|
# Disable GSSAPIAuthentication errors. Also, paths in certain source files are
|
|
|
|
# hardcoded. Replace the hardcoded paths with correct paths.
|
2013-12-07 06:13:35 +01:00
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace ./shellinabox/service.c --replace "-oGSSAPIAuthentication=no" ""
|
|
|
|
substituteInPlace ./shellinabox/launcher.c --replace "/usr/games" "${openssh}/bin"
|
2014-03-28 11:51:41 +01:00
|
|
|
substituteInPlace ./shellinabox/service.c --replace "/bin/login" "${shadow}/bin/login"
|
|
|
|
substituteInPlace ./shellinabox/launcher.c --replace "/bin/login" "${shadow}/bin/login"
|
2016-02-01 19:46:16 +01:00
|
|
|
substituteInPlace ./libhttp/ssl.c --replace "/usr/bin" "${openssl.bin}/bin"
|
2015-06-28 12:34:44 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/shellinaboxd \
|
2016-01-24 08:30:05 +01:00
|
|
|
--prefix LD_LIBRARY_PATH : ${openssl.out}/lib
|
2015-08-07 08:31:11 +02:00
|
|
|
mkdir -p $out/lib
|
|
|
|
cp shellinabox/* $out/lib
|
2015-06-28 12:34:44 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2017-10-27 01:44:19 +02:00
|
|
|
homepage = https://github.com/shellinabox/shellinabox;
|
2013-12-07 06:13:35 +01:00
|
|
|
description = "Web based AJAX terminal emulator";
|
2015-06-28 12:34:44 +02:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ tomberek lihop ];
|
|
|
|
platforms = platforms.linux;
|
2013-12-07 06:13:35 +01:00
|
|
|
};
|
|
|
|
}
|