Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(doctor): Folder permissions check considers setuid, setgid, and sticky bits #729

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/commands/doctor/checks/check-permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = function checkPermissions(type, task) {
},
folder: {
command: 'find ./ -type d ! -perm 775 ! -perm 755',
help: `Run ${chalk.green('sudo find ./ -type d -exec chmod 775 {} \\;')} and try again.`
help: `Run ${chalk.green('sudo find ./ -type d -exec chmod 00775 {} \\;')} and try again.`

This comment was marked as abuse.

},
files: {
command: 'find ./ -type f ! -path "./versions/*" ! -perm 664 ! -perm 644',
Expand Down
4 changes: 2 additions & 2 deletions test/unit/commands/doctor/checks/folder-permissions-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('Unit: Doctor Checks > Checking folder permissions', function () {
expect(error).to.be.an.instanceof(errors.SystemError);
expect(error.message).to.match(/Your installation folder contains some directories or files with incorrect permissions:/);
expect(error.message).to.match(/- \.\/system\/apps/);
expect(error.message).to.match(/sudo find \.\/ -type d -exec chmod 775 \{\} \\;/);
expect(error.message).to.match(/sudo find \.\/ -type d -exec chmod 00775 \{\} \\;/);
expect(execaStub.called).to.be.true;
});
});
Expand All @@ -55,7 +55,7 @@ describe('Unit: Doctor Checks > Checking folder permissions', function () {
expect(error).to.be.an.instanceof(errors.SystemError);
expect(error.message).to.match(/Your installation folder contains a directory or file with incorrect permissions:/);
expect(error.message).to.match(/- .\/content\/images\/test.jpg/);
expect(error.message).to.match(/sudo find \.\/ -type d -exec chmod 775 \{\} \\;/);
expect(error.message).to.match(/sudo find \.\/ -type d -exec chmod 00775 \{\} \\;/);
expect(execaStub.called).to.be.true;
});
});
Expand Down