From 1aac1fe5dd46767b81a62b9eb7169c2421bbe366 Mon Sep 17 00:00:00 2001 From: Vladimír Čunát Date: Wed, 7 Jun 2017 15:17:40 +0200 Subject: util-linux: fixup setuid/setgid build problems ... hopefully. Also refactor some nix code a little. --- pkgs/os-specific/linux/util-linux/default.nix | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'pkgs/os-specific/linux/util-linux') diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix index 5d7f701b39ed..01bd8beea3d9 100644 --- a/pkgs/os-specific/linux/util-linux/default.nix +++ b/pkgs/os-specific/linux/util-linux/default.nix @@ -30,30 +30,29 @@ stdenv.mkDerivation rec { }; preConfigure = lib.optionalString (systemd != null) '' - configureFlags+="--with-systemd --with-systemdsystemunitdir=$bin/lib/systemd/system/" + configureFlags+=" --with-systemd --with-systemdsystemunitdir=$bin/lib/systemd/system/" ''; # !!! It would be better to obtain the path to the mount helpers # (/sbin/mount.*) through an environment variable, but that's # somewhat risky because we have to consider that mount can setuid # root... - configureFlags = '' - --enable-write - --enable-last - --enable-mesg - --disable-use-tty-group - --enable-fs-paths-default=/run/wrappers/bin:/var/run/current-system/sw/bin:/sbin - ${if ncurses == null then "--without-ncurses" else ""} - ''; + configureFlags = [ + "--enable-write" + "--enable-last" + "--enable-mesg" + "--disable-use-tty-group" + "--enable-fs-paths-default=/run/wrappers/bin:/var/run/current-system/sw/bin:/sbin" + "--disable-makeinstall-setuid" "--disable-makeinstall-chown" + ] + ++ lib.optional (ncurses == null) "--without-ncurses"; makeFlags = "usrbin_execdir=$(bin)/bin usrsbin_execdir=$(bin)/sbin"; nativeBuildInputs = [ pkgconfig ]; buildInputs = [ zlib pam ] - ++ lib.optional (ncurses != null) ncurses - ++ lib.optional (systemd != null) systemd - ++ lib.optional (perl != null) perl; + ++ lib.filter (p: p != null) [ ncurses systemd perl ]; postInstall = '' rm "$bin/bin/su" # su should be supplied by the su package (shadow) -- cgit 1.4.1