System_Administrator@koppersarch.co.nz
2004-Mar-01 00:35 UTC
[Samba] Samba3.0.2a, MS Office (Excel), Save problem.
Hi all, I've done a brief search of the list archieves and cannot find any solutions to this problem, so I'll post my story and hopefuly someone will have a better answer. Brief Description: This problem has now occured with a number of users, running different versions of Office (see below). When saving documents, Office seems to set the read-only bit. The problem is best shown with Excel, which when saving a spredsheet, reports the following error: "The Document was saved succesfully, but Excel cannot re-open it because of a sharing violation. Please Close the Document and try again." More details: I use Excel in all my examples here, since I personally have only been able to get the bug to occur when using Excel, but others have reported it occuring in Word aswell. When opening the document in Excel, the permissions are fine, however when saving, for some reason excel sets the read-only bit, which gets translated in linux permissions to -r--rw-rw-. We are using extended ACLs, and Office always seems to muck arround with those bits anyhow. Here is an ls and getfacl of a directory and file that has been opened and saved with Excel. (usernames/filenames changed for security reasons). $ ls -l /home/users/bob/test/ total 2396 -r--rwx---+ 1 bob root 1188352 Mar 1 12:02 abc_sales.xls -rw-rwx---+ 1 bob root 1188352 Mar 1 12:33 xyz_sales.xls -r--rwx---+ 1 bob root 13824 Mar 1 12:27 booktest.xls -rwxrwx---+ 1 bob root 19968 Mar 1 12:27 sadfasdfasdfasdfasdf.doc $ getfacl /home/users/bob/test/ # file: home/users/bob/test # owner: bob # group: root user::rwx user:bob:rwx group::rwx group:domadm:rwx mask::rwx other::--- default:user::rwx default:user:bob:rwx default:group::r-x default:group:domadm:rwx default:mask::rwx default:other::r-x $ getfacl /home/users/bob/test/abc_sales.xls # file: home/users/bob/test/abc_sales.xls # owner: bob # group: root user::r-- group::rw- group:113:rwx group:domadm:rwx mask::rwx other::--- $ getfacl /home/users/bob/test/xyz_sales.xls # file: home/users/bob/test/xyz_sales.xls # owner: bob # group: root user::rw- user:bob:rwx group::rw- group:domadm:rwx mask::rwx other::--- The only thing I can think of thats worth noting in the above splattering of info is the acl on abc_sales.xls, the group:113:rwx, there is NO gid 113. A search of the LDAP directory AND of /etc/passwd reveals no gid 113, and noone belonging to any gid 113. (maybe a clue?). (oh, and no, that acl line wasn't there before Excel came along and screwed it). Products: The problem appears in Office 97, Office 2002, Office XP, and Office 2003. Though I believe the error message in Office 97 is different. The problem *may* be limited to Windows 2000 and above. As in, I've seen it happen on 2k and above, but not on 98. I've been running the Samba 3 pre-release and 3.0.2a samba versions and the problem has occured on both of them. What I've tried: Upgrading Samba (to 3.0.2a). Setting "force user mode" to 0600 Finally I tried setting "inhert acls = no" and "nt acl support = no". This SEEMS to have fixed it (at the cost of essentially disabling ACLs). Why is it happening? I don't know. Because this is a production enviornment, I haven't been able to recompile w/ debugging, nor have I had the time to look through detailed log files. Samba Info: Version: 3.0.2a, (precompiled Debian binary). (Also occured on custom 3 prerelease version compiled from source). Features in use: Extended ACLs, LDAP backend (storing all samba/linux user accounts, machine accounts, groups, etc). OS: Debian Woody. (running custom 2.4.21 kernel). Noteworthy things: I have not set anything to do with locking in the smb.conf file. All defaults regarding locking and oplocks are in place). Hopefully either this is a simple problem with a simple solution, or this helps anyone with the same problem as me, and hopefully a developer will spend the time to figure out the problem. Any other questions, let me know, Nick (btw - I'm away till Friday, so any replies will be delayed by that long).
Dear Nick, I had the same problem and it works for me with 'security = 770' setting in the share (using 3.0.2a as well). So ACLs usable, as far as I can understand 'force * mode' doesn't work (w/ ACL?). Hope it helps, Ralf -- Name: Ralf Tomczak Firma: scitech it solutions GmbH Adresse: Neuendorfstra?e 18 a 16761 Hennigsdorf Deutschland Gesch?ftlich: +49 (03302) 559505 Mobiltelefon: +49 (0173) 6040312 Fax gesch?ftl.: +49 (03302) 559320 E-Mail: r.tomczak@scitech-gmbh.de Webseite: http://www.scitech-gmbh.de
Dmitry Melekhov
2004-Mar-03 18:10 UTC
[Samba] Samba3.0.2a, MS Office (Excel), Save problem.
Hello! <quote> Brief Description: This problem has now occured with a number of users, running different versions of Office (see below). When saving documents, Office seems to set the read-only bit. The problem is best shown with Excel, which when saving a spredsheet, reports the following error: "The Document was saved succesfully, but Excel cannot re-open it because of a sharing violation. Please Close the Document and try again." </quote> We have the same problem! On 2.2.8a... Unfortunatley, we can't reproduce it :-( As I readed on news group, some people have the same problem on windows fileservers. May be this is Excel problem? After all we used dos filemode to allow not owners change read-only bit....
Pirkka Luukkonen
2004-Mar-04 06:52 UTC
[Samba] Samba3.0.2a, MS Office (Excel), Save problem.
Hi! I had the same problem with wxp_sp1+officexp, but it went away after patching with hotfixes. Check for DENY_WRITE or so from smbstatus -L. These patches will be included in the next xp service pack to be released on the first half of 2004. http://support.microsoft.com/default.aspx?scid=kb;EN-US;814112 -- Pirkka Dmitry Melekhov wrote:> Hello! > > <quote> > Brief Description: > This problem has now occured with a number of users, running > different versions of Office (see below). > When saving documents, Office seems to set the read-only bit. The > problem is best shown with Excel, which when saving a spredsheet, > reports the following error: > "The Document was saved succesfully, but Excel cannot re-open it > because of a sharing violation. Please Close the Document and try > again." > > </quote> > > We have the same problem! On 2.2.8a... > Unfortunatley, we can't reproduce it :-( > As I readed on news group, some people have the same problem on > windows fileservers. > May be this is Excel problem? > After all we used dos filemode to allow not owners change read-only > bit....
Dmitry Melekhov
2004-Mar-04 16:33 UTC
[Samba] Re: Samba3.0.2a, MS Office (Excel), Save problem.
<quote> My problem was really with XFS and Excel files in shared mode. Back to the previous example, after Tom saves the file, Tom becomes the owner of the file and Bob ends up in the ACL list. John comes along and saves the file. John becomes the owner and now Tom and Bob are now on the ACL list. XFS had a (random?) bug where the ACL list gets reset when you reach around 20 or so ACL entries. If this bug occurs when John saves the file, Tom and Bob's ACL entries get deleted along with the other entries. XFS was eventually replaced on my server with ReiserFS. </quote> Hello! I can't beleive this, sorry. ;-) I run Linux servers with xfs at least 3 years. Samba _never_ adds users to acls, and even don't change owner! Yes, Excel files are with new owner, but just because Excel creates new file instead of saving over. About reiserfs. AFAIK, many people run it without problems. But, imho, it is unstable. IMHO. So, good luck ! :-)
On Mon, 1 Mar 2004 System_Administrator@koppersarch.co.nz wrote:> Hi all, > > I've done a brief search of the list archieves and cannot find any > solutions to this problem, so I'll post my story and hopefuly someone will > have a better answer. > > Brief Description: > This problem has now occured with a number of users, running different > versions of Office (see below). > When saving documents, Office seems to set the read-only bit. The problem > is best shown with Excel, which when saving a spredsheet, reports the > following error: > "The Document was saved succesfully, but Excel cannot re-open it because > of a sharing violation. Please Close the Document and try again." > > More details: > I use Excel in all my examples here, since I personally have only been > able to get the bug to occur when using Excel, but others have reported it > occuring in Word aswell. > When opening the document in Excel, the permissions are fine, however when > saving, for some reason excel sets the read-only bit, which gets > translated in linux permissions to -r--rw-rw-. > We are using extended ACLs, and Office always seems to muck arround with > those bits anyhow.[ - snip - section with extra info ]> The only thing I can think of thats worth noting in the above splattering > of info is the acl on abc_sales.xls, the group:113:rwx, there is NO gid > 113. A search of the LDAP directory AND of /etc/passwd reveals no gid 113, > and noone belonging to any gid 113. (maybe a clue?). (oh, and no, that acl > line wasn't there before Excel came along and screwed it). > > Products: > The problem appears in Office 97, Office 2002, Office XP, and Office 2003.[ - snip - some more info ]> Why is it happening?In my deployment of Samba 3.0.2a to two production environments I came across this problem. I am not using ACLs in the underlying filesystem (ext3fs) on our Linux servers but files saved by Excel and Word (Office XP/2003) were getting Unix modes of 0444 (only the read flag set). In my case I was able to boil the problem down to the following combination of options: profile acls = yes nt acl support = yes If both of these are set for a share (nt acl support is enabled for all shares by default), Excel and Word will reset the file permissions to read-only for files saved. I suspect this has to do with Office applications trying to change the ACLs on files they manipulate. Regards, /Jonas Olsson