[GH-ISSUE #32] Feature Request: Allow for defining path used for TempDir #100

Closed
opened 2026-03-14 01:37:11 +03:00 by kerem · 1 comment
Owner

Originally created by @UranusBytes on GitHub (Feb 14, 2023).
Original GitHub issue: https://github.com/amidaware/rmmagent/issues/32

Originally assigned to: @wh1te909 on GitHub.

The Linux Level-1 CIS benchmarks set the noexec flag on /tmp. This prevents the agent from being able to execute any scripts (fork/exec /tmp/trmm12345: permission denied)

The createTmpFile of utils.go is passing a blank string for the dir path to CreateTemp that is causing the function to use the path as returned by TempDir. https://pkg.go.dev/os#CreateTemp
github.com/amidaware/rmmagent@4b1f993a76/agent/utils.go (L312-L315)

If the value for this path was a variable (Custom Field) defined at the site or agent level that was an empty string by default, then it would continue to use the default TempDir path, but allow for overrides in circumstances where a different path is needed...

Originally created by @UranusBytes on GitHub (Feb 14, 2023). Original GitHub issue: https://github.com/amidaware/rmmagent/issues/32 Originally assigned to: @wh1te909 on GitHub. The Linux Level-1 CIS benchmarks set the `noexec` flag on `/tmp`. This prevents the agent from being able to execute any scripts (`fork/exec /tmp/trmm12345: permission denied`) The `createTmpFile` of `utils.go` is passing a blank string for the dir path to `CreateTemp` that is causing the function to use the path as returned by `TempDir`. https://pkg.go.dev/os#CreateTemp https://github.com/amidaware/rmmagent/blob/4b1f993a7633c3f69d49cd6ee4ae509c3896d19b/agent/utils.go#L312-L315 If the value for this path was a variable (Custom Field) defined at the site or agent level that was an empty string by default, then it would continue to use the default `TempDir` path, but allow for overrides in circumstances where a different path is needed...
kerem 2026-03-14 01:37:11 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@wh1te909 commented on GitHub (Feb 27, 2023):

thanks I reworked the function to handle noexec and fallback to the current dir

<!-- gh-comment-id:1447117736 --> @wh1te909 commented on GitHub (Feb 27, 2023): thanks I reworked the function to handle `noexec` and fallback to the current dir
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rmmagent#100
No description provided.