···11+{ lib, stdenv, fetchFromGitHub, pkg-config
22+, linux-pam, libxcrypt
33+}:
44+55+stdenv.mkDerivation rec {
66+ pname = "tcb";
77+ version = "1.2";
88+99+ src = fetchFromGitHub {
1010+ owner = "openwall";
1111+ repo = pname;
1212+ rev = "070cf4aa784de13c52788ac22ff611d7cbca0854";
1313+ sha256 = "sha256-Sp5u7iTEZZnAqKQXoPO8eWpSkZeBzQqZI82wRQmgU9A=";
1414+ };
1515+1616+ outputs = [ "out" "bin" "dev" "man" ];
1717+1818+ nativeBuildInputs = [ pkg-config ];
1919+2020+ buildInputs = [ linux-pam libxcrypt ];
2121+2222+ patches = [ ./fix-makefiles.patch ];
2323+2424+ postPatch = ''
2525+ substituteInPlace Make.defs \
2626+ --replace "PREFIX = /usr" "PREFIX = $out" \
2727+ --replace "SBINDIR = /sbin" "SBINDIR = $bin/bin" \
2828+ --replace "INCLUDEDIR = \$(PREFIX)/include" "INCLUDEDIR = $dev/include"
2929+ '';
3030+3131+ meta = with lib; {
3232+ description = "Alternative password shadowing scheme";
3333+ longDescription = ''
3434+ The tcb package contains core components of our tcb suite implementing the alternative
3535+ password shadowing scheme on Openwall GNU Linux (Owl). It is being made available
3636+ separately from Owl primarily for use by other distributions.
3737+3838+ The package consists of three components: pam_tcb, libnss_tcb, and libtcb.
3939+4040+ pam_tcb is a PAM module which supersedes pam_unix. It also implements the tcb password
4141+ shadowing scheme. The tcb scheme allows many core system utilities (passwd(1) being
4242+ the primary example) to operate with little privilege. libnss_tcb is the accompanying
4343+ NSS module. libtcb contains code shared by the PAM and NSS modules and is also used
4444+ by user management tools on Owl due to our shadow suite patches.
4545+ '';
4646+ homepage = "https://www.openwall.com/tcb/";
4747+ license = licenses.bsd3;
4848+ platforms = platforms.linux;
4949+ maintainers = with maintainers; [ izorkin ];
5050+ };
5151+}