« Build WebAuth with Mac OS X Server 10.6 (Snow Leopard) | Main | ACLs not being properly honored in Samba with XP clients »

Extended attributes, Office 2007 clients via SMB from Xsan

We recently deployed Mac OS X 10.6.2 Server, sharing files on an Xsan volume via Samba to Windows users with Office 2007. When these PC users try to download or open the file, however, they got this warning, "Error Copying File or Folder. Cannot copy FILENAME: Cannot find the specified file. Make sure you specify the correct path and file name."

Some forums suggested adding two parameters at the very end of your /etc/smb.conf file:

    ea support = yes
    stream support = no

I've edited this entry to reflect some changes in late 10.6 Samba releases. Further, with the right smb.conf configuration, the changes below to various EAs  don't need to be made.

We I noticed that I could download the .doc files to my Mac via AFP, make a neglible modification and save the file, then upload it back to the SAN, my Windows colleagues could then view the file. When I did an ls -l@ on the file, I could see that this process added the com.apple.ResourceFork extended attribute. At this point, the modified Office files could be opened by my PC friends.

So, ironically, rather than deleting the EAs, I needed to apply this EA to the right files. It's probably OK to write this EA on each file and directory, but that's a little heavy handed. So instead, I executed this command:

find /Shares/Docs -name "*.doc" -print0 | xargs -0 sudo xattr -w com.apple.ResourceFork  

This will find the files with the .doc extension in my /Shares/Docs, add the extended attribute, and make everyone happy.

If you want to make it more thorough, you could try:

find . \( -name "*.doc" -or -name "*.docx" -or -name "*.xls" -or -name "*.xlsx" -or -name "*.ppt" -or -name "*.pptx" \) -print0 | xargs -0 xattr -w com.apple.ResourceFork   

One possible issue, though, is that if you apply this command too high up the hierarchy, it seems to make a problem. You might get this error: unable to execute /usr/bin/xattr: Argument list too long

You may wish to recursively apply this further down the directory tree.


TrackBack URL for this entry:

Comments (2)


we run into the same issue, XSan 2.2 with xattr, reshared via SMB&AFP. The strangest thing was that the error occur only when you try to copy to NTFS-formatted disks, and not FAT. What did the trick for us was to comment this line:

; vfs objects = darwinacl,darwin_streams

in /etc/smb.conf and restarting the server. Banged my head on the wall for two weeks over this!


Noah Abrahamson Author Profile Page:

That's what we do now, as a matter of course. At the top (where you're not supposed to edit things)

; vfs objects = notify_kqueue,darwinacl,darwin_streams
vfs objects = notify_kqueue,darwinacl

; The darwin_streams module gives us named streams support.
stream support = no
ea support = yes

... then at the bottom,

acl check permissions = no
nt acl support = no

path = /Volumes/storage/PerSharepoint
acl check permissions = no
nt acl support = no
level2 oplocks = no

Ostensibly, you can put different values for the same parameter in the [global] section below and, if they conflict with values earlier in the smb.conf file, they will be overridden, so I probably should not edit the top part of the conf file, as I risk my custom edits being erased at the next software update. No big deal, I just need to remember what I did and re-do things if they change.

One side effect that I think I can attribute to removing "darwin_streams" is you may not be able to even open or copy a file that's in use by someone else. This might be desirable, but the alternative, where you'd be able to open -- but not edit the file, is unavailable after these modifications. We encountered a user for whom this was a problem. She wanted to present PowerPoint slides to a group in a meeting, but the file was left open on the desktop of someone else in the office.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


This page contains a single entry from the blog posted on December 16, 2009 11:51 PM.

The previous post in this blog was Build WebAuth with Mac OS X Server 10.6 (Snow Leopard).

The next post in this blog is ACLs not being properly honored in Samba with XP clients.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Traffic analyzed by Google Analytics. Site powered by Movable Type 4.32-en