From d7bf0d777a0edba5a6c87d59e9b7516c796fcd1f Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jul 2023 22:10:39 +0200 Subject: [PATCH] lib.path.subpath.isValid: Add definition of a subpath Co-authored-by: Robert Hensing --- lib/path/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/path/default.nix b/lib/path/default.nix index 1300f0f09011..24a7f85affc1 100644 --- a/lib/path/default.nix +++ b/lib/path/default.nix @@ -319,6 +319,9 @@ in /* No rec! Add dependencies on this file at the top. */ { /* Whether a value is a valid subpath string. + A subpath string points to a specific file or directory within an absolute base directory. + It is a stricter form of a relative path that excludes `..` components, since those could escape the base directory. + - The value is a string - The string is not empty