diff options
author | msteen <emailmatthijs@gmail.com> | 2018-12-24 14:05:55 +0100 |
---|---|---|
committer | zimbatm <zimbatm@zimbatm.com> | 2018-12-24 14:05:55 +0100 |
commit | 8d217ede58386b96bcf561c313c12b170c975440 (patch) | |
tree | d21ff098fc423aff648b62547758013865e1453e /nixos/lib/utils.nix | |
parent | d3733053dd7f5870ef14827a22f80a864bf7ebe2 (diff) | |
download | nixpkgs-8d217ede58386b96bcf561c313c12b170c975440.tar nixpkgs-8d217ede58386b96bcf561c313c12b170c975440.tar.gz nixpkgs-8d217ede58386b96bcf561c313c12b170c975440.tar.bz2 nixpkgs-8d217ede58386b96bcf561c313c12b170c975440.tar.lz nixpkgs-8d217ede58386b96bcf561c313c12b170c975440.tar.xz nixpkgs-8d217ede58386b96bcf561c313c12b170c975440.tar.zst nixpkgs-8d217ede58386b96bcf561c313c12b170c975440.zip |
fix infinite recursion caused by the unnecessary inspection of options + fix is parent of mount point check (#51541)
Diffstat (limited to 'nixos/lib/utils.nix')
-rw-r--r-- | nixos/lib/utils.nix | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/nixos/lib/utils.nix b/nixos/lib/utils.nix index 1ef915d4061..b68e55a40b9 100644 --- a/nixos/lib/utils.nix +++ b/nixos/lib/utils.nix @@ -7,9 +7,8 @@ rec { || elem fs.mountPoint [ "/" "/nix" "/nix/store" "/var" "/var/log" "/var/lib" "/etc" ]; # Check whenever `b` depends on `a` as a fileSystem - # FIXME: it's incorrect to simply use hasPrefix here: "/dev/a" is not a parent of "/dev/ab" - fsBefore = a: b: ((any (x: elem x [ "bind" "move" ]) b.options) && (a.mountPoint == b.device)) - || (hasPrefix a.mountPoint b.mountPoint); + fsBefore = a: b: a.mountPoint == b.device + || hasPrefix "${a.mountPoint}${optionalString (!(hasSuffix "/" a.mountPoint)) "/"}" b.mountPoint; # Escape a path according to the systemd rules, e.g. /dev/xyzzy # becomes dev-xyzzy. FIXME: slow. |