Macjutsu / super

S.U.P.E.R.M.A.N. optimizes the macOS software update experience.
Apache License 2.0
605 stars 82 forks source link

Error getting account details for user account's with an apostrophe in their full name #160

Closed TechTrekkie closed 10 months ago

TechTrekkie commented 10 months ago

I'm running into an issue with a small handful of Macs set for userauth but the install script errors out when trying to get the account details to determine if they have a secure token. All of these users have an apostrophe for their full name which seems to be causing it to error and result in not finding the secure token. I've included a verbose log below for one of them. The user_real_name is blank though most likely because of the apostraphe.

on line 21 of the log below, it shows "xargs: unterminated quote" and then on line 25 shows "Parameter Error: Unable to determine account details for current user: dianaoh" The users full name in this case is Diana O'Haver Another example the users full name is A'yen Tran

Wed Oct 25 13:37:31 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: **** S.U.P.E.R.M.A.N. 4.0.0-rc1 - SUPER INSTALLATION WORKFLOW **** Wed Oct 25 13:37:31 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Installation: Copying super to: /Library/Management/super/super Wed Oct 25 13:37:31 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Installation: Creating super search path link: /usr/local/bin/super Wed Oct 25 13:37:31 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Installation: Creating super LaunchDaemon helper: /Library/Management/super/super-starter Wed Oct 25 13:37:31 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Installation: Removing previous super LaunchDaemon: /Library/LaunchDaemons/com.macjutsu.super.plist Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Installation: Creating super LaunchDaemon: /Library/LaunchDaemons/com.macjutsu.super.plist. Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Installation: Setting permissions for installed super items. Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: **** S.U.P.E.R.M.A.N. 4.0.0-rc1 - SUPER STARTUP WORKFLOW **** Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function workflow_startup: Verbose mode enabled. Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function workflow_startup: super_current_folder is: /Library/Application Support/JAMF/tmp Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function workflow_startup: Uptime is: 13:37 up 46 days, 22:26, 5 users, load averages: 4.11 4.11 4.21 Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Status: Mac computer with Apple silicon running: macOS Ventura 13.5-22G91 Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function check_system: macos_version_number is: 1305 Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function check_system: mac_model_name is: MacBook Pro Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function check_system: mac_is_portable is: TRUE Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Status: Last macOS startup was: 2023-09-08:15:11:00 Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function check_system: check_error is: FALSE Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function check_current_user: current_user_account_name_response is: dianaoh Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function check_current_user: current_user_id_response is: Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Status: Current GUI user name: dianaoh xargs: unterminated quote Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function check_current_user: current_user_id is: 503 Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function check_current_user: current_user_guid is: EF7C9384-15AF-47CD-AEDF-CDD4F41C20DF Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function check_current_user: current_user_real_name is: Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Parameter Error: Unable to determine account details for current user: dianaoh Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function check_current_user: current_user_is_admin is: FALSE Wed Oct 25 13:37:32 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function check_current_user: current_user_has_secure_token is: FALSE Wed Oct 25 13:37:33 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function check_current_user: current_user_is_volume_owner is: FALSE Wed Oct 25 13:37:33 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Status: Deleting all local (non-authentication) preferences. Wed Oct 25 13:37:33 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function get_preferences: auth_ask_user_to_save_password_backup: 1 Wed Oct 25 13:37:33 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function get_preferences: auth_local_account_backup: Wed Oct 25 13:37:33 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function get_preferences: auth_service_account_backup: Wed Oct 25 13:37:33 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function get_preferences: auth_jamf_client_backup: Wed Oct 25 13:37:33 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function get_preferences: auth_jamf_account_backup: Wed Oct 25 13:37:33 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function get_preferences: auth_legacy_local_account_backup: Wed Oct 25 13:37:33 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function get_preferences: auth_legacy_super_account_backup: Wed Oct 25 13:37:33 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function get_preferences: auth_legacy_jamf_account_backup: Wed Oct 25 13:37:34 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function get_preferences: Managed preference file: /Library/Managed Preferences/com.macjutsu.super: { AuthJamfComputerID = 5272; DeadlineCountFocus = 72; DeadlineDaysSoft = 2; DeferralTimerDefault = 60; DeferralTimerError = 60; DeferralTimerFocus = 60; DeferralTimerMenu = "30,60,120,240,480,1440,2160,2880"; DeferralTimerWorkflowRelaunch = 360; DialogTimeoutRestartOrDefer = 3600; DialogTimeoutSoftDeadline = 86400; InstallRapidSecurityResponses = 1; } Wed Oct 25 13:37:34 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function get_preferences: Local preference file before startup validation: /Library/Management/super/com.macjutsu.super: { AuthAskUserToSavePassword = 1; MacLastStartup = "2023-09-08:15:11:00"; SuperVersion = "4.0.0-rc1"; VerboseMode = 1; } Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Status: System is managed by Jamf Pro 10.50.0 hosted at: https://jss.zillowgroup.com:8443/ Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function check_jamf_management_framework: jamf_version_number is: 1050 Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: install_macos_major_upgrades_option is: FALSE Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: install_rapid_security_responses_option is: TRUE Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: install_non_system_updates_without_restarting_option is: FALSE Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: workflow_only_download_option is: FALSE Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: workflow_disable_update_check_option is: FALSE Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: workflow_disable_relaunch_option is: FALSE Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: workflow_restart_without_updates_option is: FALSE Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: deferral_timer_minutes is: 60 Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: deferral_timer_menu_minutes is: 30,60,120,240,480,1440,2160,2880 Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: deferal_timer_focus_minutes is: 60 Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: deferral_timer_error_minutes is: 60 Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: deferral_timer_workflow_relaunch_minutes is: 360 Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: deadline_count_focus is: 72 Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: deadline_days_soft is: 2 Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: dialog_timeout_restart_or_defer_seconds is: 3600 Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: dialog_timeout_soft_deadline_seconds is: 86400 Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: dialog_timeout_insufficient_storage_seconds is: 1800 Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: display_hide_background_option is: USERAUTH Wed Oct 25 13:37:35 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Status: No --display-icon-file icon found, copying default display icon from: /System/Library/PrivateFrameworks/SoftwareUpdate.framework/Versions/A/Resources/SoftwareUpdate.icns Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: sips_response is: /System/Library/PrivateFrameworks/SoftwareUpdate.framework/Versions/A/Resources/SoftwareUpdate.icns /Library/Management/super/icon.png Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: display_icon_size is: 96 Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: auth_credential_failover_to_user_option is: FALSE Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: test_mode_option is: FALSE Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: storage_required_update_gb is: 15 Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: storage_required_upgrade_gb is: 35 Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_parameter_options: power_required_battery_percent is: 20 Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Not Logged: Verbose Mode: Function manage_authentication_options: auth_user_password_keychain: security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain. Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_ask_user_to_save_password: TRUE Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_user_account_saved: FALSE Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_local_account_saved: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_service_account_saved: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_jamf_client_saved: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_jamf_account_saved: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_legacy_local_account_saved: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_legacy_super_account_saved: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_legacy_jamf_account_saved: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_local_account_option: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_service_add_via_admin_account_option: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_jamf_client_option: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_jamf_account_option: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_delete_all_option: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Status: A new automatic authentication password will be saved the next time a valid user succesfully authenticates a macOS update/upgrade. Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_user_account_saved: FALSE Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Not Logged: Verbose Mode: Function manage_authentication_options: auth_user_password_keychain: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_local_account_saved: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_service_account_saved: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_jamf_client_saved: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_jamf_account_saved: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_authentication_options: auth_error_new: FALSE Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Warning: Automatic macOS update/upgrade enforcement on Apple Silicon computers requires saved authentication credentials. Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Status: Manual user authentication is required to perform a macOS update/upgrade. Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_workflow_options: auth_error_user is: TRUE Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_workflow_options: workflow_auth_macos is: Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Auth Error: The current user "dianaoh" does not have a secure token, workflow can not continue. Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function manage_workflow_options: workflow_error is: TRUE Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Exit: Workflow validation failed. Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: Verbose Mode: Function exit_error: Local preference file at error exit: /Library/Management/super/com.macjutsu.super: { AuthAskUserToSavePassword = 1; DeadlineCountFocus = 72; DeadlineDaysSoft = 2; DeferralTimerDefault = 60; DeferralTimerError = 60; DeferralTimerFocus = 60; DeferralTimerMenu = "30,60,120,240,480,1440,2160,2880"; DeferralTimerWorkflowRelaunch = 360; DialogTimeoutInsufficientStorage = 1800; DialogTimeoutRestartOrDefer = 3600; DialogTimeoutSoftDeadline = 86400; DisplayHideBackground = USERAUTH; DisplayIconFileCachedOrigin = "/System/Library/PrivateFrameworks/SoftwareUpdate.framework/Versions/A/Resources/SoftwareUpdate.icns"; InstallRapidSecurityResponses = 1; MacLastStartup = "2023-09-08:15:11:00"; SuperStatus = "Wed Oct 25 13:37:36: Inactive Error: Workflow validation failed."; SuperVersion = "4.0.0-rc1"; VerboseMode = 1; } Wed Oct 25 13:37:36 ZG15938 Apple Software Update Script v4.0.0-RC1[37034]: **** S.U.P.E.R.M.A.N. 4.0.0-rc1 - ERROR EXIT ****

Macjutsu commented 10 months ago

Replace line 3498 with this one and please let me know if that works...

    current_user_real_name=$(dscl . read "/Users/${current_user_account_name}" RealName 2> /dev/null | tail -1 | sed -e 's/^ //g')
TechTrekkie commented 10 months ago

Yup, that worked! Thanks for the quick reply!

Macjutsu commented 10 months ago

https://github.com/Macjutsu/super/releases/tag/v4.0.0