1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-07 01:58:28 +03:00

229 Commits

Author SHA1 Message Date
Jeremy Allison
e4df467320 Changes to allow Samba3 to pass the Samba4 RAW-READ tests.
Jeremy.
-
Gerald Carter
c17a7dc9a1 sync 3.0 into HEAD for the last time -
Simo Sorce
3101c236b8 port latest changes from SAMBA_3_0 tree -
Gerald Carter
adb98e7b7c trying to get HEAD building again. If you want the code
prior to this merge, checkout HEAD_PRE_3_0_0_BETA_3_MERGE
-
Jeremy Allison
0e2a47c1e6 More fixes for debug log to catch logic error.
Jeremy.
-
Jeremy Allison
eb861e9d0f Fix for very subtle POSIX lock interaction race condition found by
Herb. We need to unlock POSIX locks before notifying pending lock
processes.
Jeremy.
-
Jeremy Allison
22fc0d48ff 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.
-
Andrew Bartlett
e908fd164d Fix 2 off-by-one bugs in the use of malloc()ed strings and safe_strcpy().
safe_strcpy() isn't particularly safe (this has been noted before) as it does
not take the size of the buffer, but instead the size of the buffer *minus 1*

The locking.c fix was causing segfaults on machines running with
--enable-developer, and was tracked down thanks to the fact that vance's build
farm machine runs with such an option, and smbtorture's DIR1 test hits this
bug very well.

(The --enable-developer code writes to the last byte of the string, to check
for incorrect use of safe_strcpy()).

Andrew Bartlett
-
Jeremy Allison
b362cc241b When checking is_locked() new WRITE locks conflict with existing READ locks even
if the context is the same. See LOCKTEST7 in smbtorture.
Jeremy.
-
Jeremy Allison
ba0f47f78d Fixes for HPUX only having limited POSIX lock range from Michael Steffens <michael.steffens@hp.com>
Jeremy.
-
Andrew Bartlett
333d313c9d Use safe_strcpy() instead of pstrcpy() for malloced strings.
Andrew Bartlett
-
Jeremy Allison
6e0cfec165 Fix problem with "hide unreadable". stat file opens are baaack :-).
Jeremy.
-
Jeremy Allison
842e08e52a Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
-
Jeremy Allison
19f86f1f72 Lots of fixes for error paths where tdb_fetch() data need freeing.
Found via a post from Arcady Chernyak <Arcady.Chernyak@efi.com>.
Jeremy.
-
Jeremy Allison
c93b40f43d Fix missing braces around push lock call.
Jeremy.
-
Jeremy Allison
bd64a291a8 Failing to find an entry when doing mod_share_entry isn't a error
condition, as we look for the entry before locking the chain - thus
someone else could have legitimately deleted it.
Jeremy.
-
Jeremy Allison
255c68856e Fix unused warnings with deleted code.
Jeremy.
-
Andrew Tridgell
2728d13135 disabled the traversal of the brlock database at startup and
shutdown. I have just helped debug a very large Solaris server where
the traversal was taking so long that the clients timed out, created a
new process which in turn did a traversal!

we will need to find some other way of doing a brlock.tdb cleanup (if
its even needed at all)
-
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.
-
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.
-
Jeremy Allison
8587dd95f8 Use sys_usleep not usleep.
Jeremy.
-
Jeremy Allison
62b80d5c65 Ensure we attempt to lock at least once. Only sleep if time param set.
Jeremy.
-
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.
-
Andrew Tridgell
e02d736470 this attempts to handle the rather bizarre lock cache semantics in
w2k. It isn't entirely accurate, but its close
-
Andrew Tridgell
8f7bf38de1 accept the 0/0 lock but don't treat it in any sort of special way -
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
Jeremy Allison
ed5a9a0ee3 Debugs that print out a share mode table in debug level 10. This code
enabled me to track down a *nasty* bug.
Jeremy.
-
Jeremy Allison
32f4f3a45d Added DEBUG in set_share_mode to track down logic insanity.
Jeremy.
-
Tim Potter
f26e8205cf Removed unused function, delete_fn() -
Jeremy Allison
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.
-
Jeremy Allison
59cfcd8a6c Don't scan locking db on closedown.
Jeremy.
-
Jeremy Allison
058ae6b58f Move from timestamp to gen count file id's for finding oplocked files
in a tdb.
Jeremy.
-
Jeremy Allison
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.
-
Tim Potter
2d0922b0ea Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. -
Jeremy Allison
fc91ecc236 Removed test code that got added by accident.
Jeremy.
-
Jeremy Allison
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.
-
Jeremy Allison
b4b891279b Use structure copy to fix unaligned accesses on 64bit architectures on
Linux.
Jeremy.
-
Simo Sorce
e61aec84ed move to SAFE_FREE() -
Jeremy Allison
ce9f959964 Fix the 62bit locking onto 32 bit NFS mounts problem generically for HPUX.
Don. please check this out.
Jeremy.
-
Andrew Tridgell
c26e0d3f27 got rid of USE_TDB_MMAP_FLAG as its not needed any more -
Andrew Tridgell
b1b2a5fa5d use NTSTATUS not BOOL in do_lock() -
Andrew Tridgell
7b39c4c598 2nd DELETE_ON_CLOSE_FLAG fix ...
we set the DELETE_ON_CLOSE_FLAG on all share modes on the file, which
means the share mode in the fsp will not match the one in the tdb when
we come to close for other file handles, which means we end up with
share modes on files after all handles are closed

fixed by making the comparison function that says if two shares modes
are equal ignore the DELETE_ON_CLOSE_FLAG
-
Jeremy Allison
8fad517770 NFS v2 can return ENOLCK when greater than 31 bit offsets are used.
Treat this the same as an EFBIG error.
Jeremy
-
Andrew Tridgell
dcd6e735f7 the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but the client code still needs some work -
Andrew Tridgell
1d36250e33 converted another bunch of stuff to NTSTATUS -
Andrew Tridgell
1b778bc7d2 started converting NTSTATUS to be a structure on systems with gcc in order to make it type incompatible with BOOL so we catch errors sooner. This has already found a number of bugs -
Andrew Tridgell
83d9896c1e converted smbd to use NTSTATUS by default
major changes include:

- added NSTATUS type
- added automatic mapping between dos and nt error codes
- changed all ERROR() calls to ERROR_DOS() and many to ERROR_NT()
  these calls auto-translate to the client error code system
- got rid of the cached error code and the writebmpx code

We eventually will need to also:
- get rid of BOOL, so we don't lose error info
- replace all ERROR_DOS() calls with ERROR_NT() calls

but that is too much for one night
-
Jeremy Allison
bd9cbf4c68 Ignore locks of length zero as they mean different things in Win32
and POSIX.
Jeremy.
-
Jeremy Allison
f5ba19c129 Don't use CLEAR_IF_FIRST if opening read-only.
Jeremy.
-
Andrew Tridgell
98b6aef18c we now have all but the dreaded 0/0 lock working -