Bug 39827

Summary: Copying files using Windows Explorer under Windows 2000 SP2 asks to replace file
Product: Ports & Packages Reporter: matthewh <matthewh>
Component: Individual Port(s)Assignee: freebsd-ports (Nobody) <ports>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description matthewh 2002-06-25 06:50:01 UTC
      If you install the samba port and create a simple share on the freebsd machine all appears ok from the windows side until I try to copy a file.  When the file is copied using Windows explorer the dialog

+-------------------------------------------------------+
  This folder already contains a file named 'label.zip'.

  Would you like to replace the existing file
  0 bytes
  modified: Today, 25 June 2002, 5:39:07 PM

  with this one?
  1.50 KB
  modified: Tuesday, 18 June 2002, 3:51:27 PM

                                               YES  NO
+-------------------------------------------------------+

My smb.conf File follows:

#=================== Global Settings ===========================
[global]
   debug level = 3
   workgroup = NARNIA
   server string = Samba Server
   netbios name = POGO
   hosts allow = 192.168.1. 127.

   log file = /var/log/samba/log.%m
   max log size = 50
   security = user
   encrypt passwords = yes
   local master = yes
   domain master = yes
   os level = 33


#===================== Share Definitions =======================
[data]
  comment = Data share
  path = /data
  writeable = yes
  write list = @staff
  inherit permissions = yes

The data directory has the following permissions set.

bash-2.05a$ ls -ld /data
drwxrwxrwx  9 root  staff  512 Jun 25 17:41 /data
bash-2.05a$

On further investigation it appears as though Samba creates the file
before Windows 2000 has checked if it exists.  This might be a problem
in Win2K.  It seems to create a 0 length file before popping up the
message box.  This does not occur in WinNT 4.0(SP6a).

Is this a bug in Samba or the Port?

Fix: 

Unknown
How-To-Repeat:       See above in the description
Comment 1 matthew.hook 2002-07-19 06:59:58 UTC
After much looking into this I have discovered that it is not a problem
with the port as such
but is a problem with Samba on FreeBSD as I dowloaded the source
independant of
the port and tried it.  I've tried all sorts of configurations and even
tried turning off soft-updates
and still the problem keeps recurring.

This problem is serious enough that if a fix isn't found soon I'll have to
drop freebsd and go back
to using Linux.   This is a darn shame since I find using freebsd so much
less painless to use.

Matt
Comment 2 matthew.hook 2002-07-22 05:36:15 UTC
After installing Gentoo Linux and then Samba I have discovered that the
problem is
with Samba and nothing to do with any part of FreeBSD.

- Matt
Comment 3 matthew.hook 2002-07-22 05:53:52 UTC
I've now figured it out.

The Problem appears to be caused by Command Antivirus on Windows 2000.
I am running Command Antivirus at work (problem occurs on all servers
running samba).
But not on my home production system where I'm not running Command
Antivirus.

See here:
http://lists.samba.org/pipermail/samba-technical/2001-September/031288.html

To get around the problem either uninstall command anti-virus (unconfirmed)
or put:

oplocks = no

in smb.conf

That fixes the problem.

- Matt
Comment 4 Mario Sergio Fujikawa Ferreira freebsd_committer freebsd_triage 2002-08-04 19:13:00 UTC
State Changed
From-To: open->closed

Submitter reports problem fixed