OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Saving File Opened Via Samba Fails
daniel3000
post Mar 6 2006, 05:13 AM
Post #1





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



Hello,

I have a problem:

Most of the times I open a file (mostly Excel XLS) remotely on the desktop from the SD card in my Zaurus, which is acessed via SMB / Samba from the Windows desktop, it opens the file nicely, but when I save my changes, Windows says that it couldn't save the file because the file "is used by another user" (freely translated from german error message).
I am asked to save it temporarily under another name or discard my changes.

It does not happen with all files.
I have not found a pattern yet when it does happen and when not.

Sometimes it even says "File is read-only or encrypted" and refuses to open the file at all.

What could be the reason for this?
The file is not used by another user ot application at that time.

Thanks
daniel

edited: It's of course Samba, not NFS as I wrote before!
Go to the top of the page
 
+Quote Post
daniel3000
post Mar 6 2006, 06:12 AM
Post #2





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



Now I observed what's happening:

I open an excel file which has the rights -rwxrwxrwx root:root with Excel in Windows XP.
The file is stored on an ext2 FS in the Zaurus (SD card).

I modify the file and save it. no problem.
But after that, the file is -rwxr-xr-x zaurus:qpe

I open the file once more and modify it. Saving then fails with the hint that another user has locked the file.

Any way to tell Samba not to modify the owner and right settings?

thanks
daniel
Go to the top of the page
 
+Quote Post
bluedevils
post Mar 6 2006, 07:26 AM
Post #3





Group: Members
Posts: 1,284
Joined: 31-January 04
From: Vancouver, BC -> NYC, NY
Member No.: 1,633



well for one there is the mask option to keep the file 777 or was it the force mode option? One of them should force the mode you want. I'm not sure if there is an option that will retain the mode.

Ownership is another thing. I think there is a force user option too, but I'm unsure how to retain the original user of the file.
Go to the top of the page
 
+Quote Post
iamasmith
post Mar 6 2006, 07:29 AM
Post #4





Group: Members
Posts: 1,248
Joined: 6-July 04
Member No.: 3,928



Ownership is a problem... ownership is coming from the samba default config (smb.conf) because Excel always works on a copy of the file, deletes the original and then writes back under the original filename - thus current user = what is configured in smb.conf for anonymous access. (look for force user)

755 right is coming from the samba create mask. (see create mode in smb.conf)

-Andy
Go to the top of the page
 
+Quote Post
speculatrix
post Mar 6 2006, 03:46 PM
Post #5





Group: Admin
Posts: 3,281
Joined: 29-July 04
From: Cambridge, England
Member No.: 4,149



As I understand it, and experienced myself...

Samba will allow you to make the remote file appear as any arbitrary user on the local system, and thus apparently read-writable by that user.

HOWEVER, the actual ownership and protection on the file server might be quite different, so you might have read-only access in reality!
Go to the top of the page
 
+Quote Post
daniel3000
post Mar 9 2006, 05:36 AM
Post #6





Group: Members
Posts: 1,002
Joined: 28-April 05
From: Germany
Member No.: 7,027



I have further results.
With the owner and access right things I am clean now I think. However, there is still the same problem when working on Word and Excel files (and others, too).

The reason seems to be:

If I create a file in /mnt/card (ext2) using Windows rightclick in Explorer "new" / "Text file", the file is created with the file name "NewFile.txt" (verified with ls on the zaurus). Explorer asks user to rename the file to the wanted file name. Works. Filename: test1. (verified with ls on the zaurus).

If I create another file the same way, it works, too. Filename: test2.
If I create another file the same way, it works, too. Filename: test3.

Deleting test2 and test3 from Explorer works, too. (verified with ls on the zaurus).


Now I want to recreate test2 the same way I created it above. FAILS!
After giving the name in explorer, I get the error message
"error renaming file or directory - NewFile.txt cannot be renamed: Access denied") (freely translated from a German Windows version).

I end up having the files test2 and "NewFile.txt" in my directory.

Deleting "NewFile.txt" from Explorer fails (NewFile.txt cannot be deleted, access denied).
Deleting NewFile.txt directly on the Zaurus works without any problem.


So it seems the Samba system blocks access to a file which has been used before, i.e. forgets to remove a lock or something like that.
Recreating the "newfile.txt" still worked, but renaming it to the name of a file which has been deleted before fails. Strange, isn't it?
Any ideas?

Help would be greatly appreciated, as I often work on Zaurus files using a Windows Computer connected via network. This is annoying!

Maybe it's possible to entirely disable access right / locking stuff with Samba? That would definitely help, as I take care noone else is getting access to the data, the file sysem does not have to do this. But OTOH I need ext2 features because I have a build system on the card and files for which I need the atime feature (Inodes accesstime), which is not available in vfat.

Thank you very much
daniel
Go to the top of the page
 
+Quote Post
bluedevils
post Mar 9 2006, 06:39 AM
Post #7





Group: Members
Posts: 1,284
Joined: 31-January 04
From: Vancouver, BC -> NYC, NY
Member No.: 1,633



hmmm....could this be some sort of caching problem? Do oplocks come into play here? I couldn't reproduce this on a sun machine using samba. I'll have to check it out when I get home. I've never seen this behaviour
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 12th July 2014 - 05:25 PM