2022-09-30 00:47:35 +01:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, libxcrypt }:
|
2011-08-22 16:24:24 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-07-27 15:21:24 +01:00
|
|
|
pname = "super";
|
|
|
|
version = "3.30.0";
|
2011-08-22 16:24:24 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-07-27 15:21:24 +01:00
|
|
|
name = "super-${version}.tar.gz";
|
|
|
|
url = "https://www.ucolick.org/~will/RUE/super/super-${version}-tar.gz";
|
2014-09-14 07:50:39 +01:00
|
|
|
sha256 = "0k476f83w7f45y9jpyxwr00ikv1vhjiq0c26fgjch9hnv18icvwy";
|
2011-08-22 16:24:24 +01:00
|
|
|
};
|
|
|
|
|
2017-06-16 13:13:54 +01:00
|
|
|
prePatch = ''
|
2017-06-17 10:43:50 +01:00
|
|
|
# do not set sticky bit in nix store
|
2017-06-16 13:13:54 +01:00
|
|
|
substituteInPlace Makefile.in \
|
|
|
|
--replace "-o root" "" \
|
|
|
|
--replace 04755 755
|
|
|
|
'';
|
|
|
|
|
2014-09-14 07:50:39 +01:00
|
|
|
patches = [
|
2020-08-10 20:48:12 +01:00
|
|
|
./0001-Remove-references-to-dropped-sys_nerr-sys_errlist-fo.patch
|
2020-05-06 22:18:09 +01:00
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2014-0470.patch";
|
|
|
|
url = "https://salsa.debian.org/debian/super/raw/debian/3.30.0-7/debian/patches/14-Fix-unchecked-setuid-call.patch";
|
|
|
|
sha256 = "08m9hw4kyfjv0kqns1cqha4v5hkgp4s4z0q1rgif1fnk14xh7wqh";
|
|
|
|
})
|
2014-09-14 07:50:39 +01:00
|
|
|
];
|
|
|
|
|
2022-05-29 07:59:42 +01:00
|
|
|
# -fcommon: workaround build failure on -fno-common toolchains like upstream
|
|
|
|
# gcc-10. Otherwise build fails as:
|
|
|
|
# ld: pam.o:/build/super-3.30.0/super.h:293: multiple definition of
|
|
|
|
# `Method'; super.o:/build/super-3.30.0/super.h:293: first defined here
|
|
|
|
NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE -fcommon";
|
2011-08-22 16:24:24 +01:00
|
|
|
|
2018-07-25 22:44:21 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
];
|
2011-08-22 16:24:24 +01:00
|
|
|
|
2022-09-30 00:47:35 +01:00
|
|
|
buildInputs = [ libxcrypt ];
|
|
|
|
|
2019-11-05 01:10:31 +00:00
|
|
|
installFlags = [ "sysconfdir=$(out)/etc" "localstatedir=$(TMPDIR)" ];
|
2011-08-22 16:24:24 +01:00
|
|
|
|
|
|
|
meta = {
|
2018-11-24 23:35:26 +00:00
|
|
|
homepage = "https://www.ucolick.org/~will/#super";
|
2011-08-22 16:24:24 +01:00
|
|
|
description = "Allows users to execute scripts as if they were root";
|
|
|
|
longDescription =
|
|
|
|
''
|
|
|
|
This package provides two commands: 1) “super”, which allows
|
|
|
|
users to execute commands under a different uid/gid (specified
|
|
|
|
in /etc/super.tab); and 2) “setuid”, which allows root to
|
|
|
|
execute a command under a different uid.
|
|
|
|
'';
|
2021-01-15 09:19:50 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2016-08-02 16:51:05 +01:00
|
|
|
};
|
2011-08-22 16:24:24 +01:00
|
|
|
}
|