iTunes 12.7 Postinstall Action Script Issue

Originator:richard.uurazzle.glaser
Number:rdar://34719508 Date Originated:28-Sep-2017 12:21 PM
Status:Open Resolved:
Product:iTunes Product Version:12.7
Classification:Serious Bug Reproducible:Always
 
Summary:
Inside the standard iTunes 12.7  installer is a postinstall action script “startFpsdDaemons.sh” that has some issues that cause issues with tools like AutoPKG.

https://github.com/MagerValp/AutoDMG

Steps to Reproduce:
First, the script has permissions “-rw-r--r--”. So, group and others do not have execute permissions.

And has a syntax error on line 123.

logger -p  install.info "sudo killall adid”

Note, the last quote is a smart quote in unicode. Smart Quotes are a special kind of quotation mark where the opening-quote and the closing-quote are visually different. Sometimes they are also known as “curly quotes”. In many typographic settings, this is preferred to the more mundane “straight quote”. Many times will many times cause issues in scripts and code, you will get an error and the code won’t run.

The script is unable to run due to these issues and will get a syntax error once it has been ran.

/path/to/startFpsdDaemons.sh 
/System/Library/LaunchDaemons/com.apple.fpsd.plist: service already loaded
/path/to/startFpsdDaemons.sh: line 123: unexpected EOF while looking for matching `"'
/path/to/startFpsdDaemons.sh: line 129: syntax error: unexpected end of file

If the script doesn’t run properly, it will not create the _fpsd user, unload the  com.apple.fpsd.plist LaunchDaemon and properlykill adid and fpsd processes.

This causes iTunes to hang and become unresponsive. Manually installing the package doesn’t causes iTunes to hang but using open source tools like AutoDMG to create a image  will cause iTunes to hang. Fixing the permissions and the syntax error will make iTunes work properly using tools like AutoDMG, etc.


Expected Results:
Expect the script syntax errors and permissions to be fixed to work with other distribution tools like AutoDMG

Actual Results:
The script is unable to run due to these issues and will get a syntax error once it has been ran.

/path/to/startFpsdDaemons.sh 
/System/Library/LaunchDaemons/com.apple.fpsd.plist: service already loaded
/path/to/startFpsdDaemons.sh: line 123: unexpected EOF while looking for matching `"'
/path/to/startFpsdDaemons.sh: line 129: syntax error: unexpected end of file


Version:
12.7

Notes:
We fixed the script, removed the smart quote...

logger -p  install.info "sudo killall adid"

And changed permissions to "“-rwxr-xr-x”, giving group and others execute permisions.

So, now we get the following running the script:

/path/to/startFpsdDaemons.sh 
/System/Library/LaunchDaemons/com.apple.fpsd.plist: service already loaded
No matching processes were found
No matching processes were found

And created a package installer of the fixed script which fixes the issue in AutoDMG.

Comments

Blog Post

FYI, see blog post for more details:

https://apple.lib.utah.edu/itunes-12-7-postinstall-action-script-issue/

By richard.uurazzle.glaser at Sept. 28, 2017, 8:51 p.m. (reply...)

Note, at the beginning of this post I incorrectly reference AutoPKG, but should have been AutoDMG. Sorry about that.

By richard.uurazzle.glaser at Sept. 28, 2017, 7:39 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!