Zero byte files in ~/Library

cwaldrip
Valued Contributor

Has anyone else seen/dealt with this?

We image our machines with a generic user account, but we help some users (managers, etc) create personalized user accounts when needed. We just started noticing the following folders in the user's Library folder aren't being created - only zero byte files in their place. Which causes problems obviously.
- Calendars
- ColorSync
- Components
- Dictionaries
- KeyBindings
- Keychains
- Mail
- QuickLook

None of these exist in the UserTemplates folder, so they're created by the system during account creation (exist prior to even login in with the new account). The permissions on the English.lproj folder in User Templates looks normal, as do the files and folders in ~/Library/.

OS is 10.10.5, JSS and Casper Imaging 9.82

I haven't started the process of partial trial and error installs. I guess it could be a permissions issue, but I don't see it yet.

5 REPLIES 5

Look
Valued Contributor III

We have had this for a few folders at various times, it appears to be related to specific packages / applications although none of them contain the files in there installers.
My best guess is they are using the touch command which will create an empty file if none exists.
You can prevent it happening simply by having empty folders of the same names in the template user.
I have a simple script for just the keychains. But the something similar could easily be done for any other folders that were files instead.

#!/bin/bash
echo
if [[ ! -d /System/Library/User Template/English.lproj/Library/Keychains ]]; then
echo Creating Keychains template
mkdir /System/Library/User Template/English.lproj/Library/Keychains
else
echo Keychains template already exists
fi
for The_User in $(ls /Users/); do
if [[ -f /Users/$The_User/Library/Keychains ]]; then
echo Removing any faulty Keychains for $The_User
rm /Users/$The_User/Library/Keychains
else
echo No faulty Keychains for $The_User detected
fi
done

Edit: You generally don't need to make new folders as long as you remove the offending files, but if you have one that keeps breaking create a folder after removing the file.

mikeh
Contributor II

Funny. I ran into this exact same set of of zero-sized folders this week. My situation was the result of creating a local account with the same account name as an existing AD account. What I found is that the folders in question were owned by the network user, not the local user.

While I'm not sure exactly what's going on (the situation above isn't a normal situation for me), I'm suspecting Managed Preferences were causing the ownership problems. Maybe a Configuration Profile; Casper 9.82 did weird things with ConfigProfiles post-upgrade.

You might want to try this in the Terminal to see if you have an ownership problem:

ls -ln /Users/<username>/Library

The output will display the user numbers rather than the user name. Different ownership on the zero-sized folders should be immediately apparent.

Chris_Hafner
Valued Contributor II

Here's another thread where we've discussed this.

https://jamfnation.jamfsoftware.com/discussion.html?id=15425

I've found it to be caused by a few older packages I created using Composer (.dmg) and selecting FUT (Fill User Template). Rebuilding this disk image in the current version of composer seems to have solved the issue for me.

cwaldrip
Valued Contributor

Well, after a few hours of whittling it down It was a FUT packages. It's one we'd been using for a long while, but just never noticed the problem until now. :-

Chris_Hafner
Valued Contributor II

Have to jump back in and add that I recently repackaged the Garageband extra loops/content using composer 9.82, distributed with an .nbi using 9.81 (still, I know...) utilizing FUT. The issue reoccured for us! I will try again with a 9.9NBI and imaging just as soon as I get around to the update!