I have been using Create User Pkg for a while to create admin user accounts on our Macs through policy. It has worked well.
I use this to activate the root account on our Macs at imaging. I set a user id of "0", set the home directory to /var/root/, set the account type to Administrator and assign a password. It has never been problem, until now.
We have a couple of systems that have Apple fiber channel cards to connect to our StorNext SAN. Running this install package (no payload, just a post-install script) kills the ability of the machine to copy files over fiber. Copper connections are unaffected.
I installed a base 10.8.5 OS and setup the Xsan client. Copying files on the SAN worked fine. I ran Composer to get a snapshot of the box, then ran the installer. I captured the difference file with Composer.
Here is s list of the files affected:
/Library/Preferences/com.apple.TimeMachine.plist
/Library/Preferences/OpenDirectory/DynamicData/Active Directory/MYDOMAIN.plist
/private/etc/krb5.keytab
/private/var/audit/20141105212456.not_terminated
The Time Machine file is essentially irrelevant, and there are also some files in ~/Preferences that are modified, but this issue is not user-specific, so I have not included those files in the list.
I unbound the Mac from AD and deleted these files. I restarted the unit and re-bound it. The files were re-created. No joy. NOTHING I have been able to do short of wiping the drive and re-installing the OS seems to restore the ability to copy files over fiber. ALL other functionality seems fine. This has been verified several times now with wipe/re-install/ re-test/ verify. With a clean system and NOTHING done except running this script, it will reliably fail.
Does anyone have any idea what could be happening?
Here is the script that runs in the payload-free package:
#!/bin/bash
#
# postinstall for local account install
PlistArrayAdd() { # Add $value to $array_name in $plist_path, creating if necessary local plist_path="$1" local array_name="$2" local value="$3" local old_values local item
old_values=$(/usr/libexec/PlistBuddy -c "Print :$array_name" "$plist_path" 2>/dev/null)
if [[ $? == 1 ]]; then
# Array doesn't exist, create it
/usr/libexec/PlistBuddy -c "Add :$array_name array" "$plist_path"
else
# Array already exists, check if array already contains value
IFS=$'12'
for item in $old_values; do
unset IFS
if [[ "$item" =~ ^ *$value$ ]]; then
# Array already contains value
return 0
fi
done
unset IFS
fi
# Add item to array
/usr/libexec/PlistBuddy -c "Add :$array_name: string "$value"" "$plist_path"
}
ACCOUNT_TYPE=ADMIN # Used by read_package.py.
PlistArrayAdd "$3/private/var/db/dslocal/nodes/Default/groups/admin.plist" users "root" &&
PlistArrayAdd "$3/private/var/db/dslocal/nodes/Default/groups/admin.plist" groupmembers "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
if [ "$3" == "/" ]; then # we're operating on the boot volume
# kill local directory service so it will see our local # file changes -- it will automatically restart /usr/bin/killall DirectoryService 2>/dev/null || /usr/bin/killall opendirectoryd 2>/dev/null
fi
exit 0
