Cannot copy files from Mac to Samba

There is a new bug in MacOS 10.6.3 which presents problems when you copy files and directories from a Mac to any Samba server or NAS box using Samba or providing Windows (or CIFS or SMB) shares.

When you try to copy files and directories onto the Samba/NAS, you will get an error message about you not having permission.

The following workaround appears to work:

1. Copy all the files you want to put on the filestore into a new directory on your Mac, this just makes things easier. For this example we will call this directory "/Users/Jules/Documents/MyNotes".
2. Open the Applications folder in Finder, go into "Utilities" and run "Terminal".
3. Type the following commands exactly (even better: copy and paste them from here!), replacing the directory name with the location you used in step 1. Do not miss the dot at the end of 3 of the lines.
    cd /Users/Jules/Documents/MyNotes
    xattr -d -r .
    xattr -d -r .
    xattr -d -r .

You should now be able to copy your directory MyNotes over to the Samba server.