backups: fix incorrect mountpoint check with managed mounts

This commit is contained in:
Girish Ramakrishnan
2022-02-25 12:52:48 -08:00
parent 62142c42ea
commit 2434e81383
2 changed files with 2 additions and 1 deletions

View File

@@ -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`));
}