summary refs log tree commit diff
path: root/pkgs/os-specific/linux/util-linux
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2017-06-07 15:17:40 +0200
committerVladimír Čunát <vcunat@gmail.com>2017-06-07 15:17:40 +0200
commit1aac1fe5dd46767b81a62b9eb7169c2421bbe366 (patch)
treee3f45bf9a73dbf4a885fdfc7005828f7676f8677 /pkgs/os-specific/linux/util-linux
parent833bc78dcf8fe8c00d0c8e835f49145be9b87523 (diff)
downloadnixpkgs-1aac1fe5dd46767b81a62b9eb7169c2421bbe366.tar
nixpkgs-1aac1fe5dd46767b81a62b9eb7169c2421bbe366.tar.gz
nixpkgs-1aac1fe5dd46767b81a62b9eb7169c2421bbe366.tar.bz2
nixpkgs-1aac1fe5dd46767b81a62b9eb7169c2421bbe366.tar.lz
nixpkgs-1aac1fe5dd46767b81a62b9eb7169c2421bbe366.tar.xz
nixpkgs-1aac1fe5dd46767b81a62b9eb7169c2421bbe366.tar.zst
nixpkgs-1aac1fe5dd46767b81a62b9eb7169c2421bbe366.zip
util-linux: fixup setuid/setgid build problems
... hopefully.  Also refactor some nix code a little.
Diffstat (limited to 'pkgs/os-specific/linux/util-linux')
-rw-r--r--pkgs/os-specific/linux/util-linux/default.nix23
1 files changed, 11 insertions, 12 deletions
diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix
index 5d7f701b39e..01bd8beea3d 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)