Fixup tests

This commit is contained in:
Girish Ramakrishnan
2025-08-04 15:00:21 +02:00
parent a887be432b
commit fddbe6a574
8 changed files with 23 additions and 26 deletions

View File

@@ -263,7 +263,7 @@ function validateDestDir(dir) {
if (!dir.endsWith('/')) dir = dir + '/'; // ensure trailing slash for the prefix matching to work
const PROTECTED_PREFIXES = [ '/boot/', '/usr/', '/bin/', '/lib/', '/root/', '/var/lib/', paths.baseDir() ];
if (PROTECTED_PREFIXES.some(p => dir.startsWith(p))) return new BoxError(BoxError.BAD_FIELD, 'backupDir path is protected');
if (PROTECTED_PREFIXES.some(p => dir.startsWith(p))) return new BoxError(BoxError.BAD_FIELD, `backupDir ${dir} is protected`);
return null;
}