packages icon indicating copy to clipboard operation
packages copied to clipboard

Overwrite directory permissions option doesn't overwrite directory permissions

Open sidney-biomatters opened this issue 6 years ago • 6 comments

I'm running in Mojave using an id that is administrator and in the wheel group.

I created a small project that demonstrates the problem. I'm attaching the pkgproj file and the pkg file I built with it

testpackages.zip

In Settings, I selected "Require admin password for installation" and "Overwrite directory permissions"

In Payload I created directories /Library/Preferences/testfoo with owner root:wheel, permissions 775 /Library/Preferences/testfoo/testbar with owner root:wheel, permissions 777

I saved and built the project, then ran the pkg file, which created the directories with the proper permissions.

However, if I change permissions of the directories on the disk testfoo to 777 and/or change testbar to 775 and run the pkg again, the permissions of the directories are not changed.

Am I incorrect that the "Overwrite directory permissions" option means that the permissions should be overwritten by the installation, or is this a bug? If it is not a bug, what is the correct way to ensure that the permissions end up correct if the directories already exist with wrong permissions?

sidney-biomatters avatar Nov 13 '19 00:11 sidney-biomatters

@sidney-biomatters Do you have news about this ?

kriefsacha avatar Dec 01 '19 17:12 kriefsacha

@kriefsacha I know nothing about this other than what I posted in the issue. I worked around it for now by writing a post-install shell script that sets the permissions correctly.

sidney-biomatters avatar Dec 01 '19 20:12 sidney-biomatters

I created my pkg and it's telling me i don't have the required permissions , "Overwrite directoy permissions" is for this @sidney-biomatters ?

kriefsacha avatar Dec 02 '19 08:12 kriefsacha

Issue can be reproduced and has been reported to Apple as it's an issue in Apple's installation process.

Feel free to report the issue to Apple too.

packagesdev avatar Jun 18 '20 18:06 packagesdev

FWIW, I just tested this using Packages 1.2.8 running on MacOS 12 and it still doesn't work. The post install scripts seem to be the only workaround.

bgardner8008 avatar Aug 03 '22 21:08 bgardner8008

Apple's answer was that it works as designed (translation: it's broken like a lot of things in macOS and they won't fix it). This new design started with macOS Leopard.

The postinstallation script is the solution they suggest.

packagesdev avatar Aug 03 '22 21:08 packagesdev