1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-21 12:59:09 +03:00
Commit Graph

243 Commits

Author SHA1 Message Date
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
b94db3a758 r5625: Reformat (tidy). 2007-10-10 10:55:51 -05:00
0dd4adeae2 r4143: Make strict locking an enum. Auto means use oplock optimization.
Jeremy.
2007-10-10 10:53:36 -05:00
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
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
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
c6b144654a r3120: Fix bug #1955 reported by Love <lha@stacken.kth.se>. Inconsistent error return.
Jeremy.
2007-10-10 10:53:01 -05:00
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
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
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
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
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
40c77dddc6 r984: Ensure memmove & memcpy aren't called with len == 0.
Jeremy.
2007-10-10 10:51:52 -05:00
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.
-
e7565dbba6 Changes to allow Samba3 to pass the Samba4 RAW-READ tests.
Jeremy.
-
abf54b58e9 Tidy up some formatting. Get ready for allowing bad password lockout. (based
on a patch posted from Richard Renard <rrenard@idealx.com>.
Jeremy.
-
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.
-
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.
-
84a7714eba More fixes for debug log to catch logic error.
Jeremy.
-
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 -
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
-
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.
-
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.
-
d714254130 Merge off-by-one fix from HEAD (caused crash with --enable-developer) -
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.
-
e9b4fb8b9a Fixes for HPUX only having limited POSIX lock range from Michael Steffens <michael.steffens@hp.com>
Jeremy.
-
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
-
62038a0abf Fix problem with "hide unreadable". stat file opens are baaack :-).
Jeremy.
-
09a218a9f6 Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
-
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.
-
65e7b5273b sync'ing up for 3.0alpha20 release -
03ac082dcb updated the 3.0 branch from the head branch - ready for alpha18 -
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.
-
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.
-
8587dd95f8 Use sys_usleep not usleep.
Jeremy.
-
62b80d5c65 Ensure we attempt to lock at least once. Only sleep if time param set.
Jeremy.
-
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.
-
e02d736470 this attempts to handle the rather bizarre lock cache semantics in
w2k. It isn't entirely accurate, but its close
-
8f7bf38de1 accept the 0/0 lock but don't treat it in any sort of special way -
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
ed5a9a0ee3 Debugs that print out a share mode table in debug level 10. This code
enabled me to track down a *nasty* bug.
Jeremy.
-
32f4f3a45d Added DEBUG in set_share_mode to track down logic insanity.
Jeremy.
-
f26e8205cf Removed unused function, delete_fn() -
4098d44203 After conversations with Andrew, improved the robustness of the
sharemode db in the following way.

Originally, on startup and shutdown, smbd would scan the share mode
db to ensure it was correct. This lead to scalability issues as
scans lock the db for quite a long time. Andrew had the brainstorm
that we only care about the record we're about to read.

This new code (small change really, but quite significant) causes
get_share_modes() to do a process_exists() call against each pid
in each record, and to delete any that don't and re-write the
entry if any dead records were detected.

This allowed me to remove the startup/shutdown scans of the
db (they can be added into smbstatus if anyone really cares to
have them back). This will please the vfs author who was worried
about the time taken on open() calls, and will lead to much
greater robustness and scalability in the share mode db.

We need much testing of this, and also netbench tests to
ensure the extra process_exists() calls don't hurt performance
(they shouldn't it's a very simple system call).

Jeremy.
-
59cfcd8a6c Don't scan locking db on closedown.
Jeremy.
-
058ae6b58f Move from timestamp to gen count file id's for finding oplocked files
in a tdb.
Jeremy.
-
eac6bbd24e Ensure we mask off deny modes correctly on being set (this shouldn't have
caused problems but is tidier).
Fix debug statement in locking.c
Jeremy.
-
2d0922b0ea Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. -
fc91ecc236 Removed test code that got added by accident.
Jeremy.
-
22c5915bb4 Correct fix for unaligned memcpy - malloc'ed memory incremented by sizeof(struct locking_data)
was not forced to be 8 byte aligned. Use union to force it to be correctly aligned
for memcpy and use void *, to tell compiler not to optimize aligned copy (this last fix
suggested by Trond @ RedHat). The first fix should be sufficient, but this provides a
"belt and braces" fix.
Jeremy.
-