Re: Push a plist file to all users - ownership question
site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:mime-version:in-reply-to :references:content-type:message-id:content-transfer-encoding:from :subject:date:to:x-mailer; bh=rmk6d+kp6oEpkVrwwZatSe1e9zXfLf9B/DwvbAxyHiE=; b=nfhtwCz2eYYnXHnC0DeiL/0UbktIXQs4zXpo82U4lWkLmMveIsT69YHFVnqYZoebhl BteOdsAPRrdlUHjRsVC8f7qj44bbPHlTvrheJ6eBspNLamxsn/73sx2hM+rEuLOiXxQ+ KusRzesJMlns3B7aq5MzBb09XyqhRLqGPjZhw= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:content-type:message-id :content-transfer-encoding:from:subject:date:to:x-mailer; b=SkbRVFWxRrk2IbPzZGLTukmqFfMftCZB1T+/97V840Ua9962WaHS19s3pMKL1nI7+h mPxcCm4mc8s2ZboCQwyq97i5HkJi3bOkTG46OVv9Vy+6NQFBnLkKoN78pJIgq7TfXyIL WbKDnXu7n7e8UQWLsjoHjCfPSK00YD8faL3DI= On Nov 3, 2010, at 6:31 AM, Don Montalvo wrote: We can use ditto to copy the file to each user's home directory: http://s.sudre.free.fr/Software/files/bristow_src.zip _______________________________________________ Do not post admin requests to the list. They will be ignored. Installer-dev mailing list (Installer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/installer-dev/site_archiver%40lists.a... We have a plist file we need to push out to the User Template and all existing users. We can push them easily to the User template since we know the plist files need to be owned by root:wheel. However, putting a copy of this file in each existing user's home directory is proving to be a challenge. #!/bin/sh # # loop for i in $(/bin/ls /Users) do /usr/bin/ditto /System/Library/User\ Template/English.lproj/ Library/Preferences/com.mypreference.plist /Users/$i/Library/ Preferences/com.mypreference.plist done exit 0 But how do we then set the ownership of the file to each respective user? I hope it's something we can add to the above script. Perhaps another loop function? PS, This is a vendor provided plist file that isn't compatible with defaults command, so we have to push the file out to everyone. Another solution could be to code a helper tool which can access Directory Services. Directory Services is IMHO one of the less intelligible API on Mac OS X but it's possible to use existing code. For instance, you can start with the bristow source code (Cocoa) to get the list of users directory and the uid/gid: This email sent to site_archiver@lists.apple.com
participants (1)
-
Iceberg-Dev