Skip to content

Commit 1aac1fe

Browse files
committedJun 7, 2017
util-linux: fixup setuid/setgid build problems
... hopefully. Also refactor some nix code a little.
1 parent 833bc78 commit 1aac1fe

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed
 

‎pkgs/os-specific/linux/util-linux/default.nix

+11-12
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,29 @@ stdenv.mkDerivation rec {
3030
};
3131

3232
preConfigure = lib.optionalString (systemd != null) ''
33-
configureFlags+="--with-systemd --with-systemdsystemunitdir=$bin/lib/systemd/system/"
33+
configureFlags+=" --with-systemd --with-systemdsystemunitdir=$bin/lib/systemd/system/"
3434
'';
3535

3636
# !!! It would be better to obtain the path to the mount helpers
3737
# (/sbin/mount.*) through an environment variable, but that's
3838
# somewhat risky because we have to consider that mount can setuid
3939
# root...
40-
configureFlags = ''
41-
--enable-write
42-
--enable-last
43-
--enable-mesg
44-
--disable-use-tty-group
45-
--enable-fs-paths-default=/run/wrappers/bin:/var/run/current-system/sw/bin:/sbin
46-
${if ncurses == null then "--without-ncurses" else ""}
47-
'';
40+
configureFlags = [
41+
"--enable-write"
42+
"--enable-last"
43+
"--enable-mesg"
44+
"--disable-use-tty-group"
45+
"--enable-fs-paths-default=/run/wrappers/bin:/var/run/current-system/sw/bin:/sbin"
46+
"--disable-makeinstall-setuid" "--disable-makeinstall-chown"
47+
]
48+
++ lib.optional (ncurses == null) "--without-ncurses";
4849

4950
makeFlags = "usrbin_execdir=$(bin)/bin usrsbin_execdir=$(bin)/sbin";
5051

5152
nativeBuildInputs = [ pkgconfig ];
5253
buildInputs =
5354
[ zlib pam ]
54-
++ lib.optional (ncurses != null) ncurses
55-
++ lib.optional (systemd != null) systemd
56-
++ lib.optional (perl != null) perl;
55+
++ lib.filter (p: p != null) [ ncurses systemd perl ];
5756

5857
postInstall = ''
5958
rm "$bin/bin/su" # su should be supplied by the su package (shadow)

0 commit comments

Comments
 (0)
Please sign in to comment.