Andrew Tridgell [Thu, 4 May 2000 06:30:17 +0000 (06:30 +0000)]
more locktest improvements
the current preset tests show a very interesting NT bug - it sometimes
refuses a lock that it shouldn't.
Andrew Tridgell [Thu, 4 May 2000 06:29:13 +0000 (06:29 +0000)]
fixed message text
Andrew Tridgell [Thu, 4 May 2000 06:28:38 +0000 (06:28 +0000)]
if the stat cache is off then don't initialise it
Andrew Tridgell [Thu, 4 May 2000 04:14:23 +0000 (04:14 +0000)]
added -A analyze mode to locktest - it can now automatically prune
the list of locks that cause a failure
Andrew Tridgell [Thu, 4 May 2000 02:12:33 +0000 (02:12 +0000)]
found a much simpler case that kills the posix locking
Andrew Tridgell [Thu, 4 May 2000 02:01:48 +0000 (02:01 +0000)]
fixed a uninit memory read that insure found
Andrew Tridgell [Thu, 4 May 2000 01:40:51 +0000 (01:40 +0000)]
added ability to present lock tests
Jeremy Allison [Thu, 4 May 2000 00:29:50 +0000 (00:29 +0000)]
Fix for debug statement crash.
Jeremy.
Herb Lewis [Wed, 3 May 2000 22:29:54 +0000 (22:29 +0000)]
unicode code pages are detected as compiler intermediate file so set to
nostrip
Jeremy Allison [Wed, 3 May 2000 20:33:25 +0000 (20:33 +0000)]
Fix based on Elrond's code to reduce the store size on removing dead records.
Jeremy.
Jeremy Allison [Wed, 3 May 2000 19:37:47 +0000 (19:37 +0000)]
Fixed the bug locktest.c found, it was an off-by-one error in the non-overlap
case.
Jeremy.
Jeremy Allison [Wed, 3 May 2000 18:57:21 +0000 (18:57 +0000)]
Fixed silly bug where I wasn't checking for matching fd's in closing a file.
This caused smbd crashes on SIGKILL.
Jeremy.
Jeremy Allison [Wed, 3 May 2000 17:50:42 +0000 (17:50 +0000)]
Added range info to the panic message to track down the bug with
locktest.
Jeremy.
Andrew Tridgell [Wed, 3 May 2000 14:49:15 +0000 (14:49 +0000)]
improved the lock test program
Andrew Tridgell [Wed, 3 May 2000 14:29:05 +0000 (14:29 +0000)]
- clear dead locks at startup
- fixed a bug which caused lock records to not decrease in size
Andrew Tridgell [Wed, 3 May 2000 13:54:28 +0000 (13:54 +0000)]
added a nasty lock testing program
it opens 2 connections to each of 2 servers, and opens 2 fnums on the
same file on each connection (a total of 8 file descriptors)
then it does random lock/unlock/reopen requests in a 100 byte range on
the file and compares the results from the 2 servers.
strangely enough, NT fails this test against itself right now - I'm
still trying to figure that out.
Jeremy Allison [Wed, 3 May 2000 02:27:41 +0000 (02:27 +0000)]
Fix for stacking locks in brlock and POSIX. Windows only allows a read lock
to overlay a write lock on the same fnum. When overlaying read locks onto
a write lock, the number of locks is counted, and the first unlock removes
the write lock and downgrades this to a read lock. Do the same when mapping
to POSIX.
Jeremy.
Jeremy Allison [Wed, 3 May 2000 02:24:56 +0000 (02:24 +0000)]
Added read overlay write lock on same fnum test to locktest2.
Added locktest5 for locking stacks.
Jeremy.
Jeremy Allison [Wed, 3 May 2000 02:24:01 +0000 (02:24 +0000)]
Insure uninitialized memory read fixes.
Jeremy.
Herb Lewis [Wed, 3 May 2000 01:07:33 +0000 (01:07 +0000)]
merge 2.0 changes
Jeremy Allison [Tue, 2 May 2000 23:56:24 +0000 (23:56 +0000)]
Fixed wild pointer diff found by insure.
Jeremy.
Jeremy Allison [Tue, 2 May 2000 21:07:25 +0000 (21:07 +0000)]
Implemented the last (I hope:-) part of the locking puzzle, the reference
counting when Windows downgrades a write lock to a read lock, then reference
counts the unlocks to match the locks.
With this code the POSIX unlock isn't done until the final Windows unlock.
Jeremy.
Andrew Tridgell [Tue, 2 May 2000 15:31:55 +0000 (15:31 +0000)]
added support for deleting printers into the spoolss system
Andrew Tridgell [Tue, 2 May 2000 13:55:42 +0000 (13:55 +0000)]
split the username in the vuser structure into a separate
userdom_struct. As the name implies this also contains a domain
(unused at the moment).
This will be important shortly, as operation in appliance mode needs
the domain to be always carried with the username.
Andrew Tridgell [Tue, 2 May 2000 07:50:33 +0000 (07:50 +0000)]
and yet another memory leak - this one in the client
Andrew Tridgell [Tue, 2 May 2000 07:10:54 +0000 (07:10 +0000)]
fixed a memory leak (calling hash_table_init twice)
Andrew Tridgell [Tue, 2 May 2000 07:10:26 +0000 (07:10 +0000)]
fixed a memory leak
Jeremy Allison [Tue, 2 May 2000 03:20:47 +0000 (03:20 +0000)]
Moved uglyness needed in fcntl locking (64->32 bit mapping, NFS
errors etc.) into locking/posix.c, where it is needed. fcntl_lock in lib/util.c
is now very small and clean.
Added (*lock) op to vfs layer.
Jeremy.
Jeremy Allison [Tue, 2 May 2000 02:23:41 +0000 (02:23 +0000)]
Added sys_fork() and sys_getpid() functions to stop the overhead
of doing a system call every time we want to just get our pid.
Jeremy.
Jeremy Allison [Mon, 1 May 2000 19:43:50 +0000 (19:43 +0000)]
locking/posix.c: Fixed double-free nasty crash bug found by insure.
utils/make_smbcodepage.c:
utils/make_unicodemap.c: Insure 'make install' fixes.
Jeremy.
Andrew Tridgell [Mon, 1 May 2000 05:42:39 +0000 (05:42 +0000)]
handle tabs in printcap files
this is needed for lprng
Andrew Tridgell [Mon, 1 May 2000 05:42:09 +0000 (05:42 +0000)]
allow a DEFAULT_PRINTING to be specified in CFLAGS
Andrew Tridgell [Mon, 1 May 2000 00:48:41 +0000 (00:48 +0000)]
fixed typo
Andrew Tridgell [Mon, 1 May 2000 00:41:47 +0000 (00:41 +0000)]
added TDB_INTERNAL, TDB_NOLOCK and TDB_NOMMAP flags.
TDB_INTERNAL replaces the old method of passing a null filename
Andrew Tridgell [Sun, 30 Apr 2000 15:13:15 +0000 (15:13 +0000)]
- added some error checking
- removed the VTP hook in smbd
Andrew Tridgell [Sun, 30 Apr 2000 14:59:00 +0000 (14:59 +0000)]
fixed dptr_wcard handling (need to use strdup)
Andrew Tridgell [Sun, 30 Apr 2000 14:58:13 +0000 (14:58 +0000)]
fixed parsing of broken NT short name
Andrew Tridgell [Sun, 30 Apr 2000 14:37:57 +0000 (14:37 +0000)]
handle the special rule of *.* for old style listings when old_list is
true
Andrew Tridgell [Sun, 30 Apr 2000 14:34:31 +0000 (14:34 +0000)]
removed more cruft from our old wildcard matching code
Andrew Tridgell [Sun, 30 Apr 2000 14:30:47 +0000 (14:30 +0000)]
go back to ascii in SMB_FIND_FILE_BOTH_DIRECTORY_INFO
NT gives out unicode, but NT clients can't handle a unicode response!
Andrew Tridgell [Sun, 30 Apr 2000 14:29:45 +0000 (14:29 +0000)]
fixed our smbsearch code. We now store the mask with the dptr, this
turns out to be essential for a correct implementation (there ins't
enough room to store all possible masks in the status return
structure!)
Andrew Tridgell [Sun, 30 Apr 2000 14:27:39 +0000 (14:27 +0000)]
fix handing of ascii_to_unistr
Andrew Tridgell [Sun, 30 Apr 2000 14:26:59 +0000 (14:26 +0000)]
- get the findclose code right
- handle broken NT response to trans2 findfirst
Andrew Tridgell [Sun, 30 Apr 2000 12:34:26 +0000 (12:34 +0000)]
added cli_list_old() to allow for old style directory listing from
masktest
Andrew Tridgell [Sun, 30 Apr 2000 11:25:09 +0000 (11:25 +0000)]
some cleanups
Andrew Tridgell [Sun, 30 Apr 2000 11:15:27 +0000 (11:15 +0000)]
we don't need fnmatch.c any more
Andrew Tridgell [Sun, 30 Apr 2000 11:11:19 +0000 (11:11 +0000)]
changed masktest to test the internal algorithm against one server,
rather than 2 servers
Andrew Tridgell [Sun, 30 Apr 2000 11:04:28 +0000 (11:04 +0000)]
- removed all our old wildcard matching code and replaced it with a
call to ms_fnmatch(). This also removes all the Win9X semantics stuff
and a bunch of other associated cruft.
- moved the stat cache code into statcache.c
- fixed the uint16 alignment requirements of ascii_to_unistr() and
unistr_to_ascii()
- trans2 SMB_FIND_FILE_BOTH_DIRECTORY_INFO returns the short name as
unicode always (at least thats what NT4 does)
- fixed some errors in the in-memory tdb code. Still ugly, but doesn't
crash as much
Andrew Tridgell [Sun, 30 Apr 2000 04:45:16 +0000 (04:45 +0000)]
YIPEE!!!!!
We finally have a perfect emulation of Microsoft wildcard
matching. The routine ms_fnmatch() does wildcard matching with all MS
wildcards (including the unicode wildcards), and masktest against a
NT4 workstation with hundreds of thousands of random exmaples has not
found a single error.
amazingly it is only about 60 lines of code, but it has taken us years
to get it right. I didn't sleep much last night :)
Andrew Tridgell [Sat, 29 Apr 2000 04:05:38 +0000 (04:05 +0000)]
put tdb utility functions in a separate file
Jeremy Allison [Sat, 29 Apr 2000 01:09:31 +0000 (01:09 +0000)]
Removed tdb locking calls (picky Andrew...:-)
Jeremy Allison [Fri, 28 Apr 2000 21:09:26 +0000 (21:09 +0000)]
Moved deletion of vfs handle into smbd/conn.c as it was being done too
soon in smbd/service.c (file operations were being done after the
handle was closed).
It looks cleaner in smbd/conn.c as it is part of the closing of a conn
struct anyway.
Jeremy.
Jeremy Allison [Fri, 28 Apr 2000 20:54:23 +0000 (20:54 +0000)]
Ok - this is the *third* implementation of this (third time's the charm :-).
This implementation keeps all POSIX lock records in a separate in memory
tdb database only known about in locking/posix.c. In addition, the pending
close fd's are also held in a tdb which has an array of fd's indexed by
device and inode.
The walk-split code uglyness has been moved to posix.c from brlock.c,
which is the only place that needs to know about it, and the extra
functions hacked into brlock to expose internal state have been removed.
This implementation passes smbtorture locktest4, the only thing I need
to check now for completeness is what to do about lock upgrade/downgrades
which Win32 allows under some *very* strange circumstances.
Jeremy.
Jeremy Allison [Fri, 28 Apr 2000 19:38:38 +0000 (19:38 +0000)]
Split off of POSIX locking into separate unit as Andrew requested.
Done so I don't lose my edits... :-).
Jeremy.
Shirish Kalele [Fri, 28 Apr 2000 18:36:47 +0000 (18:36 +0000)]
Added info level 1005 to netsharegetinfo (is the share a DFS root)
Added dfs_server announcement in set_default_server_announce_type()
Jeremy Allison [Fri, 28 Apr 2000 02:06:19 +0000 (02:06 +0000)]
Added tdb_get/set_int_byblob, which takes a size_t len and then implemented
the tdb_get/set_int string functions in terms of them. Will be useful in storing
POSIX pending close records (which are ints but indexed by dev/inode pairs).
Jeremy.
Jeremy Allison [Fri, 28 Apr 2000 01:08:32 +0000 (01:08 +0000)]
Forgot to close when "posix locking" is set to False.
Jeremy.
Jeremy Allison [Fri, 28 Apr 2000 01:01:07 +0000 (01:01 +0000)]
Added optimization where we are single opener (don't free POSIX locks).
Jeremy.
Jeremy Allison [Fri, 28 Apr 2000 00:39:23 +0000 (00:39 +0000)]
Made changes suggested by Andrew review.
fd_close now calls fd_close_posix() directly.
set_posix_lock/release_posix_lock() now handle the reference counting.
More changes due when this gets moved to the file locking/posix.c
Jeremy.
Jeremy Allison [Thu, 27 Apr 2000 23:28:56 +0000 (23:28 +0000)]
Ok - this is more subtle than it looks :-).
When a file is being closed, once it passes the fnum and tid tests then
the locking context should be ignored when removing all locks. This is
what is done in the brl close case, but when you have outstanding
POSIX locks, then you cannot remove all the brl locks in one go, you
have to get the lock list and call do_unlock individually. As this
uses global_smbpid as the locking context, you need to make sure
that this is set correctly for the specific lock being removed. I
now do this by storing the smbpid in each entry in the unlock list returned from
the query call. I removed the smbpid from fsp (not needed) and
things seem ok (even with the stupid smbpid tricks that smbtorture plays :-).
Jeremy.
Jeremy Allison [Thu, 27 Apr 2000 22:23:04 +0000 (22:23 +0000)]
Fixed subtle unlocking bug when a file is closed. We need to store the
smbpid used when a file was opened in the files_struct. Else we use
the wrong global_smbpid when we are closing the file and trying to
remove the brl locks - this causes the brl locks to be left when the
file is closed as the samba_context check fails.
Jeremy.
Jeremy Allison [Thu, 27 Apr 2000 21:12:33 +0000 (21:12 +0000)]
Did the rewrite Andrew wanted where all knowledge of POSIX locking is
removed from the smbd/open.c code.
We now use a dlink list of structures indexed by dev/inode to store
all pending fd's for close. This could be rewritten to use lib/hash.c
if this is discovered to be too slow in use.
Andrew, please take a look and let me know if this is what you
had in mind.
Jeremy.
Jeremy Allison [Thu, 27 Apr 2000 18:46:10 +0000 (18:46 +0000)]
Fixed crash bugs Andrew pointed out with LOCK4 smbtorture
test. Was miscounting posix locks, plus was not taking into account
the case where other_fsp == fsp in the 'move locks' case. DOH ! This
code will be re-written anyway :-).
Jeremy.
Jeremy Allison [Thu, 27 Apr 2000 17:14:45 +0000 (17:14 +0000)]
Fixed range check on writeX.
Jeremy.
Jeremy Allison [Thu, 27 Apr 2000 16:53:31 +0000 (16:53 +0000)]
Tidyup of smbecho.
Jeremy.
Tim Potter [Thu, 27 Apr 2000 07:46:11 +0000 (07:46 +0000)]
file winbindd_ntdom.h was initially added on branch SAMBA_TNG.
Tim Potter [Thu, 27 Apr 2000 07:45:30 +0000 (07:45 +0000)]
file ntdom_config.h was initially added on branch SAMBA_TNG.
Andrew Tridgell [Thu, 27 Apr 2000 07:36:06 +0000 (07:36 +0000)]
quick hack to get smbtorture working again
Jeremy Allison [Tue, 25 Apr 2000 20:30:58 +0000 (20:30 +0000)]
Added the hard code :-).
HEAD should now map brl locks correctly into POSIX locks, including the
really nasty case of large range unlock.
There is a lot of pretty ASCII art in locking/brlock.c explaining
exactly how this code works. If it is unclear, please ask me.
Jeremy.
Andrew Tridgell [Tue, 25 Apr 2000 14:06:57 +0000 (14:06 +0000)]
moved trans2.h and nterr.h into includes.h with all our other includes
Andrew Tridgell [Tue, 25 Apr 2000 14:04:06 +0000 (14:04 +0000)]
split clientgen.c into several parts
the next step is splitting out the auth code, to make adding lukes
NTLMSSP support easier
Andrew Tridgell [Tue, 25 Apr 2000 01:17:45 +0000 (01:17 +0000)]
added TDB_MODIFY flag - patch from from luke
Andrew Tridgell [Tue, 25 Apr 2000 00:46:46 +0000 (00:46 +0000)]
fixed a memory leak in nmblookup
Andrew Tridgell [Tue, 25 Apr 2000 00:46:24 +0000 (00:46 +0000)]
fixed a memory leak of devmode in spoolss
this stuff is screaming out for talloc() rather than malloc/free
Andrew Tridgell [Tue, 25 Apr 2000 00:45:42 +0000 (00:45 +0000)]
don't qsort a list less than 2 entries
Jeremy Allison [Mon, 24 Apr 2000 20:48:40 +0000 (20:48 +0000)]
Added the code that keeps fd's open across a close if there are other fsp's
open on the same dev/inode pair with existing POSIX locks.
This is done at the smbd/open layer, so smbd just calls fd_close() and
the transfer of any open fd's is done under the covers of fd_close().
When an fsp is closed and no other fsp's open on the same dev/inode
pair have existing POSIX locks then all fd's associated with this fsp
are closed.
Now only the hard part of doing the POSIX range unlock code when read
locks overlap remains for full POSIX/SMB lock integration....
Jeremy.
Jeremy Allison [Mon, 24 Apr 2000 19:23:51 +0000 (19:23 +0000)]
Now that fsp's are created on successful file open, the structure member
fsp->open is no longer needed (if an fsp pointer is valid, then it's open :-).
NB for Luke, this patch also did not apply to TNG. TNG is not yet
identical w.r.t file serving with HEAD. This makes it impossible for
me to help maintain TNG. Please fix asap.
lib/substitute.c: Removed unused variable (pidstr).
Jeremy.
Andrew Tridgell [Mon, 24 Apr 2000 14:36:44 +0000 (14:36 +0000)]
dump in a binary format
Andrew Tridgell [Mon, 24 Apr 2000 14:36:25 +0000 (14:36 +0000)]
use an size_t not a ssize_t when checking for out of bounds errors
Andrew Tridgell [Mon, 24 Apr 2000 11:31:20 +0000 (11:31 +0000)]
moved INSURE hook into util.c
Andrew Tridgell [Mon, 24 Apr 2000 11:31:01 +0000 (11:31 +0000)]
fixed another memory leak
Andrew Tridgell [Mon, 24 Apr 2000 11:30:45 +0000 (11:30 +0000)]
fixed a parameter bug found by insure
Andrew Tridgell [Mon, 24 Apr 2000 11:30:24 +0000 (11:30 +0000)]
moved the INSURE hook into util.c
Andrew Tridgell [Sun, 23 Apr 2000 14:25:36 +0000 (14:25 +0000)]
more pstring/fstring errors found by insure
Andrew Tridgell [Sun, 23 Apr 2000 14:25:04 +0000 (14:25 +0000)]
fixed a locking database bug - it was actually harmless except that
smbstatus could display the wrong filename when files change dev/inum
after a rename
Andrew Tridgell [Sun, 23 Apr 2000 08:45:21 +0000 (08:45 +0000)]
don't close high fd's in smbrun when using insure (prevents closing
error fd)
Andrew Tridgell [Sun, 23 Apr 2000 08:44:55 +0000 (08:44 +0000)]
another fstring/pstring fix
Andrew Tridgell [Sun, 23 Apr 2000 08:40:54 +0000 (08:40 +0000)]
fixed another spoolss memory leak
I am falling in love with insure - it is finding _lots_ of memory
problems
Andrew Tridgell [Sun, 23 Apr 2000 08:31:10 +0000 (08:31 +0000)]
fixed a memory leak I caused last week with my lines[] changes
Andrew Tridgell [Sun, 23 Apr 2000 08:30:37 +0000 (08:30 +0000)]
split out standard_sub_basic() again to fix a bug where %p was being
substituted in the loadparm code and thus leaving lpq with no printer
Andrew Tridgell [Sun, 23 Apr 2000 08:13:48 +0000 (08:13 +0000)]
we can't pass a fstring to a routine expecting a pstring
Andrew Tridgell [Sun, 23 Apr 2000 08:13:12 +0000 (08:13 +0000)]
check for a valid snum when running a printing command
Andrew Tridgell [Sun, 23 Apr 2000 07:56:11 +0000 (07:56 +0000)]
Makefile.in change for split of printfsp.c
Andrew Tridgell [Sun, 23 Apr 2000 07:51:15 +0000 (07:51 +0000)]
split fsp specific routines out of printing.c to fix linking problem
in TNG
Andrew Tridgell [Sun, 23 Apr 2000 07:44:01 +0000 (07:44 +0000)]
fixed two uninitialised memory references
Andrew Tridgell [Sun, 23 Apr 2000 07:43:32 +0000 (07:43 +0000)]
trick to get full stack trace when using the free version of insure
Andrew Tridgell [Sun, 23 Apr 2000 07:42:13 +0000 (07:42 +0000)]
insure caught an uninitialised memory reference - ensure it starts as
zero
Andrew Tridgell [Sun, 23 Apr 2000 07:40:13 +0000 (07:40 +0000)]
avoided a memory leak in the ubi code by deleting a mangled cache
entry before adding to ensure that we don't ever add a duplicate entry
this code can be removed when ubi gets fixed
Andrew Tridgell [Sun, 23 Apr 2000 07:38:18 +0000 (07:38 +0000)]
fixed a prs memory leak (weren't freeing input buffer)
Andrew Tridgell [Sun, 23 Apr 2000 07:37:43 +0000 (07:37 +0000)]
if using insure then don't close fd 2