If you've tried to edit the ownership of your files in Leopard's Finder, you may have seen in the Get Info window that many of your files and folders belong to a group called "unknown," and that when you try to fix them, the Finder crashes. This is because in older versions of Mac OS X, users belonged to their own private groups with the same ID number as the user (e.g., 501/501). But in Leopard, users now have a primary group membership of staff (20). Unfortunately, if you updated your system to Leopard using the Archive/Install or Upgrade method, your existing users were left with their old membership values, and Leopard doesn't quite love them.
Fixing the problem requires several steps, including editing your user accounts' hidden options, fixing group ownership of your home folder, and sending some obscure commands to directory services in Terminal via the dscl command. Whew! To make things simpler, I've written a simple bash script that makes all the necessary changes. And here it is:
Mac OS X Hints