Munki 7.4(?) issue and workaround

106 views
Skip to first unread message

Gregory Neagle

unread,
Oct 30, 2026, 12:27:05 PM (11 days ago) Oct 30
to munki-dev, munki-discuss
Vaughn Miller helped identify an issue affecting Munki 7.4. Until we understand this issue better, if you’ve not updated to Munki 7.4, you may want to wait for Munki 7.4.1. If you have already updated to Munki 7.4, there’s a “simple” workaround for the issue.

The issue:
With a copy_from_dmg item, if one of the copy destinations is “/tmp”, managedsoftwareupdate may crash immediately after mounting the disk image. The cause is too much recursion as an attempt to verify the destination is a directory enters an infinite loop.

This code has been present for months, so it’s not clear why the issue doesn’t affect Munki 7.3 and earlier, so I need to do more investigation.

In the meantime you can avoid the issue by changing the copy destination from “/tmp” to “/private/tmp”. Example:

Before:

<key>items_to_copy</key>
<array>
<dict>
<key>destination_path</key>
<string>/tmp</string>
<key>source_item</key>
<string>Maxon App Installer.app</string>
</dict>
</array>

After:

<key>items_to_copy</key>
<array>
<dict>
<key>destination_path</key>
<string>/private/tmp</string>
<key>source_item</key>
<string>Maxon App Installer.app</string>
</dict>
</array>

This change results in the items being copied to the same place (“/tmp” is a symlink pointing to "private/tmp”) but avoids the code path that leads to the infinite recursion.

The code fix is also pretty simple, but I want to understand why the issue isn’t presenting itself in Munki 7.3 and earlier to be sure I’m not missing something else.

-Greg

Gregory Neagle

unread,
Oct 30, 2026, 1:19:08 PM (11 days ago) Oct 30
to munki-...@googlegroups.com, munki-dev
OK, I’ve figured out why the bug was not triggered in Munki 7.3 and earlier, and so I’m more confident about a fix.

This change: https://github.com/munki/munki/commit/b73a1ef25ac2be0738b6d76c435ee28515e6cdca changes the createMissingDirs function to call pathIsDirectory(path, followSymlinks: true) in some scenarios. Previously, createMissingDirs never called pathIsDirectory.

pathIsDirectory has a bug that causes infinite recursion when given a symlink that points to a directory under /private. /tmp is an example. So are /etc and /var.

Prior to Munki 7.4, calling the createMissingDirs function never called pathIsDirectory, and so the bug was never triggered.

I should have a 7.4.1 release fixing this issue later today.

-Greg

--
You received this message because you are subscribed to the Google Groups "munki-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-discus...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/munki-discuss/ACBAA393-9C9C-46EB-8137-F3709E02AF5F%40mac.com.

Gregory Neagle

unread,
Oct 30, 2026, 2:24:31 PM (11 days ago) Oct 30
to munki-...@googlegroups.com, munki-dev
Reply all
Reply to author
Forward
0 new messages