From: Thomas Markwalder Date: Mon, 10 Aug 2026 11:50:37 +0000 (-0400) Subject: [#4647] Addressed review comments X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=df692290c1bc0daa665f7baf4e7a5935db355330;p=thirdparty%2Fkea.git [#4647] Addressed review comments modified: changelog_unreleased/4647-validatepath-allows-lease-file-path-outside-dhcp-data-dir modified: src/lib/util/tests/filesystem_unittests.cc --- diff --git a/changelog_unreleased/4647-validatepath-allows-lease-file-path-outside-dhcp-data-dir b/changelog_unreleased/4647-validatepath-allows-lease-file-path-outside-dhcp-data-dir index bf801211fb..27a4297a01 100644 --- a/changelog_unreleased/4647-validatepath-allows-lease-file-path-outside-dhcp-data-dir +++ b/changelog_unreleased/4647-validatepath-allows-lease-file-path-outside-dhcp-data-dir @@ -1,4 +1,4 @@ [bug] wlodek, tmark - Path validation now rejects now rejects "." and ".." file names + Path validation now rejects "." and ".." file names as invalid (e.g. memfile lease database name ".."). (Gitlab #4647) diff --git a/src/lib/util/tests/filesystem_unittests.cc b/src/lib/util/tests/filesystem_unittests.cc index 01c283fb3b..fbca3c1f75 100644 --- a/src/lib/util/tests/filesystem_unittests.cc +++ b/src/lib/util/tests/filesystem_unittests.cc @@ -505,23 +505,29 @@ TEST_F(PathCheckerTest, validatePathEnforcePathFalse) { string("path: '' has no filename"), false }, + { + // Empty filename. + __LINE__, + "", + "", + string("path: '' has no filename"), + false + }, { // Bare ".." escapes the supported path via empty parent. __LINE__, "..", "", - string("invalid path specified: '..', supported path is '" + - def_path + "'"), - true + string("path: '..' has no filename"), + false }, { // Supported path plus ".." also escapes despite matching parent. __LINE__, def_path + "/..", "", - string("invalid path specified: '..', supported path is '" + - def_path + "'"), - true + string("path: '" + def_path + "/..' has no filename"), + false } };