From d07697de5f4e08759c9dfbd482b1bca1624d179e Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Tue, 29 Aug 2017 18:56:32 -0400 Subject: [PATCH] Replace stat / uid comparison with test -O --- scripts/nix-profile-daemon.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/nix-profile-daemon.sh.in b/scripts/nix-profile-daemon.sh.in index 7f46cc69e..45e4f5925 100644 --- a/scripts/nix-profile-daemon.sh.in +++ b/scripts/nix-profile-daemon.sh.in @@ -13,7 +13,7 @@ export NIX_PROFILES="@localstatedir@/nix/profiles/default $HOME/.nix-profile" # Set up the per-user profile. mkdir -m 0755 -p $NIX_USER_PROFILE_DIR -if test "$(stat -f '%u' $NIX_USER_PROFILE_DIR)" != "$(id -u)"; then +if ! test -O "$NIX_USER_PROFILE_DIR"; then echo "WARNING: bad ownership on $NIX_USER_PROFILE_DIR" >&2 fi @@ -35,7 +35,7 @@ if test -w $HOME; then # Create the per-user garbage collector roots directory. NIX_USER_GCROOTS_DIR=@localstatedir@/nix/gcroots/per-user/$USER mkdir -m 0755 -p $NIX_USER_GCROOTS_DIR - if test "$(stat -f '%u' $NIX_USER_GCROOTS_DIR)" != "$(id -u)"; then + if ! test -O "$NIX_USER_GCROOTS_DIR"; then echo "WARNING: bad ownership on $NIX_USER_GCROOTS_DIR" >&2 fi