restore: resolve any boxdata directory symilnk before downloading

the tar-fs module cannot handle symlinks and must be given a resolved directory
since it uses lstat()
This commit is contained in:
Girish Ramakrishnan
2021-03-01 11:02:43 -08:00
parent dd58c174a8
commit 476f348693
+3 -1
View File
@@ -806,7 +806,9 @@ function restore(backupConfig, backupId, progressCallback, callback) {
assert.strictEqual(typeof progressCallback, 'function');
assert.strictEqual(typeof callback, 'function');
const dataLayout = new DataLayout(paths.BOX_DATA_DIR, []);
const boxDataDir = safe.fs.realpathSync(paths.BOX_DATA_DIR);
if (!boxDataDir) return callback(safe.error);
const dataLayout = new DataLayout(boxDataDir, []);
download(backupConfig, backupId, backupConfig.format, dataLayout, progressCallback, function (error) {
if (error) return callback(error);