locking bug in libsmb/clientgen.c ???

INTC Network Operations noc at intc.net
Sun Jun 20 16:30:56 GMT 1999


Greetings,



<disclaimer>

Hopefully this is of the proper magnitude and substance for posting to
samba-technical and submission to samba-bugs as opposed to the help/admin
list.

My apologies for posting without lurking first, especially to a
development list!

</disclaimer>



BACKGROUND
----------

- Linux 2.0.35
- Samba 2.0.4b
- i386 architecture
- compiled with ecgs 1.0.3



PROBLEM
-------

- complaints of file corruption when multiple users access files
  simultaneously

- I can attempt to get smbstatus lock status info if desired/needed.



WHAT I FOUND
------------

- lock2, unlock1, and lock3 succeed in smbtorture's run_locktest2

  [lock2 succeeded] It seems to me from smbtorture.c that the smb server
  is not failing overlapping locks (with different int values returned by
  cli_open) when made by the same pid.

  [unlock1 succeeded] A pid can unlock another pid's lock.

  [lock3 succeeded] Lock request from another pid succeeds; is this
  because the prior unlock succeeded, or would it happen anyway?

- "error: lock3 0 succeeded" in smbtorture's run_locktest3

  [lock3 0 succeeded] I'm not sure I entirely understand this.  I skimmed
  the 'for' loop, but thought it best to ask outside advice.

I've looked at cli_lock and cli_unlock in libsmb/clientgen.c, and I cannot
see any locking allow/disallow intelligence.



WHAT TO DO?
-----------

I attempted to start writing an "unposixlock.c" module to handle these
things (via, say, shared memory) but... interfacing with existing Samba 
code? proper SMB behavior and response to send?

I think I need some advice and some help.  I don't mind cutting code, not
in the least, but I want to make sure that I am coding in the right
direction. :)



TIA,
Eddy

*-----------------------------\_/~~\_/----------------------------------*
  Edward Brotsman Dreger                 "Your Success is Our Success    
  Network & Systems Manager            Our Expertise is Your Advantage"  
  Brian's Consulting Services /~\__/~\   www.brics.com * 316-794-8922    
_________________________________________________________________________
SPAMbot bait:  abuse at localhost  postmaster at localhost  blacklist at brics.com



More information about the samba-technical mailing list