Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- #973: Enables CORS and JWT configuration for WebApplications in module.xml
- #1110: Add `iriscli` and `ipm` container utility scripts that are auto-installed to `~/.local/bin/` and `~/bin/` so they work both inside and outside of containers (Unix/Linux only)
- #971: Adds structured test output formats (JSON, YAML, Toon). Use `-f <format>` for a one-shot override or `config set TestReportFormat <format>` for a persistent default. Without either, legacy output is shown. Also adds `-output-file` for writing results to a file (including JUnit XML via `.xml` extension) and improves `-quiet` to suppress build noise.
- #1053: Add file system permissions check before install/load.

### Fixed
- #1130: Fix issue with ORAS repositories pointing to some OCI registries that require authentication (e.g. ghcr.io) not accepting credentials properly. `repo -list` now shows an `Authenticated?` status for ORAS repos with credentials configured.
Expand Down
6 changes: 6 additions & 0 deletions src/cls/IPM/Main.cls
Original file line number Diff line number Diff line change
Expand Up @@ -2351,6 +2351,12 @@ ClassMethod LoadInternal(
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?

$$$ThrowStatus($$$ERROR($$$GeneralError, "Failed to create system temporary directory. Error code: " _ -tTargetDirectory))
}
if '##class(%Library.File).Writeable(tTargetDirectory) {
$$$ThrowStatus($$$ERROR($$$GeneralError, $$$FormatText("Insufficient file system permissions to write to '%1'. Cannot load module from archive.", tTargetDirectory)))
}
if $get(pCommandInfo("data", "Verbose")) {
write !,"Extracting archive to ",tTargetDirectory
}
Expand Down
9 changes: 9 additions & 0 deletions src/cls/IPM/Utils/Module.cls
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,15 @@ ClassMethod LoadModuleFromArchive(
try {
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?

set writeCheckDir = $select(##class(%File).DirectoryExists(ipmBaseDir): ipmBaseDir, 1: ##class(%SYSTEM.Util).DataDirectory())
if '##class(%Library.File).Writeable(writeCheckDir) {
set msg = $$$FormatText("Insufficient file system permissions to write to '%1'. Cannot install module '%2'.", writeCheckDir, pModuleName)
set tSC = $$$ERROR($$$GeneralError, msg)
quit
}

// Modules have a well-defined location inside the archive
set tTargetDirectory = ##class(%Library.File).NormalizeDirectory(##class(%SYSTEM.Util).DataDirectory() _ "ipm/" _ pModuleName _ "/" _ pModuleVersion)
if ##class(%File).DirectoryExists(tTargetDirectory) {
Expand Down
Loading