Jeremy Allison [Mon, 24 Jan 2000 23:12:02 +0000 (23:12 +0000)]
tdb record read error return check fix from Dave Airlie <airlied@samba.org>.
Jeremy.
Andrew Tridgell [Mon, 24 Jan 2000 03:39:24 +0000 (03:39 +0000)]
we need -lc when making shared objects or glibc doesn't do its magic
binding for stat()
Luke Leighton [Fri, 21 Jan 2000 02:33:21 +0000 (02:33 +0000)]
made cvs main up-to-date with samba_tng, with addition of process id to
msrpc loop-back interface.
Jeremy Allison [Thu, 20 Jan 2000 17:16:07 +0000 (17:16 +0000)]
Moved Herb's global -> local changes to HEAD.
Jeremy.
Jeremy Allison [Tue, 18 Jan 2000 05:11:29 +0000 (05:11 +0000)]
Added Herb's swat fixes.
Jeremy.
Herb Lewis [Mon, 17 Jan 2000 23:16:23 +0000 (23:16 +0000)]
test for pre- version numbers
Luke Leighton [Mon, 17 Jan 2000 23:01:23 +0000 (23:01 +0000)]
SAMR_R_UNKNOWN_38 is 3 uint16 params (4-byte aligned) followed by status code.
Andrew Tridgell [Sun, 16 Jan 2000 13:17:05 +0000 (13:17 +0000)]
fixed some typos in access_table() which, amaziingly enough, make no
difference to the result.
Andrew Tridgell [Sun, 16 Jan 2000 12:53:12 +0000 (12:53 +0000)]
made access_table() a pure logic function - makes it simpler to apply
maths to
Andrew Tridgell [Sun, 16 Jan 2000 12:28:43 +0000 (12:28 +0000)]
renamed DENY to DENY1
added DENY2 test that checks all 648 deny combinations for the case
of two opens on the same connection
Andrew Tridgell [Sun, 16 Jan 2000 12:27:20 +0000 (12:27 +0000)]
use GET_DENY_MODE() macro
Andrew Tridgell [Sun, 16 Jan 2000 12:26:42 +0000 (12:26 +0000)]
as obelix would say "these romans are crazy"
I've finally got the access table code right for the case where the
two opens are on the same connection. It is _incredibly_ complex, but
now all 1296 test cases pass.
I'll be very surprised if anyone by MS and us gets this right at
CIFS2000
Andrew Tridgell [Sun, 16 Jan 2000 12:24:01 +0000 (12:24 +0000)]
use GET_DENY_MODE() macro instead of the bit shift
Andrew Tridgell [Sun, 16 Jan 2000 11:24:07 +0000 (11:24 +0000)]
proto update
Andrew Tridgell [Sun, 16 Jan 2000 11:22:39 +0000 (11:22 +0000)]
a consequence of the access_table() fixes is that we can't treat
DENY_DOS and DENY_FCB as the same thing anymore (the difference
matters for *.exe files)
Andrew Tridgell [Sun, 16 Jan 2000 11:21:33 +0000 (11:21 +0000)]
rewrote the access_table() code to get it right for *.exe, *.dll,
*.sym and *.com files. I still find it incredible that SMB treats file
locking differently depending on the file name - that is so ugly it
stinks.
anyway, we now behave the same way as NT, except for the
same-connection case which I'm still working on.
Andrew Tridgell [Sun, 16 Jan 2000 11:18:04 +0000 (11:18 +0000)]
use string_set() instead of string_init()
bug pointed out by Richard
Andrew Tridgell [Sun, 16 Jan 2000 11:14:44 +0000 (11:14 +0000)]
added code to allow traversal of the byte range lock database
this is used with "smbstatus -B" to dump the lock list
Andrew Tridgell [Sun, 16 Jan 2000 11:09:32 +0000 (11:09 +0000)]
fixed a formatting error
Andrew Tridgell [Sun, 16 Jan 2000 11:07:11 +0000 (11:07 +0000)]
make string_init() static
use string_set() instead, to avoid the bug Richard discovered
Andrew Tridgell [Sun, 16 Jan 2000 11:06:00 +0000 (11:06 +0000)]
make a br_off a SMB_BIG_UINT
Jeremy Allison [Fri, 14 Jan 2000 23:50:38 +0000 (23:50 +0000)]
useable_space does not include the alignment offset calculations.
Bugfix from Marc_Jacobsen@hp.com.
Jeremy.
Jeremy Allison [Fri, 14 Jan 2000 21:16:59 +0000 (21:16 +0000)]
HP changes for registry querying.
Jeremy.
Jeremy Allison [Fri, 14 Jan 2000 19:34:57 +0000 (19:34 +0000)]
Added HP change.
Jeremy.
Andrew Tridgell [Fri, 14 Jan 2000 08:33:20 +0000 (08:33 +0000)]
casts and defines to make solaris happy
Andrew Tridgell [Fri, 14 Jan 2000 08:01:44 +0000 (08:01 +0000)]
damn, Solaris already has a "enum lock_type"
changed it to "enum brl_type"
Andrew Tridgell [Fri, 14 Jan 2000 04:32:57 +0000 (04:32 +0000)]
we now pass all byte range locking tests
the last piece was to use a smb timeout slightly larger than the
locking timeout in bloking locks to prevent a race
Jeremy Allison [Fri, 14 Jan 2000 01:49:56 +0000 (01:49 +0000)]
Updated docs for "inherit permissions" fix.
Jeremy.
Jeremy Allison [Fri, 14 Jan 2000 01:41:04 +0000 (01:41 +0000)]
Added "inherit permissions" patch.
Fixed locking bug found by Andrew.
Jeremy.
Andrew Tridgell [Fri, 14 Jan 2000 00:50:48 +0000 (00:50 +0000)]
some more work on the byte range locking
note the ugly global_smbpid - I hope that won't bethere for long, I
just didn't want to do two lots of major surgery at the one time.
Using global_smbpid avoids the big change of getting rid of our
inbuf/outbuf interface to reply routines. I'll do that once the
locking stuff passes all tests.
Andrew Tridgell [Thu, 13 Jan 2000 12:11:30 +0000 (12:11 +0000)]
greatly expanded the lock4 locking test. we now pass all but one test
- that should be fixed soon.
Andrew Tridgell [Thu, 13 Jan 2000 12:10:48 +0000 (12:10 +0000)]
changes to reflect the new syntax of the locking calls.
Andrew Tridgell [Thu, 13 Jan 2000 12:09:36 +0000 (12:09 +0000)]
the bulk of the new byte range locking coode
it doesn't map to posix locks yet, that will come later.
Andrew Tridgell [Thu, 13 Jan 2000 12:08:53 +0000 (12:08 +0000)]
the lock routines now take a enumerated type for read/write locks, and
we now don't pass the lock type at all for unlocks.
I was surprised to discover that NT totally ignores the lock type in
unlocks. It unlocks a matching write lock if there is one, otherwise
it removes the first matching read lock.
Andrew Tridgell [Thu, 13 Jan 2000 12:06:39 +0000 (12:06 +0000)]
added Enosuchshare and a lock_type enum
Andrew Tridgell [Thu, 13 Jan 2000 12:05:58 +0000 (12:05 +0000)]
new prototypes
Andrew Tridgell [Thu, 13 Jan 2000 12:05:40 +0000 (12:05 +0000)]
defined br_off as a type for byte range offsets. For now I've set it
as SMB_OFF_T, we need to do some autoconf changes to generate a 64 bit
int whenever possible (eg. long long on 32 bit i386)
Andrew Tridgell [Thu, 13 Jan 2000 12:04:31 +0000 (12:04 +0000)]
added locking/brlock.c, a byte range locking system
Jeremy Allison [Thu, 13 Jan 2000 00:42:04 +0000 (00:42 +0000)]
Added missing #ifdef for WITH_UTMP.
Jeremy.
Jeremy Allison [Wed, 12 Jan 2000 03:09:17 +0000 (03:09 +0000)]
Added utmp fix from David Lee <T.D.Lee@durham.ac.uk>.
Jeremy.
Jeremy Allison [Wed, 12 Jan 2000 02:52:42 +0000 (02:52 +0000)]
Use slprintf not snprintf.
Jeremy.
Jeremy Allison [Wed, 12 Jan 2000 02:52:02 +0000 (02:52 +0000)]
Fix problems with broken libc fvct returns.
Jeremy.
Jeremy Allison [Tue, 11 Jan 2000 20:12:46 +0000 (20:12 +0000)]
Fixed pointer arithmetic found by IRIX compiler.
Jeremy.
Jeremy Allison [Tue, 11 Jan 2000 02:18:46 +0000 (02:18 +0000)]
Fixed bug in unix_mask_match() that caused veto files not to work.
Jeremy.
Luke Leighton [Tue, 11 Jan 2000 02:00:31 +0000 (02:00 +0000)]
modified smbd/msrpc credential transfer system. user session key
is *missing* from samba cvs main, therefore it is set to all zeros.
this will cause, amongst other things, administrator-changing-user-passwords,
and setting up new accounts, to fail, as the user's password can only be
decoded with the session key (in this case, the administrator's usr sess key).
it's never a perfect world, is it?
Andrew Tridgell [Mon, 10 Jan 2000 14:41:20 +0000 (14:41 +0000)]
I'm currently designing a new locking system (using a tdb database!)
that will make us match NT semantics exactly and do away with the
horrible fd multiplexing in smbd.
this is some diag stuff to get me started.
- added the ability to do read or write locks in clientgen.c
- added a LOCK4 test to smbtorture. This produces a report on the server
and its locking capabilities. For example, NT4 gives this:
the same process cannot set overlapping write locks
the same process can set overlapping read locks
a different connection cannot set overlapping write locks
a different connection can set overlapping read locks
a different pid cannot set overlapping write locks
a different pid can set overlapping read locks
the same process can set the same read lock twice
the same process cannot set the same write lock twice
the same process cannot override a read lock with a write lock
the same process can override a write lock with a read lock
a different pid cannot override a write lock with a read lock
the same process cannot coalesce read locks
this server does strict write locking
this server does strict read locking
whereas Samba currently gives this:
the same process can set overlapping write locks
the same process can set overlapping read locks
a different connection cannot set overlapping write locks
a different connection can set overlapping read locks
a different pid can set overlapping write locks
a different pid can set overlapping read locks
the same process can set the same read lock twice
the same process can set the same write lock twice
the same process can override a read lock with a write lock
the same process can override a write lock with a read lock
a different pid can override a write lock with a read lock
the same process can coalesce read locks
this server does strict write locking
this server does strict read locking
win95 gives this - I don't understand why!
the same process cannot set overlapping write locks
the same process cannot set overlapping read locks
a different connection cannot set overlapping write locks
a different connection cannot set overlapping read locks
a different pid cannot set overlapping write locks
a different pid cannot set overlapping read locks
the same process cannot set the same read lock twice
the same process cannot set the same write lock twice
the same process cannot override a read lock with a write lock
the same process cannot override a write lock with a read lock
a different pid cannot override a write lock with a read lock
the same process cannot coalesce read locks
this server does strict write locking
this server does strict read locking
Andrew Tridgell [Mon, 10 Jan 2000 13:40:27 +0000 (13:40 +0000)]
don't treat a packet as a oplock break unless it is a request, not a
reply!
Andrew Tridgell [Sat, 8 Jan 2000 11:37:45 +0000 (11:37 +0000)]
extent smbtorture to test with both an exe file and a dat file
Andrew Tridgell [Sat, 8 Jan 2000 11:32:00 +0000 (11:32 +0000)]
fix a error in access_table revealed by the new deny test in smbtorture. We now exactly match NT for normal files. We still don't match for *.exe files though
Andrew Tridgell [Sat, 8 Jan 2000 10:15:53 +0000 (10:15 +0000)]
cli_open() wasn't handling DENY_FCB or O_WRONLY correctly.
After fixing that I needed to use O_RDWR instead of O_WRONLY in
several places to avoid the silly bug in MS servers that doesn't allow
getattrE on a file opened with O_WRONLY
Andrew Tridgell [Sat, 8 Jan 2000 09:49:52 +0000 (09:49 +0000)]
added a DENY test that tests deny mode handling. It produces a matrix
of 324 lines (6*6*3*3) of all possible deny mode behaviour. This
allows us to compare with NT. We currently don't match :)
Andrew Tridgell [Sat, 8 Jan 2000 08:16:02 +0000 (08:16 +0000)]
improved the error checking
Richard Sharpe [Sat, 8 Jan 2000 05:53:40 +0000 (05:53 +0000)]
Fix minor typos in the yodl for smb.conf.5 and fix minor English problems :-)
Jeremy Allison [Sat, 8 Jan 2000 02:16:15 +0000 (02:16 +0000)]
smbd/mangle.c
smbd/negprot.c: Tidyup of static initializers.
smbd/server.c: Fix -l option.
Jeremy.
Jeremy Allison [Sat, 8 Jan 2000 01:23:13 +0000 (01:23 +0000)]
Fixed deny mode bug :
: If a file is resident on NT and the first user opens it read/write with DENY_READ then a subsequent
: attempt by a second user (running under Windows 95) to open it read/write DENY_NONE fails.
: Under samba 2.0.5a the second open succeeds but the file is write only.
Jeremy.
Andrew Tridgell [Fri, 7 Jan 2000 12:40:34 +0000 (12:40 +0000)]
fixed a comment
Andrew Tridgell [Fri, 7 Jan 2000 08:49:46 +0000 (08:49 +0000)]
the -i options are gone from nmbd and smbd - use the smb.conf
parameter "netbios scope" instead
-i is still available in the command line utils, as these may be used
to contact another scope
Andrew Tridgell [Fri, 7 Jan 2000 08:48:04 +0000 (08:48 +0000)]
netbios scope is a DOS_STRING
Andrew Tridgell [Fri, 7 Jan 2000 08:47:34 +0000 (08:47 +0000)]
always restart nmbd and smbd when asked, even if they appear not to be
responding. They could be stuck
Andrew Tridgell [Fri, 7 Jan 2000 08:46:33 +0000 (08:46 +0000)]
remove scope parameter here too
Andrew Tridgell [Fri, 7 Jan 2000 06:58:20 +0000 (06:58 +0000)]
added "netbios scope" docs
Andrew Tridgell [Fri, 7 Jan 2000 06:55:36 +0000 (06:55 +0000)]
this looks like a big commit, but it isn't really :)
This fixes our netbios scope handling. We now have a 'netbios scope' option
in smb.conf and the scope option is removed from make_nmb_name()
this was prompted by a bug in our PDC finding code where it didn't append
the scope to the query of the '*' name.
Andrew Tridgell [Fri, 7 Jan 2000 06:14:43 +0000 (06:14 +0000)]
don't use strcpy
Andrew Tridgell [Fri, 7 Jan 2000 03:02:13 +0000 (03:02 +0000)]
don't require readline
Andrew Tridgell [Fri, 7 Jan 2000 03:01:55 +0000 (03:01 +0000)]
- patch from Rusty to neaten up the code a bit
- fixed a race condition in tdb_open()
Jeremy Allison [Thu, 6 Jan 2000 21:58:26 +0000 (21:58 +0000)]
Removed unneeded #define.
Jeremy.
Jeremy Allison [Thu, 6 Jan 2000 21:23:49 +0000 (21:23 +0000)]
Fixed spurious error message when doing a 'put' of an empty file.
Jeremy
Jeremy Allison [Thu, 6 Jan 2000 21:09:11 +0000 (21:09 +0000)]
Generic wildcard matching fix from weidel@multichart.de.
Jeremy.
Jeremy Allison [Thu, 6 Jan 2000 01:41:27 +0000 (01:41 +0000)]
Re-added "dfree command" functionality that was described in the man pages
but was not in the code.
Jeremy.
Jeremy Allison [Thu, 6 Jan 2000 00:06:46 +0000 (00:06 +0000)]
Fix for renaming directories on OS/2 server. Fix from John Janosik <jpjanosi@us.ibm.com>.
Jeremy.
Jeremy Allison [Wed, 5 Jan 2000 23:46:47 +0000 (23:46 +0000)]
Moved check_plaintext_password() into smbd/chgpasswd.c from smbd/ipc.c.
configure configure.in include/config.h.in: Added <sys/un.h> autoconf
code for Luke's UNIX domain sockets code.
Jeremy.
Jeremy Allison [Wed, 5 Jan 2000 19:59:42 +0000 (19:59 +0000)]
client/client.c: I18N fixes.
smbd/dir.c: Reformatting comments.
smbd/ipc.c: New password change code for Win98.
Jeremy.
Andrew Tridgell [Wed, 5 Jan 2000 06:36:36 +0000 (06:36 +0000)]
implemented talloc() as described on samba-technical. This fixes the
lp_string() bug properly.
we still need to add lp_talloc_free() calls in all the main event
loops, I've only put it in smbd and nmbd thus far.
Andrew Tridgell [Wed, 5 Jan 2000 01:50:06 +0000 (01:50 +0000)]
lower the default hash size a bit
Andrew Tridgell [Wed, 5 Jan 2000 01:48:30 +0000 (01:48 +0000)]
use a minimal hash size in the unexpected packet database. A large
hash is only useful when we fetch by key, not when we use
tdb_traverse()
Jeremy Allison [Tue, 4 Jan 2000 19:19:07 +0000 (19:19 +0000)]
Added "crap" fix for rotating string buffers. (Increased to 20, added #define).
Andrew - please fix this properly when you have time :-).
Jeremy.
Luke Leighton [Tue, 4 Jan 2000 15:59:57 +0000 (15:59 +0000)]
using read_with_timeout(), min data size 16 bytes (DCE/RPC header), max
size of SMBtrans response, timeout of 10 seconds. read_data() _certainly_
doesn't work, as you don't know what size of the data is going to come
back that needs to be fed back in the SMBtrans response. yes, oops :-)
Luke Leighton [Tue, 4 Jan 2000 07:52:21 +0000 (07:52 +0000)]
oops, must use read_data() not read(), as read() may only provide
part of the data stream. read_data() is a wrapper to guarantee
receiving exactly the requested number of bytes.
Jeremy Allison [Tue, 4 Jan 2000 01:01:27 +0000 (01:01 +0000)]
Fixed getgrent() recurse problem.
Jeremy.
Luke Leighton [Mon, 3 Jan 2000 19:19:48 +0000 (19:19 +0000)]
simple mods to add msrpc pipe redirection. default behaviour: fall back
to using internal msrpc code in smbd.
Andrew Tridgell [Mon, 3 Jan 2000 06:30:50 +0000 (06:30 +0000)]
added suppport for unexpected udp/138 packets
I also fixed up the lookup_pdc_name() code so that it now works, even
with a NT server that insists on replying to udp/138.
The method I used to match packets was to use the mailslot string as a
datagram ID. The true dgm_id doesn't work as NT doesn't set it
correctly. uggh.
PS: Jeremy, I had to change your code quite a bit, are you sure this
worked with a Samba PDC?? The code looked broken, it got the offsets
wrong in the SMB portion of the packet and filled in the IP
incorrectly.
Andrew Tridgell [Mon, 3 Jan 2000 03:39:04 +0000 (03:39 +0000)]
ignore a few files
Andrew Tridgell [Mon, 3 Jan 2000 03:31:41 +0000 (03:31 +0000)]
got rid of mem_man
yamd is much better, and doesn't require any source code changes
if you haven't seen yamd then take a look at
http://www3.hmc.edu/~neldredge/yamd/
its excellent!
Andrew Tridgell [Mon, 3 Jan 2000 03:24:23 +0000 (03:24 +0000)]
the bulk of the unexpected packet handling code is in here
Andrew Tridgell [Mon, 3 Jan 2000 03:17:16 +0000 (03:17 +0000)]
added the unexpected packet database (unexpected.tdb)
this means "nmblookup -S" now always works, even with broken servers
the database stores all unexpected replies and these can be accessed
by any client.
while doing this I cleaned up a couple of functions, and put in place
a better trn_id generator. in most places the code got quite a bit
simpler due to the addition of simple helper functions.
I haven't yet put the code in to take advantage of this for pdc
replies - that will be next. Jeremys pdc finding code will then work :)
Andrew Tridgell [Mon, 3 Jan 2000 00:52:14 +0000 (00:52 +0000)]
drop the alignment to 4 bytes - this makes tdb more space efficient
and doesn't seem to affect performance
Andrew Tridgell [Mon, 3 Jan 2000 00:32:14 +0000 (00:32 +0000)]
fixed active shares display
Andrew Tridgell [Mon, 3 Jan 2000 00:22:43 +0000 (00:22 +0000)]
don't close the database after each claim_connection()
Andrew Tridgell [Sun, 2 Jan 2000 23:03:32 +0000 (23:03 +0000)]
updated docs
Andrew Tridgell [Sun, 2 Jan 2000 23:00:27 +0000 (23:00 +0000)]
- added tdb_flags option to tdb_open()
- added TDB_CLEAR_IF_FIRST flag to clear the database if this is the
first attached process. Useful for non-persistent databases like our
locking area (this will also make upgrades to new database layouts easier)
- use lock_path() in a couple of places
- leave connections database open while smbd running
- cleaned up some tdb code a little, using macros for constants
Andrew Tridgell [Sun, 2 Jan 2000 01:40:54 +0000 (01:40 +0000)]
show test result in ops/sec
Andrew Tridgell [Sun, 2 Jan 2000 01:40:35 +0000 (01:40 +0000)]
- optimise tdb_store() a little
- prevent a free of an unallocated pointer
Jeremy Allison [Wed, 29 Dec 1999 02:00:38 +0000 (02:00 +0000)]
Converted most of the functions in lib/util_str.c to smb_ucs2_t equivalents.
Jeremy.
Andrew Tridgell [Fri, 24 Dec 1999 08:46:02 +0000 (08:46 +0000)]
a useful locking tester - it uses lots of simultaneous writers
Andrew Tridgell [Fri, 24 Dec 1999 08:45:02 +0000 (08:45 +0000)]
fixed more locking bugs - all seems OK now
Jeremy Allison [Thu, 23 Dec 1999 18:58:44 +0000 (18:58 +0000)]
Fixed range checking in unicode to multibyte function. Oops.
Jeremy.
Jeremy Allison [Thu, 23 Dec 1999 02:01:37 +0000 (02:01 +0000)]
Added wtoupper/wtolower.
Jeremy.
Jeremy Allison [Thu, 23 Dec 1999 01:57:43 +0000 (01:57 +0000)]
Samba now includes a full ucs2 upper to lower case (and vica versa) map table.
Jeremy.
Jeremy Allison [Thu, 23 Dec 1999 01:53:25 +0000 (01:53 +0000)]
Upper to lower case map table for unicode.
Jeremy.
Jeremy Allison [Thu, 23 Dec 1999 01:41:19 +0000 (01:41 +0000)]
Awk script to create #include C code from unicode upper -> lower case map.
Jeremy.