1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

254 Commits

Author SHA1 Message Date
Jeremy Allison
932e337db8 r12213: Final fix for #3303 - send rename messages to smbd's
that have open file handles to allow them to correctly
implement delete on close. There is a further correctness
fix I'm intending to add to this to cope with different share
paths, but not right now...
Jeremy.
2007-10-10 11:05:49 -05:00
Jeremy Allison
9d93af713f r12203: Add the share path into the sharemode db. This involves
revving the minor version number for libsmbsharemodes (we
now have a new _ex interface that takes the share path
as well as the filename). Needed for #3303. Some code written
by SATOH Fumiyasu <fumiya@samba.gr.jp> included in the changes
to locking/locking.c. The smbstatus output is a bit of a mess
and needs overhauling...
Jeremy.
2007-10-10 11:05:49 -05:00
Jeremy Allison
6a902ec49f r11435: Allow the hash size of the tdb open (locking) database
to be set in local.h. Change from the default (131) to
another prime (1049). Should this be an smb.conf tunable parameter
based on the number of open file descriptors available ?
If so what scaling factor ? More tests to follow.
Jeremy.
2007-10-10 11:05:16 -05:00
Jeremy Allison
1134abbbb3 r11341: Put directory opens into the share mode db so we
can treat them similarly to file opens (delete on
close, share mode violations etc.). This fixes bug
#3216 I will up the default hash size on the locking
db in a later commit as this means more entries.
Jeremy.
2007-10-10 11:05:13 -05:00
Gerald Carter
939c3cb5d7 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
2007-10-10 11:04:48 -05:00
Jeremy Allison
c7fe18761e r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the torture
tests on this as it's very late NY time (just wanted to get this work
into the tree). I'll test this over the weekend....
Jerry - in looking at the difference between the two trees there
seem to be some printing/ntprinting.c and registry changes we might
want to examine to try keep in sync.
Jeremy.
2007-10-10 10:58:18 -05:00
Jeremy Allison
960a5d37d1 r7975: One more tidyup to ensure we're using "struct posix_lock".
Jeremy.
2007-10-10 10:58:05 -05:00
Jeremy Allison
f2bcfdddc7 r7972: Tidy up the posix locking in memory db code whilst I'm waiting for jht
to get back to me with a backtrace.
Jeremy.
2007-10-10 10:58:05 -05:00
Jeremy Allison
4f431dfc6b r6594: Fix silly typo causing tdb to be freed twice.
Jeremy.
2007-10-10 10:56:46 -05:00
Jeremy Allison
ec86ac4b28 r6543: Fix EDEADLCK problem with deferred open calls. Problem found by
"Hu, David J" <david.hu@hp.com>
Jeremy.
2007-10-10 10:56:44 -05:00
Herb Lewis
58e307664e r6502: add LOCKING debug class - pull PRINTINGDB class definition from trunk
so our numbers don't get out of sync
2007-10-10 10:56:43 -05:00
Jeremy Allison
ff4c201d93 r5634: Fix 64-bit overflow problems found by BlueArc torture tester.
We still have a few strange bugs with 64-bit locking values. I will
get traces.
Jeremy.
2007-10-10 10:55:51 -05:00
Jeremy Allison
b94db3a758 r5625: Reformat (tidy). 2007-10-10 10:55:51 -05:00
Jeremy Allison
0dd4adeae2 r4143: Make strict locking an enum. Auto means use oplock optimization.
Jeremy.
2007-10-10 10:53:36 -05:00
Jeremy Allison
f4feed8f90 r4121: Optimisation from Nadav Danieli <nadavd@exanet.com>. If we're oplocked,
short circuit some is_locked() tests.
Jeremy.
2007-10-10 10:53:35 -05:00
Jeremy Allison
596f230513 r4108: As check_self is *always* False in every invokation, remove the
logic for it. We still pass Samba4 RAW-LOCK test.
Jeremy.
2007-10-10 10:53:34 -05:00
Jeremy Allison
620f2e608f r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
2007-10-10 10:53:32 -05:00
Jeremy Allison
c6b144654a r3120: Fix bug #1955 reported by Love <lha@stacken.kth.se>. Inconsistent error return.
Jeremy.
2007-10-10 10:53:01 -05:00
Jeremy Allison
cf7f89999e r3050: Steal from Samba4 :-). Make us pass most of the new lock tests (except for
the cancel lock which I have to add).
Jeremy.
2007-10-10 10:52:59 -05:00
Andrew Tridgell
78e904c27b r3008: when checking for the existance of a lock we are only doing a single
tdb call, so there is no need to get the chainlock. This reduces the
number of tdb locking calls made on file IO
2007-10-10 10:52:59 -05:00
Jeremy Allison
e1bf108ae9 r2413: Arggg. Stupid, stupid, stupid me ! I added a paranoia test
case when I was developing the deferred open case and made it
too tight. It will fire (incorrectly) and panic when a client
does a second open for a file with a different mid (multiplex-id)
request. Doh ! This is a perfectly valid thing for a client to
do (have two pending opens with different mids outstanding on
the same file) and currently when the first pending open expires
with a share violation the paranoia code will panic smbd.

It's a rare condition, but obvious now I've looked at the
code.

Fix for bug #1743.

Jeremy.
2007-10-10 10:52:42 -05:00
Jeremy Allison
894cc6d162 r1085: Now it's had some proper user testing, merge in the deferred open fix. I'm
still doing more testing, but it fixes a behaviour that we've been wrong
on ever since the start of Samba.
Jeremy.
2007-10-10 10:51:54 -05:00
Gerald Carter
e65564ab4a r1011: fix bad merge (from a few months ago) and ensure that we always use tdb_open_log() instead of tdb_open_ex() 2007-10-10 10:51:53 -05:00
Jeremy Allison
40c77dddc6 r984: Ensure memmove & memcpy aren't called with len == 0.
Jeremy.
2007-10-10 10:51:52 -05:00
Gerald Carter
6e22c5da92 merge from old APP_HEAD
* remove corrupt tdb and shutdown (only for printing tdbs, connections,
  sessionid & locking)
* decrement smbd counter in connections.tdb in smb_panic()
* various Makefile hack to get things to link

'max smbd processes' looks like it might be broken.  The counter KEY is not
being set.  Will look into that tomorrow.
0001-01-01 00:00:00 +00:00
Jeremy Allison
e7565dbba6 Changes to allow Samba3 to pass the Samba4 RAW-READ tests.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
abf54b58e9 Tidy up some formatting. Get ready for allowing bad password lockout. (based
on a patch posted from Richard Renard <rrenard@idealx.com>.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
43fbc18fdc Final fix for the bug tridge found. Only push locks onto a blocking lock
queue if the posix lock failed with EACCES or EAGAIN (this means another
lock conflicts). Else return an error and don't queue the request.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
f93528ba00 Fixup a bunch of printf-style functions and debugs to use unsigned long when
displaying pid_t, uid_t and gid_t values.  This removes a whole lot of warnings
on some of the 64-bit build farm machines as well as help us out when 64-bit
uid/gid/pid values come along.
0001-01-01 00:00:00 +00:00
Jeremy Allison
84a7714eba More fixes for debug log to catch logic error.
Jeremy.
0001-01-01 00:00:00 +00:00
Alexander Bokovoy
c2689ed118 Prefix VFS API macros with SMB_ for consistency and to avoid problems with VFS_ macros at system side. We currently have one clash with AIX and its VFS_LOCK. Compiled and tested -- no new functionality or code, just plain rename of macros for yet-unreleased VFS API version. Needs to be done before a24 is out 0001-01-01 00:00:00 +00:00
Alexander Bokovoy
91984ef5ca Fix VFS layer:
1. Finally work with cascaded modules with private data storage per module
2. Convert VFS API to macro calls to simplify cascading
3. Add quota support to VFS layer (prepare to NT quota support)

Patch by Stefan (metze) Metzemacher, with review of Jelmer and me
Tested in past few weeks. Documentation to new VFS API for third-party developers to follow
0001-01-01 00:00:00 +00:00
Jeremy Allison
6999eef51c Fix for very subtle POSIX lock interaction race condition found by
Herb. We need to unlock POSIX locks before notifying pending lock
processes.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
766928bbba Fix to allow blocking lock notification to be done rapidly (no wait
for smb -> smb lock release). Adds new PENDING_LOCK type to lockdb
(does not interfere with existing locks).
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
d714254130 Merge off-by-one fix from HEAD (caused crash with --enable-developer) 0001-01-01 00:00:00 +00:00
Jeremy Allison
1698092ba5 When checking is_locked() new WRITE locks conflict with existing READ locks even
if the context is the same. See LOCKTEST7 in smbtorture.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
e9b4fb8b9a Fixes for HPUX only having limited POSIX lock range from Michael Steffens <michael.steffens@hp.com>
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
c1cfc296c2 Cleanups: (merge from HEAD)
- use safe_strcpy() instead of pstrcpy() for malloc()ed strings

 - CUPS: a failure in an attempt to automaticly add a printer is not level 0 stuff.

 - Fix up a possible Realloc() failure segfault

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
62038a0abf Fix problem with "hide unreadable". stat file opens are baaack :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
09a218a9f6 Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
5d5762d178 Lots of fixes for error paths where tdb_fetch() data need freeing.
Found via a post from Arcady Chernyak <Arcady.Chernyak@efi.com>.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
65e7b5273b sync'ing up for 3.0alpha20 release 0001-01-01 00:00:00 +00:00
Andrew Tridgell
03ac082dcb updated the 3.0 branch from the head branch - ready for alpha18 0001-01-01 00:00:00 +00:00
Jeremy Allison
3b1b8ac435 Fix the mp3 rename bug - also tidy up our open code and remove the special
cases for rename and unlink. Had to add desired_access into the share mode record.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e7ae8003cb if our lock spin code fails then return the first error code, not the
last one. This is what caused the lock1 and lock2 tests to fail.
0001-01-01 00:00:00 +00:00
Jeremy Allison
8587dd95f8 Use sys_usleep not usleep.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
62b80d5c65 Ensure we attempt to lock at least once. Only sleep if time param set.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
8aa9860ea2 include/smb_macros.h: Don't round up an allocation if the size is zero.
"One of these locks is not like the others... One of these locks is not
quite the same" :-). When is a zero timeout lock not zero ? When it's
being processed by Windows 2000 of course.. This code change, ugly though
it is - completely fixes the foxpro/access multi-user file system database
problems that people have been having. I used a *wonderful* test program
donated by "Gerald Drouillard" <gerald@drouillard.ca> which allowed me
to completely reproduce this problem, and to finally determine the correct
fix. This also explains why Windows 2000 is *so slow* when responding to
the smbtorture lock tests. I *love* it when all these things come together
and finally make sense :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e02d736470 this attempts to handle the rather bizarre lock cache semantics in
w2k. It isn't entirely accurate, but its close
0001-01-01 00:00:00 +00:00
Andrew Tridgell
8f7bf38de1 accept the 0/0 lock but don't treat it in any sort of special way 0001-01-01 00:00:00 +00:00