diff --git a/ee/tables/macos_software_update/SUSharedPrefs.h b/ee/tables/macos_software_update/SUSharedPrefs.h index 373ea024e..f7646fd7a 100644 --- a/ee/tables/macos_software_update/SUSharedPrefs.h +++ b/ee/tables/macos_software_update/SUSharedPrefs.h @@ -62,6 +62,7 @@ - (BOOL)bridgeOSUpdatesEnabled; - (BOOL)skipAPFSSnapshotting; - (BOOL)doesAllowBGStageWithoutInactivity; +- (BOOL)isMacOSAutoUpdateManaged; - (BOOL)isAutomaticallyCheckForUpdatesManaged; - (BOOL)isAutomaticallyCheckForUpdatesEnabled; - (BOOL)adminDeferredInstallEnabled; @@ -108,4 +109,3 @@ - (void)reloadPreferences; @end - diff --git a/ee/tables/macos_software_update/software_update_table.go b/ee/tables/macos_software_update/software_update_table.go index e39bff50e..5b3a7901a 100644 --- a/ee/tables/macos_software_update/software_update_table.go +++ b/ee/tables/macos_software_update/software_update_table.go @@ -49,6 +49,7 @@ func (table *osUpdateTable) generateMacUpdate(ctx context.Context, queryContext } var ( version = C.int(table.macOSBuildVersionPrefix) + isMacOSAutoUpdateManaged = C.int(0) isAutomaticallyCheckForUpdatesManaged = C.int(0) isAutomaticallyCheckForUpdatesEnabled = C.int(0) doesBackgroundDownload = C.int(0) @@ -59,6 +60,7 @@ func (table *osUpdateTable) generateMacUpdate(ctx context.Context, queryContext ) C.getSoftwareUpdateConfiguration( version, + &isMacOSAutoUpdateManaged, &isAutomaticallyCheckForUpdatesManaged, &isAutomaticallyCheckForUpdatesEnabled, &doesBackgroundDownload, @@ -70,7 +72,7 @@ func (table *osUpdateTable) generateMacUpdate(ctx context.Context, queryContext resp := []map[string]string{ { - "autoupdate_managed": fmt.Sprintf("%d", isAutomaticallyCheckForUpdatesManaged), + "autoupdate_managed": fmt.Sprintf("%d", max(isMacOSAutoUpdateManaged, isAutomaticallyCheckForUpdatesManaged)), "autoupdate_enabled": fmt.Sprintf("%d", isAutomaticallyCheckForUpdatesEnabled), "download": fmt.Sprintf("%d", doesBackgroundDownload), "app_updates": fmt.Sprintf("%d", doesAppStoreAutoUpdates), diff --git a/ee/tables/macos_software_update/sus.h b/ee/tables/macos_software_update/sus.h index d4c115e60..68cdfa025 100644 --- a/ee/tables/macos_software_update/sus.h +++ b/ee/tables/macos_software_update/sus.h @@ -7,6 +7,7 @@ extern void productNestedKeyValueFound(unsigned int, char*, char*, char*); // Gets software update config flags from SUSharedPrefs API void getSoftwareUpdateConfiguration(int os_version, + int* isMacOSAutoUpdateManaged, int* isAutomaticallyCheckForUpdatesManaged, int* isAutomaticallyCheckForUpdatesEnabled, int* doesBackgroundDownload, diff --git a/ee/tables/macos_software_update/sus.m b/ee/tables/macos_software_update/sus.m index 80bf248f8..f7e050288 100644 --- a/ee/tables/macos_software_update/sus.m +++ b/ee/tables/macos_software_update/sus.m @@ -6,6 +6,7 @@ #import void getSoftwareUpdateConfiguration(int os_version, + int* isMacOSAutoUpdateManaged, int* isAutomaticallyCheckForUpdatesManaged, int* isAutomaticallyCheckForUpdatesEnabled, int* doesBackgroundDownload, @@ -22,7 +23,12 @@ void getSoftwareUpdateConfiguration(int os_version, Class SUSharedPrefs = [bundle classNamed:@"SUSharedPrefs"]; id manager = [SUSharedPrefs sharedPrefManager]; - BOOL val = [manager isAutomaticallyCheckForUpdatesManaged]; + BOOL val = [manager isMacOSAutoUpdateManaged]; + if (val) { + *isMacOSAutoUpdateManaged = 1; + } + + val = [manager isAutomaticallyCheckForUpdatesManaged]; if (val) { *isAutomaticallyCheckForUpdatesManaged = 1; }