From 0508a04bab420a7aec08a3a43b9857cfcf75488b Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Mon, 10 Jan 2022 14:27:19 +0100 Subject: [PATCH] Support cifs seal option https://manpages.debian.org/testing/cifs-utils/mount.cifs.8.en.html#seal --- src/mounts.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mounts.js b/src/mounts.js index d6fe8e58e..9c7a8511f 100644 --- a/src/mounts.js +++ b/src/mounts.js @@ -40,6 +40,7 @@ function validateMountOptions(type, options) { if (typeof options.password !== 'string') return new BoxError(BoxError.BAD_FIELD, 'password is not a string'); if (typeof options.host !== 'string') return new BoxError(BoxError.BAD_FIELD, 'host is not a string'); if (typeof options.remoteDir !== 'string') return new BoxError(BoxError.BAD_FIELD, 'remoteDir is not a string'); + if ('seal' in options && typeof options.seal !== 'boolean') return new BoxError(BoxError.BAD_FIELD, 'seal is not a boolean'); return null; case 'nfs': if (typeof options.host !== 'string') return new BoxError(BoxError.BAD_FIELD, 'host is not a string'); @@ -87,7 +88,7 @@ function renderMountFile(mount) { case 'cifs': type = 'cifs'; what = `//${mountOptions.host}` + path.join('/', mountOptions.remoteDir); - options = `username=${mountOptions.username},password=${mountOptions.password},rw,iocharset=utf8,file_mode=0666,dir_mode=0777,uid=yellowtent,gid=yellowtent`; + options = `username=${mountOptions.username},password=${mountOptions.password},rw,${mountOptions.seal ? 'seal,' : ''}iocharset=utf8,file_mode=0666,dir_mode=0777,uid=yellowtent,gid=yellowtent`; break; case 'nfs': type = 'nfs';