[pedevel] Re: "Bug" with files on a Samba share

  • From: Oliver Tappe <pedevel@xxxxxxxxxxxxxxx>
  • To: pedevel@xxxxxxxxxxxxx
  • Date: Sun, 21 Mar 2004 17:14:31 +0100

On 2004-03-21 at 15:46:11 [+0100], Rainer Riedl wrote:
> Hi,
> 
[ 8< problems with storing on Samba share 8< ]
> I talked to several people but Samba doesn't seem o be used widely.

Isn't it? Well, I use it here with Linux (Samba-2.2.8a) and I have just 
tried to reproduce the bug you are experiencing on my systems (R5 and 
R5+BONE). Strangely enough, I could save files living on samba shares just 
fine... >:o/

> So what to do?! Generally do the workaround doesn't seem to be a good 
> idea. Just checking if the file can be accessed doesn't seem to be 
> possible as e.InitCheck() and e.Exists() seem to fail to do the job. Any 
> ideas?!

Perhaps this is a problem with the access rights on the Linux-side: Are you 
sure that the user you are using to connect does have execute-permission on 
the directory the file you are trying to save lives in? Because this could 
be the reason why Eddie can save over the file (no execute-permission 
required) but why Pe can't (rename requires execution-permission)...

> One idea could be use something like 
>     do_overwrite = (e.Rename(bname.c_str(), true) != B_ENTRY_NOT_FOUND)
> instead of 
>     FailOSErr(e.Rename(bname.c_str(), true));
> and then later 
>     FailOSErr(dir.CreateFile(name, &file, do_overwrite))
> 

This sounds reasonable as a workaround once we are sure that there actually 
*is* a reproducible misbehaviour with BeOS' cifs-code. Unless we are sure 
about that, I'd rather not introduce awkward-looking workarounds.

> 
> Another thing here is, should the change the way the temporary backup is 
> made from rename-write to duplicate-overwrite:
> pro:  the icon would stay on the same place in Tracker con:  it would 
> double the time to save a file
> Perhaps this could be solved by restoring the Tracker position attributes

Hm, this might prove pretty hard, since there may be a race condition 
between Pe and Tracker's node monitor to write these attributes.

> Ah, on a side note, there seems to be another related "bug" that stresses 
> my nerves. I can't switch on "Verify open files for modification" - a 
> feature I like very much - as I very often work on shares. There pe 
> thinks every time the window get's focus that the content has changed.

Agreed, that bug surely is a bit of a pain, I will try to look into that 
one later on.

cheers,
        Oliver

Other related posts: