Skip to content

Commit

Permalink
fix infinite recursion caused by the unnecessary inspection of option…
Browse files Browse the repository at this point in the history
…s + fix is parent of mount point check (#51541)
  • Loading branch information
msteen authored and zimbatm committed Dec 24, 2018
1 parent d373305 commit 8d217ed
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions nixos/lib/utils.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8d217ed

Please sign in to comment.