"managed to reach this point." => what if a code path just calls leaveLegacyRootDir() without ever calling enter()? Imho that should not be allowed