Skip to content

On install/load, add a file systems permissions check#1146

Open
isc-dchui wants to merge 2 commits into
mainfrom
fix-1053
Open

On install/load, add a file systems permissions check#1146
isc-dchui wants to merge 2 commits into
mainfrom
fix-1053

Conversation

@isc-dchui
Copy link
Copy Markdown
Collaborator

Description

Testing

Manually tested by changing the permissions of the /usr/irissys/ipm directory and verifying the error appears when trying to install.

zpm:USER>install isc.json

ERROR! Insufficient file system permissions to write to '/usr/irissys/ipm/'. Cannot install module 'isc.json'.

Checklist

  • This branch has the latest changes from the main branch rebased or merged.
  • Changelog entry added.
  • Unit (zpm test -only) and integration tests (zpm verify -only) pass.
  • Style matches the style guide in the contributing guide.
  • Documentation has been/will be updated
    • Source controlled docs, e.g. README.md, should be included in this PR and Wiki changes should be made after this PR is merged (add an extra issue for this if needed)
  • Pull request correctly renders in the "Preview" tab.

Copy link
Copy Markdown
Collaborator

@isc-kiyer isc-kiyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@isc-dchui some small questions

set tVerbose = $get(pParams("Verbose"))

// Check base IPM install location
set ipmBaseDir = ##class(%Library.File).NormalizeDirectory(##class(%SYSTEM.Util).DataDirectory() _ "ipm")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have a macro/a setting to be configured for the ipmDir? we should use that right?

Comment thread src/cls/IPM/Main.cls
set extension = $$$lcase($piece(tDirectoryName,".",*))
if ##class(%File).Exists(tDirectoryName) && ((extension="tgz") || (extension="tar.gz")) {
set tTargetDirectory = $$$FileTempDirSys
if tTargetDirectory = ("-" _ -tTargetDirectory) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this if condition? Its a little odd to see negation of what seems like it should be a string? Is it an integer when there is no permission?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Checking directory permissions for copying assets on install

2 participants