10.15.4b2: 'sudo' and 'su' no longer work in Installer PKG 'preinstall' and 'postinstall' scripts

Our installer fails on 10.15.4 beta 2


This was working fine up until 10.15.4 beta 1 - It looks like Apple is no longer permitting use of su or sudo in installer scripts?


Is this deliberate? How are we supposed to place files on the hard drive and do other operations before and after our installer runs?


See logs below. Please advise if this is a bug or, if not, how we are supposed to proceed!


Feb 20 10:48:00 sqa-macpro-1 Installer[757]: @(#)PROGRAM:Install PROJECT:Install-1000

Feb 20 10:48:00 sqa-macpro-1 Installer[757]: @(#)PROGRAM:Installer PROJECT:Installer-965.1

Feb 20 10:48:00 sqa-macpro-1 Installer[757]: Hardware: MacPro7,1 @ 2.50 GHz (x 56), 98304 MB RAM

Feb 20 10:48:00 sqa-macpro-1 Installer[757]: Running OS Build: Mac OS X 10.15.4 (19E234g)

........

Feb 20 10:48:56 sqa-macpro-1 package_script_service[784]: ./preinstall: mac_vise_uninstall.sh: line 79: /usr/bin/sudo: Operation not permitted

Feb 20 10:48:56 sqa-macpro-1 package_script_service[784]: ./preinstall: mac_vise_uninstall.sh: line 81: /usr/bin/sudo: Operation not permitted

Feb 20 10:48:56 sqa-macpro-1 package_script_service[784]: ./preinstall: mac_vise_uninstall.sh: line 152: /usr/bin/su: Operation not permitted

.......

Feb 20 10:50:22 sqa-macpro-1 package_script_service[784]: ./postinstall: /tmp/PKInstallSandbox.YYRJze/Scripts/com.uaudio.installer.apollo.XE57af/postinstall: line 20: /usr/bin/su: Operation not permitted

Feb 20 10:50:22 sqa-macpro-1 package_script_service[784]: ./postinstall: /tmp/PKInstallSandbox.YYRJze/Scripts/com.uaudio.installer.apollo.XE57af/postinstall: line 39: /usr/bin/su: Operation not permitted

Feb 20 10:50:22 sqa-macpro-1 package_script_service[784]: ./postinstall: /tmp/PKInstallSandbox.YYRJze/Scripts/com.uaudio.installer.apollo.XE57af/postinstall: line 42: /usr/bin/su: Operation not permitted

Feb 20 10:50:22 sqa-macpro-1 package_script_service[784]: ./postinstall: /tmp/PKInstallSandbox.YYRJze/Scripts/com.uaudio.installer.apollo.XE57af/postinstall: line 43: /usr/bin/su: Operation not permitted

Replies

Adding some clarification:
In case anyone was wondering why we need "sudo" for copying files into place:


We are running our installer with admin privileges and we are using “sudo” so that we can run certain operations as the current user instead of with the current installer elevated privileges. In other words, we use sudo to make sure files are owned by the current user, and not that admin user.

I am encountering the same issue. However, I'm also seeing other commands like 'ps' failing too. Hopefully, this is just a temporary bug.

Thanks for your reply, fschilling. I took another look at my log and I also see 'ps' failing !!! This command is nowhere near as risky as 'sudo', so something is definitely wrong here.

Feb 20 10:50:22 sqa-macpro-1 package_script_service[784]: ./postinstall: mac_do_postinstall.sh: line 199: /bin/ps: Operation not permitted


@fschilling - Question: are you calling su and ps and other utilities directly from 'postinstall', or are you running a second sh script that calls those utilities? I am doing the latter.

@hcross I'm having the same issue calling ps directly from postinstall. The problem might come from package_script_service not setting UIDs correctly.

I am doing both. I call su and ps directly from the preinstall and postinstall scripts. I also call su from within a compiled command-line utility that is directly called from the postinstall script.

I just installed the new Beta 3 and the problem seems to be fixed for me.