backups: fix incorrect mountpoint check with managed mounts
This commit is contained in:
@@ -83,7 +83,7 @@ async function checkPreconditions(apiConfig, dataLayout, callback) {
|
||||
|
||||
// Check filesystem is mounted so we don't write into the actual folder on disk
|
||||
if (apiConfig.provider === PROVIDER_SSHFS || apiConfig.provider === PROVIDER_CIFS || apiConfig.provider === PROVIDER_NFS || apiConfig.provider === PROVIDER_EXT4) {
|
||||
if (result.mountpoint !== apiConfig.mountPoint) return callback(new BoxError(BoxError.FS_ERROR, `${apiConfig.mountPoint} is not mounted`));
|
||||
if (result.mountpoint !== paths.MANAGED_BACKUP_MOUNT_DIR) return callback(new BoxError(BoxError.FS_ERROR, 'Backup target is not mounted'));
|
||||
} else if (apiConfig.provider === PROVIDER_MOUNTPOINT) {
|
||||
if (result.mountpoint === '/') return callback(new BoxError(BoxError.FS_ERROR, `${apiConfig.backupFolder} is not mounted`));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user