Merging against master - updating smokingpig, rebase was going to be messy

This commit is contained in:
Parnell Springmeyer
2017-01-26 02:00:04 -08:00
956 changed files with 25853 additions and 24254 deletions

View File

@@ -1,33 +1,25 @@
{ lib, stdenv, fetchurl, pkgconfig, zlib, libseccomp, fetchpatch, autoreconfHook, ncurses ? null, perl ? null, pam, systemd, minimal ? false }:
{ lib, stdenv, fetchurl, pkgconfig, zlib, fetchpatch, shadow
, ncurses ? null, perl ? null, pam, systemd, minimal ? false }:
stdenv.mkDerivation rec {
name = "util-linux-${version}";
version = lib.concatStringsSep "." ([ majorVersion ]
++ lib.optional (patchVersion != "") patchVersion);
majorVersion = "2.28";
patchVersion = "1";
majorVersion = "2.29";
patchVersion = "";
src = fetchurl {
url = "mirror://kernel/linux/utils/util-linux/v${majorVersion}/${name}.tar.xz";
sha256 = "03xnaw3c7pavxvvh1vnimcr44hlhhf25whawiyv8dxsflfj4xkiy";
sha256 = "1rzrmdrz51p9sy7vlw5qmj8pmqazm7hgcch5yq242mkvrikyln9c";
};
patches = [
./rtcwake-search-PATH-for-shutdown.patch
(fetchpatch {
name = "CVE-2016-2779.diff";
url = https://github.com/karelzak/util-linux/commit/8e4925016875c6a4f2ab4f833ba66f0fc57396a2.patch;
sha256 = "0kmigkq4s1b1ijrq8vcg2a5cw4qnm065m7cb1jn1q1f4x99ycy60";
})];
patches = [ ./rtcwake-search-PATH-for-shutdown.patch ];
outputs = [ "bin" "dev" "out" "man" ];
#FIXME: make it also work on non-nixos?
postPatch = ''
# Substituting store paths would create a circular dependency on systemd
substituteInPlace include/pathnames.h \
--replace "/bin/login" "/run/current-system/sw/bin/login" \
--replace "/sbin/shutdown" "/run/current-system/sw/bin/shutdown"
--replace "/bin/login" "${shadow}/bin/login"
'';
crossAttrs = {
@@ -54,11 +46,9 @@ stdenv.mkDerivation rec {
makeFlags = "usrbin_execdir=$(bin)/bin usrsbin_execdir=$(bin)/sbin";
# autoreconfHook is required for CVE-2016-2779
nativeBuildInputs = [ pkgconfig autoreconfHook ];
# libseccomp is required for CVE-2016-2779
nativeBuildInputs = [ pkgconfig ];
buildInputs =
[ zlib pam libseccomp ]
[ zlib pam ]
++ lib.optional (ncurses != null) ncurses
++ lib.optional (systemd != null) systemd
++ lib.optional (perl != null) perl;

View File

@@ -3,21 +3,17 @@ which isn't valid on NixOS (and a compatibility link on most other modern
distros anyway).
-- nckx <tobias.geerinckx.rice@gmail.com>
diff --git a/include/pathnames.h b/include/pathnames.h
index de6a13c..0c1aeb9 100644
--- a/include/pathnames.h
+++ b/include/pathnames.h
@@ -50,7 +50,7 @@
#define _PATH_VAR_NOLOGIN "/var/run/nologin"
@@ -53,7 +53,7 @@
#ifndef _PATH_LOGIN
#define _PATH_LOGIN "/bin/login"
#endif
-#define _PATH_SHUTDOWN "/sbin/shutdown"
+#define _PATH_SHUTDOWN "shutdown"
+#define _PATH_SHUTDOWN "shutdown"
#define _PATH_TERMCOLORS_DIRNAME "terminal-colors.d"
#define _PATH_TERMCOLORS_DIR "/etc/" _PATH_TERMCOLORS_DIRNAME
diff --git a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c
index 7c748dc..9a99a7c 100644
--- a/sys-utils/rtcwake.c
+++ b/sys-utils/rtcwake.c
@@ -575,7 +575,7 @@ int main(int argc, char **argv)