kcrawford / dockutil

command line tool for managing dock items
http://patternbuffer.wordpress.com
Apache License 2.0
1.38k stars 131 forks source link

Can't import plist as Domain User #36

Closed lgrimm closed 10 months ago

lgrimm commented 9 years ago

Using a postinstall pkg script- dockutil is not installing an icon for the current logged in user:

The pkg succeeds but the log shows this error I get this on 10.8.5.

Dec 30 09:46:24 maccomp.global.domain.net.: ./postinstall: Sorry, user root is not allowed to execute '/usr/bin/defaults import /Users/grimml/Library/Preferences/com.apple.dock.plist /private/tmp/PKInstallSandbox.MXi7di/tmp/tmpKi7r0h' as grimml:LL\Domain Users on maccomp.global.domain.net.

Script:

!/bin/bash

Add My.app icons to existing users Dock

/usr/local/bin/dockutil --add '/Applications/Utilities/My.app' --allhomes

Sorry, user root is not allowed to execute '/usr/bin/defaults import /Users/grimml/Library/Preferences/com.apple.dock.plist /tmp/tmp4QBRZU' as grimml:LL\Domain Users on maccomp.global.domain.net.

Can you advise me on a solution?

Thanks very much

kcrawford commented 9 years ago

Sounds related to the use of sudo to run the defaults command as the user.

I don't have time to dig into it at the moment but you might have better luck with the 1.x version. 1.x kills cfprefsd rather than trying to run defaults as the user.

I switched to running defaults to try to avoid issues with killing cfprefsd, but when running as root, it is difficult to get defaults to behave correctly.

I'm not sure if the issue you are seeing is related to some sort of sand boxing Apple is doing in postflights or something about your environment.

Let me know if you figure anything out.

Kyle

Sent from Mobile

On Dec 30, 2014, at 11:33 AM, lgrimm notifications@github.com wrote:

Using a postinstall pkg script- dockutil is not installing an icon for the current logged in user:

The pkg succeeds but the log shows this error I get this on 10.8.5.

Dec 30 09:46:24 maccomp.global.domain.net.: ./postinstall: Sorry, user root is not allowed to execute '/usr/bin/defaults import /Users/grimml/Library/Preferences/com.apple.dock.plist /private/tmp/PKInstallSandbox.MXi7di/tmp/tmpKi7r0h' as grimml:LL\Domain Users on maccomp.global.domain.net.

Script:

!/bin/bash

Add My.app icons to existing users Dock

/usr/local/bin/dockutil --add '/Applications/Utilities/My.app' --allhomes

Sorry, user root is not allowed to execute '/usr/bin/defaults import /Users/grimml/Library/Preferences/com.apple.dock.plist /tmp/tmp4QBRZU' as grimml:LL\Domain Users on maccomp.global.domain.net.

Can you advise me on a solution?

Thanks very much

— Reply to this email directly or view it on GitHub.

kcrawford commented 10 months ago

Closing this old inactive issue. Please retest with latest dockutil and report back if you are still having the issue.