From 79ffaeb2e7de233002bf9ea96f2766a6d632f068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 19 Mar 2008 12:34:39 +0000 Subject: [PATCH] activate-configuration: Look for setuid executables in the default profile. svn path=/nixos/trunk/; revision=11202 --- system/activate-configuration.sh | 7 +++++++ system/system.nix | 11 +---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/system/activate-configuration.sh b/system/activate-configuration.sh index e2e6ddcbbb6..47fe684a8aa 100644 --- a/system/activate-configuration.sh +++ b/system/activate-configuration.sh @@ -129,6 +129,12 @@ ln -sf /nix/var/nix/manifests /nix/var/nix/gcroots/ # Make a few setuid programs work. PATH=@systemPath@/bin:@systemPath@/sbin:$PATH +save_PATH="$PATH" + +# Add the default profile to the search path for setuid executables. +PATH="/nix/var/nix/profiles/default/sbin:$PATH" +PATH="/nix/var/nix/profiles/default/bin:$PATH" + wrapperDir=@wrapperDir@ if test -d $wrapperDir; then rm -f $wrapperDir/*; fi mkdir -p $wrapperDir @@ -149,6 +155,7 @@ for i in @setuidPrograms@; do chmod 4755 $wrapperDir/$i done +PATH="$save_PATH" # Set the host name. Don't clear it if it's not configured in the # NixOS configuration, since it may have been set by dhclient in the diff --git a/system/system.nix b/system/system.nix index 3843b484a2e..6f3ed231671 100644 --- a/system/system.nix +++ b/system/system.nix @@ -302,16 +302,7 @@ rec { pkgs.coreutils pkgs.gnugrep pkgs.findutils pkgs.glibc # needed for getent pkgs.pwdutils - ] - - # XXX: Hack to recognize common setuid programs. - ++ pkgs.lib.optional (pkgs.lib.any (x: x == "xlock") setuidPrograms) - pkgs.xlockmore - ++ pkgs.lib.optional (pkgs.lib.any (x: x == "xscreensaver") - setuidPrograms) - pkgs.xscreensaver - ++ pkgs.lib.optional (pkgs.lib.any (x: x == "xlaunch") setuidPrograms) - pkgs.xlaunch; + ]; bash = pkgs.bashInteractive; };