AIR 20 permission error on OSX when new runtime tries to rename *_32
As part of the AIR 20 release notes (AIR 64 bit on Mac OS X) - All new applications created by AIR developers will be running on this 64 big Runtime on Mac OSX, and all the existing shared, captive, and native applications will continue to work on this 64 bit Runtime on Mac OS X - any application built with earlier AIR SDK than 20 should work on newer Runtime, however there is scenario when the process gets into permission trap because of it's ways.
We have multiple AIR applications for both Windows and OSX. After updating to AIR 20 64 bit Runtime on OS X, several were continue to work expectedly except one. Our steps were as follows:
- We were running on AIR 19 and application ABC was working fine
- Install AIR 20.0.0.204
- ABC does not launch anymore
Doing investigation, we ran ABC manually in Terminal and its getting a permissions error on startup. It seems that AIR is automatically creating another copy of the executable with "_32" appended. However, ABC was installed as root, so this action gave a permissions error.
We were able to fix this with a chmod, but this is probably not an appropriate solution for the users.
We do not know why or how ABC was installed as root in the first place, but we should consider this a scenario, too.
Following is the Terminal output when we tried to run ABC after updating our OS X to AIR 20 Runtime:
host-camacminiprominicnet:~ joelanderson$ cd /ABC.app/
host-camacminiprominicnet:ABC.app joelanderson$ cd Contents/MacOS/
host-camacminiprominicnet:MacOS joelanderson$ ls
ABC
host-camacminiprominicnet:MacOS joelanderson$ ./ABC
2015-12-10 12:33:31.285 ABC[39131:34345711] renaming from
/Applications/ABC.app/Contents/MacOS/ABC to
/Applications/ABC.app/Contents/MacOS/ABC_32
2015-12-10 12:33:31.311 ABC[39131:34345711] renaming failed with this error: Error Domain=NSCocoaErrorDomain Code=513 "“ABC” couldn’t be moved because you don’t have permission to access “MacOS”." UserInfo=0x5079a0 {NSSourceFilePathErrorKey=/Applications/ABC.app/Contents/MacOS/ABC, NSUserStringVariant=(
Move
), NSFilePath=/Applications/ABC.app/Contents/MacOS/ABC, NSDestinationFilePath=/Applications/ABC.app/Contents/MacOS/ABC_32, NSUnderlyingError=0x507670 "The operation couldn’t be completed. Permission denied"}
Checking the permission of ABC:
host-camacminiprominicnet:MacOS joelanderson$ ls -lah
total 72
drwxr-xr-x@ 2 root wheel 102B Dec 9 05:34 .
drwxr-xr-x@ 4 root wheel 204B Dec 9 05:34 ..
-rwxr-xr-x@ 1 root wheel 34K Feb 2 2015 ABC
host-camacminiprominicnet:MacOS joelanderson$ ls -lah ..
total 16
drwxr-xr-x@ 4 root wheel 204B Dec 9 05:34 .
drwxr-xr-x@ 3 root wheel 102B Dec 9 05:34 ..
-rwxr-xr-x@ 1 root wheel 1.4K Dec 9 05:34 Info.plist
drwxr-xr-x@ 2 root wheel 102B Dec 9 05:34 MacOS
-rwxr-xr-x@ 1 root wheel 8B Feb 2 2015 PkgInfo
drwxr-xr-x@ 6 root wheel 272B Dec 9 05:34 Resources
Compared to EFG which works fine after updating to AIR 20 Runtime:
host-camacminiprominicnet:MacOS joelanderson$ ls -lah
total 144
drwxr-xr-x@ 2 joelanderson staff 136B Dec 10 12:29 .
drwxr-xr-x@ 4 joelanderson staff 204B Jun 4 2015 ..
-rwxr-xr-x@ 1 joelanderson staff 32K Nov 22 01:24 EFG
-rwxr-xr-x@ 1 joelanderson staff 34K Feb 2 2015 EFG_32
host-camacminiprominicnet:MacOS joelanderson$ ls -lah ..
total 16
drwxr-xr-x@ 4 joelanderson staff 204B Jun 4 2015 .
drwxr-xr-x@ 3 joelanderson staff 102B Jun 4 2015 ..
-rw-r--r--@ 1 joelanderson staff 1.3K Jun 4 2015 Info.plist
drwxr-xr-x@ 2 joelanderson staff 136B Dec 10 12:29 MacOS
-rw-r--r--@ 1 joelanderson staff 8B Feb 2 2015 PkgInfo
drwxr-xr-x@ 6 joelanderson staff 272B Jun 4 2015 Resources
Since AIR 20 Runtime creating it's own 64 bit executable and renaming existing executable as "_32" can turns error in different system. Renaming a root installed executable is one of such scenario, there could be more which we don't know yet. This is clear that if the permissions were always correct, this wouldn't be a problem. But since we can't rely on them being correct, apparently, we think we needs some valid steps to overcome such problem.
The only way we're seeing at this moment is if earlier AIR SDKs provide some ways to package our DMG/PKG with multiple executable (_32 and _64), then we might not have above like situation; new Runtime need not to create/rename executable and gets into any possible permission error. Though I am not sure about the feasibility, but we surely need some fix.
