[Samba] Locking for Linux/WinXP clients (-or- CIFS issues)

Phill Gillespie it at snipef.org
Mon Oct 31 09:41:04 GMT 2005


Hi...

I've been running samba 3.0 for quite some time now (Debian's stable 
version, currently 3.0.14) and I've had no problems.  That's probably 
been because all my clients were Windows XP boxes.  I've now moved 
several users to Linux (Ubuntu Breezy) as their desktop and I've noticed 
there seems to be a problem in accessing files across the platforms.

If a Linux box opens a file and then another Linux box tries to open the 
same file it gets a read-only copy.  The same thing happens if an XP box 
opens the file and then another XP box tries to open it.  If a Linux box 
opens a file and then an XP box tries to open it nothing at all happens 
and if the XP box has the file open and a Linux box tries to open it I 
get a "general input/output error while accessing X" message from 
OpenOffice.org.

I though it might be something to do with the oplocks so I tested all 
possible combinations and the results stayed exactly as above.  The only 
thing that changed was the line from smbstatus:

No oplocks, XP opening file:
9868   DENY_WRITE 0x2019f     RDWR       NONE

No oplocks, Linux opening file:
9871   DENY_NONE  0x12019f    RDWR       NONE

Level 1 only, XP opening file:
9966   DENY_WRITE 0x2019f     RDWR       EXCLUSIVE+BATCH

Level 1 only, Linux opening file:
9968   DENY_NONE  0x12019f    RDWR       EXCLUSIVE

Level 1 and 2 oplocks, XP opening file:
10028  DENY_WRITE 0x2019f     RDWR       LEVEL_II   

Level 1 and 2 oplocks, Linux opening file:
10026  DENY_NONE  0x12019f    RDWR       EXCLUSIVE    (changes to NONE 
when a second linux box opens the file and gets Read-Only)


These problems only seemed to start when I added the Linux boxes to my 
network as they use CIFS rather than SMBFS (the fstab line is simply  
\\Greyskull\Intranet /home/phill/Snipef/Intranet cifs 
username=phill,passwd=phill 0  0)
Can somebody please help me change this so I can open a file on one 
platform and then be able to open it read-only on the other one.

Thanks in advance for any help,

P h i l l


---

Output from testparam:

Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[netlogon]"
Processing section "[profiles]"
Processing section "[printers]"
Processing section "[print$]"
Processing section "[finance]"
Processing section "[bpec]"
Processing section "[bpeccolour]"
Processing section "[xerox_top]"
Processing section "[xerox_mid]"
Processing section "[xerox_bot]"
Processing section "[hp_third]"
Processing section "[hp_second]"
Processing section "[Home]"
Processing section "[backup]"
Processing section "[CLS]"
Processing section "[Documents]"
Processing section "[Intranet]"
Processing section "[Mozilla]"
Processing section "[Phill]"
Processing section "[Programmes]"
Processing section "[Temporary]"
Processing section "[Win2k]"
Processing section "[WinXP]"
Processing section "[cdrom]"
Loaded services file OK.
Server role: ROLE_DOMAIN_PDC
Press enter to see a dump of your service definitions

# Global parameters
[global]
        workgroup = HE-MAN
        server string = Greyskull PDC server
        obey pam restrictions = Yes
        passdb backend = smbpasswd, guest
        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\sUNIX\spassword:* %n\n 
*Retype\snew\sUNIX\spassword:* %n\n .
        unix password sync = Yes
        log level = 2
        log file = /var/log/samba/log.%m
        max log size = 10000
        name resolve order = lmhosts host wins bcast
        time server = Yes
        printcap name = /etc/printcap
        add user script = /usr/local/sbin/add-samba-machine %u
        logon script = %m.bat
        logon path =
        logon drive = H:
        logon home = \\Greyskull\%U
        domain logons = Yes
        os level = 99
        preferred master = Yes
        domain master = Yes
        wins support = Yes
        message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm 
%s' &
        panic action = /usr/share/samba/panic-action %d
        admin users = root, phill
        printer admin = @ntadmin, root, phill
        print command = lpr -r -h -P'%p' %s
        hide files = /.Trash*/
        veto oplock files = /*.sxc/

[homes]
        comment = Home Directories
        read only = No
        create mask = 0700
        directory mask = 0700
        browseable = No

[netlogon]
        comment = Network Logon Service
        path = /home/samba/netlogon
        guest ok = Yes
        nt acl support = No
        locking = No

[profiles]
        path = /home/profile/
        read only = No
        create mask = 0600
        directory mask = 0700
        profile acls = Yes
        browseable = No

[printers]
        comment = All Printers
        path = /var/spool/samba
        guest ok = Yes
        printable = Yes
        browseable = No

[print$]
        comment = Printer Drivers
        path = /etc/samba/drivers
        write list = @ntadmin, root, phill
        guest ok = Yes
        browseable = No

[finance]
        comment = The OKI printer in Finance
        path = /var/spool/samba/oki_top
        printable = Yes
        printer name = oki_top

[bpec]
        comment = The OKI printer in BPEC
        path = /var/spool/samba/oki_bpec
        printable = Yes
        printer name = oki_bpec

[bpeccolour]
        comment = Epson Colour in BPEC
        path = /var/spool/samba/bpeccolour
        guest ok = Yes
        printable = Yes
        printer name = epson_bpec

[xerox_top]
        comment = Xerox Top
        path = /var/spool/samba/xerox_top
        guest ok = Yes
        printable = Yes

[xerox_mid]
        comment = Xerox Mid
        path = /var/spool/samba/xerox_mid
        guest ok = Yes
        printable = Yes

[xerox_bot]
        comment = Xerox Bot
        path = /var/spool/samba/xerox_bot
        guest ok = Yes
        printable = Yes

[hp_third]
        comment = HP Third
        path = /var/spool/samba/hp_third
        guest ok = Yes
        printable = Yes

[hp_second]
        comment = HP Second
        path = /var/spool/samba/hp_second
        guest ok = Yes
        printable = Yes

[Home]
        path = /home
        valid users = root, phill, tytus, denisebryson, megator
        read only = No
        browseable = No

[backup]
        path = /backup
        valid users = root, phill
        read only = No
        browseable = No

[CLS]
        path = /home/SAMBA/CLS
        read only = No
        create mask = 0777
        force create mode = 0777
        force directory mode = 0777
        guest only = Yes
        guest ok = Yes
        browseable = No

[Documents]
        path = /home/SAMBA/Documents
        read only = No
        create mask = 0777
        force create mode = 0777
        force directory mode = 0777
        guest only = Yes
        guest ok = Yes

[Intranet]
        comment = www folder
        path = /var/www
        read only = No
        create mask = 0775
        guest only = Yes
        guest ok = Yes
        browseable = No

[Mozilla]
        path = /samba/Mozilla
        read only = No
        guest only = Yes
        guest ok = Yes

[Phill]
        path = /samba/HomePhill
        valid users = phill
        force user = phill
        read only = No
        browseable = No

[Programmes]
        path = /samba/Programmes
        read only = No
        guest only = Yes
        guest ok = Yes

[Temporary]
        path = /samba/Temporary
        read only = No
        create mask = 0777
        force create mode = 0777
        force directory mode = 0777
        guest ok = Yes

[Win2k]
        path = /samba/Windows2k
        guest only = Yes
        guest ok = Yes

[WinXP]
        path = /samba/WindowsXP
        guest only = Yes
        guest ok = Yes

[cdrom]
        comment = Greyskull CD-ROM
        path = /cdrom
        guest ok = Yes
        locking = No
        preexec = /bin/mount /cdrom
        postexec = /bin/umount /cdrom





More information about the samba mailing list