vmware-samples / euc-samples

Workspace ONE UEM (previously AirWatch) Samples and Guidance
https://code.vmware.com/web/workspace-one
BSD 3-Clause "New" or "Revised" License
271 stars 148 forks source link

mUU sends malformed hubcli command when more than one point update is available for a major macOS version #301

Open lechlerjr opened 10 months ago

lechlerjr commented 10 months ago

Describe the bug

Have a Mac running macOS 13.6. It is missing macOS 13.6.1 and macOS 13.6.2.

:PublicAssetSets:macOS in /private/var/macOSUpdater/OS.plist has entries for both macOS 13.6.1 and macOS 13.6.2.

Line 1076 of macOSUpdater.sh greps "ProductVersion = $currentMajor" in which the return value is:

ProductVersion = 13.6.1 ProductVersion = 13.6.2

Once macOSUpdater.sh trims "ProductVersion =" out, it is left with

13.6.1 13.6.2

macOSUpdater then tries to send the following MDM command (as confirmed with Crescendo): /usr/local/bin/hubcli mdmcommand --osupdate --productversion 13.6.1\n13.6.2 --installaction DownloadOnly

This causes hubcli to return the man page for hubcli mdmcommand.

Reproduction steps

  1. Have a Mac that is running a version of macOS that is at least 2 point versions older than the latest version of macOS available. For example, current version of macOS Ventura as of this writing is macOS 13.6.2. So grab a Mac that is running macOS 13.6 (missing macOS 13.6.1 and macOS 13.6.2).
  2. Ensure mUU is configured to install "latest" version of macOS available and execute macOSUpdater.sh (either manually or as a WSONE script).

Expected behavior

When macOSUpdater.sh matches more than one major OS version in /private/var/macOSUpdater/OS.plist, it should pick the highest version number returned by the command in line 1076 of macOSUpdater.sh.

Additional context

No response

lechlerjr commented 10 months ago

Attaching sanitized copy of macOSupdater.log

macOSupdater.log

lechlerjr commented 10 months ago

Copy of /private/var/macOSUpdater/OS.plist

OS.plist.zip