volumes: better hostPath validation
This commit is contained in:
@@ -229,7 +229,7 @@ function removeDir(apiConfig, pathPrefix) {
|
||||
function validateBackupTarget(folder) {
|
||||
assert.strictEqual(typeof folder, 'string');
|
||||
|
||||
if (path.normalize(folder) !== folder) return new BoxError(BoxError.BAD_FIELD, 'backupFolder must contain a normalized relative path', { field: 'backupFolder' });
|
||||
if (path.normalize(folder) !== folder) return new BoxError(BoxError.BAD_FIELD, 'backupFolder must contain a normalized path', { field: 'backupFolder' });
|
||||
if (!path.isAbsolute(folder)) return new BoxError(BoxError.BAD_FIELD, 'backupFolder must be an absolute path', { field: 'backupFolder' });
|
||||
|
||||
if (folder === '/') return new BoxError(BoxError.BAD_FIELD, 'backupFolder cannot be /', { field: 'backupFolder' });
|
||||
|
||||
Reference in New Issue
Block a user