diff --git a/CHANGES b/CHANGES index b4ebc662a..be8e347de 100644 --- a/CHANGES +++ b/CHANGES @@ -2164,4 +2164,5 @@ * prepend the version to assets when sourcing to avoid cache hits on update * filemanger: list volumes of the app * Display upload size and size progress +* nfs: chown the backups for hardlinks to work diff --git a/src/storage/filesystem.js b/src/storage/filesystem.js index d5b044721..0d62c9825 100644 --- a/src/storage/filesystem.js +++ b/src/storage/filesystem.js @@ -111,8 +111,10 @@ function upload(apiConfig, backupFilePath, sourceStream, callback) { const BACKUP_UID = parseInt(process.env.SUDO_UID, 10) || process.getuid(); // sshfs and cifs handle ownership through the mount args - if (apiConfig.provider === PROVIDER_FILESYSTEM && !safe.fs.chownSync(backupFilePath, BACKUP_UID, BACKUP_UID)) return callback(new BoxError(BoxError.EXTERNAL_ERROR, 'Unable to chown:' + safe.error.message)); - if (apiConfig.provider === PROVIDER_FILESYSTEM && !safe.fs.chownSync(path.dirname(backupFilePath), BACKUP_UID, BACKUP_UID)) return callback(new BoxError(BoxError.EXTERNAL_ERROR, 'Unable to chown:' + safe.error.message)); + if (apiConfig.provider === PROVIDER_FILESYSTEM || apiConfig.provider === PROVIDER_NFS) { + if (!safe.fs.chownSync(backupFilePath, BACKUP_UID, BACKUP_UID)) return callback(new BoxError(BoxError.EXTERNAL_ERROR, 'Unable to chown:' + safe.error.message)); + if (!safe.fs.chownSync(path.dirname(backupFilePath), BACKUP_UID, BACKUP_UID)) return callback(new BoxError(BoxError.EXTERNAL_ERROR, 'Unable to chown:' + safe.error.message)); + } debug('upload %s: done.', backupFilePath);