mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 06:52:43 +01:00
Merge pull request #1540 from grahamc/test-o
1.11: Replace stat / uid comparison with test -O
This commit is contained in:
commit
23795d47fb
1 changed files with 2 additions and 2 deletions
|
|
@ -13,7 +13,7 @@ export NIX_PROFILES="@localstatedir@/nix/profiles/default $HOME/.nix-profile"
|
||||||
|
|
||||||
# Set up the per-user profile.
|
# Set up the per-user profile.
|
||||||
mkdir -m 0755 -p $NIX_USER_PROFILE_DIR
|
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
|
echo "WARNING: bad ownership on $NIX_USER_PROFILE_DIR" >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -35,7 +35,7 @@ if test -w $HOME; then
|
||||||
# Create the per-user garbage collector roots directory.
|
# Create the per-user garbage collector roots directory.
|
||||||
NIX_USER_GCROOTS_DIR=@localstatedir@/nix/gcroots/per-user/$USER
|
NIX_USER_GCROOTS_DIR=@localstatedir@/nix/gcroots/per-user/$USER
|
||||||
mkdir -m 0755 -p $NIX_USER_GCROOTS_DIR
|
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
|
echo "WARNING: bad ownership on $NIX_USER_GCROOTS_DIR" >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue