Fixup tests
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user