开发者

Packagemaker permissions issues in OS X Lion

I have created a OS x pkg using package maker, that install a custom SDK and Xcode plug-in, the permissions of the payload are set to root:admin and chmod 775, as recommended.

That works fine on OS X 10.6(Snow Leopard) with Packages created with Xcode 3.2 and Xcode 4.0, but in OS X 10.7 (Lion) with Xcode 4.1, 开发者_如何学Pythonthe permissions of the files are some how changed to root:wheel

If i create the 10.7 package in 10.6, the permissions are set correctly. Any ideas if there was some change in 10.7 or Xcode 4.1 with respect package permissions?


PackageMaker, or rather /usr/sbin/installer, tends to disregard the owner and permissions that are specified when building the package. You have to set the owner and permissions of the payload before adding it to PackageMaker.

If you're building with packagemaker on the commandline make sure you specify --no-recommend, otherwise it'll apply "recommended" permissions from your system to the package.


I am not sure if this is what you want, but see the docs here: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/pkgbuild.1.html

specifically this part:

--ownership (recommended | preserve | preserve-other) By default, when the payload is archived into the package, the recommended UID and GID will be applied to all files. (Generally, this will be root:wheel, which ensures that files installed in the system domain are root-owned, while files installed in the user home directory will be owned by that user.) If you have special ownership requirements, you should use chmod(1) to adjust the ownership of the source files, and use --ownership preserve so that pkgbuild archives the exact ownership of the on-disk files. Alternatively, if you have just a few files to adjust, --ownership preserve-other will apply the recom-mended recommended mended UID and GID to those files that are owned by the user running pkgbuild, but leave other files unchanged. Note that pkgbuild never changes the ownership of the actual on-disk files, only the ownership that is archived into the package.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜